# Goldsky Feeds API – Blocks by Chain

> Goldsky Feeds API – Blocks by Chain is a paid API for AI agents from edge.goldsky.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-31).

Returns a paginated list of recent blocks for a specified blockchain, including block metadata and chain state.

## Facts

- Endpoint: GET https://edge.goldsky.com/data/blocks/%7Bchain%7D?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/goldsky-feeds-api-blocks-by-chain-9f5f28ff
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_otwzuBV1P5Sb-2SZGVD_t

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability goldsky-feeds-api-blocks-by-chain-9f5f28ff
```

Example prompt: Fetch me the latest blocks on Ethereum using Goldsky Feeds so I can see recent block heights, timestamps, and hashes — return up to 20 results.

## When to prefer this

Choose this endpoint when you need raw block-level data (block numbers, hashes, timestamps) for a specific blockchain over REST without running a full node or setting up a subgraph. Ideal for lightweight chain monitoring, data pipelines, or auditing block production history. Prefer this over RPC-based block fetching when you want a simple paginated REST interface with consistent JSON output and no node infrastructure overhead.

## Known failure modes

- 401 Unauthorized if the API key is invalid or missing
- Unknown or unsupported chain identifier returns an error or empty result
- Rate limiting if requests exceed allowed throughput
- Malformed request parameters may return 400 Bad Request
- next_cursor may be null when no more pages are available

## How this service works

Goldsky Feeds: onchain data over REST. Formerly Edge Data / Data APIs; existing URLs and keys keep working.

- **Wallet feeds**: one wallet's token transfers or balances across chains, with USD values (`/feeds/wallets/transfers`, `/feeds/wallets/balances`).
- **Tokens**: metadata and current USD price for up to 100 `chain:token_address` pairs per request (`/feeds/tokens`).
- **Prediction markets** (Polymarket, on Polygon): Activity, Positions and Balances (`/polymarket/*`).
- **Chain datasets**: Blocks and Chain head for each supported chain (`/blocks/{chain}`, `/blocks/{chain}/head`).

Base URL: `https://edge.goldsky.com/data`. Every endpoint is a `GET` that returns JSON.

## Authentication

Send your Feeds API key in the `x-api-key` header, as the `?key=` query parameter, or as `Authorization: Bearer <key>`. Get it at [app.goldsky.com](https://app.goldsky.com) under **Feeds → API keys**. One key works for every endpoint; an invalid key gets `401`.

## Billing

Requests made with a key bill compute units (CUs) at $10 per million:

- Wallet feeds and Tokens: 35 CUs per request.
- Prediction markets and Chain datasets: 1 CU per row returned. Chain head is 1 CU per call.

Errors are not billed, and a Prediction markets or Chain datasets request that returns no rows costs nothing. Rate limits are set per plan (`429` when exceeded); Goldsky support can raise them.

## Pay per request with x402

No account or key needed. A request without a key gets `402` with an x402 v2 challenge in the `PAYMENT-REQUIRED` header (base64 JSON; the body carries the same challenge). Pay in USDC through Circle Gateway and retry. Each payment is a $0.005 prepaid top-up, tied to the paying wallet and shared with Edge RPC, that later requests spend down:

- Wallet feeds and Tokens: $0.00035 (350 atomic USDC) per request.
- Prediction markets and Chain datasets: $0.00001 (10 atomic USDC) per request, whatever the row count.

The payment flow is in [x402 nanopayments](https://docs.goldsky.com/edge-rpc/capabilities/x402).

## Output

Returns a JSON object with a `data` array of block objects (containing block number, hash, timestamp, and chain metadata), an integer `limit` field, and a `next_cursor` string (or null) for pagination to the next page of results.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "required": {
   "type": "string"
  },
  "properties": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "schema": {
  "type": "object",
  "properties": {
   "data": {
    "type": "array"
   },
   "limit": {
    "type": "integer"
   },
   "next_cursor": {
    "type": [
     "string",
     "null"
    ]
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/goldsky-feeds-api-blocks-by-chain-9f5f28ff/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from edge.goldsky.com](https://www.zero.xyz/host/edge.goldsky.com/llms.txt)
