# Goldsky Feeds API – Chain Head Block

> Goldsky Feeds API – Chain Head Block 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 the current head block number, timestamp, and lag for a specified blockchain chain

## Facts

- Endpoint: GET https://edge.goldsky.com/data/blocks/%7Bchain%7D/head?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-chain-head-block-b4efd223
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_L3wOg0NqGutG-OlBXMr0P

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-chain-head-block-b4efd223
```

Example prompt: What's the current head block number and timestamp for Ethereum right now, and how many seconds behind is Goldsky's feed?

## When to prefer this

Use this endpoint when you need a fast, single-call lookup of the current chain head block number and timestamp for a specific blockchain, particularly when monitoring indexer freshness or confirming block heights. Prefer it over full block-range queries when only the latest state is needed, and over general RPC endpoints when you want REST/JSON access with USD-denominated micropayment billing.

## Known failure modes

- Unsupported or misspelled chain name returns 404 or empty/error response
- Invalid or missing API key returns 401 Unauthorized
- Temporary indexer lag may cause head_lag_seconds to be elevated without error
- Rate limiting or insufficient prepaid balance may result in 402 Payment Required
- Network timeout if the Goldsky edge node is temporarily unavailable

## 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

A JSON object containing the chain identifier string, the current head block number as an integer, the Unix timestamp of that block as an integer, and the head_lag_seconds integer indicating how many seconds behind real-time the indexed head currently is.

## 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": {
   "chain": {
    "type": "string"
   },
   "number": {
    "type": "integer"
   },
   "timestamp": {
    "type": "integer"
   },
   "head_lag_seconds": {
    "type": "integer"
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/goldsky-feeds-api-chain-head-block-b4efd223/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)
