> ## Documentation Index
> Fetch the complete documentation index at: https://docs.goldsky.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Chain head

> Get the latest block Goldsky has for a chain, with how many seconds behind the current time it is.

```text theme={"dark"}
GET https://edge.goldsky.com/data/blocks/{chain}/head
```

Returns the latest block Goldsky has for one chain, and how far behind the current time it is. Use it to check how fresh the [Blocks](https://docs.goldsky.com/feeds/api/chain-datasets/blocks.md) data is before you rely on it, or to tell a quiet chain from a stalled one.

## Parameters

**chain** `string` *required*

The chain's slug, such as `ethereum`. Takes the same 21 values as [Blocks](https://docs.goldsky.com/feeds/api/chain-datasets/blocks.md#supported-chains). Polygon is `matic`, not `polygon`.

## Response

The response is a single object, with no `data` array and no pagination.

**chain** `string`

The chain's slug.

**number** `integer`

Number of the latest block. Blocks dropped in a reorganization don't count.

**timestamp** `integer`

Time of that block, in Unix seconds.

**head\_lag\_seconds** `integer`

Seconds between the current time and `timestamp`. Compare it with the chain's block time: a lag much longer than a few blocks means the data is behind.

## How the data behaves

* **It moves every block.** Responses carry `Cache-Control: public, max-age=2`.
* **Lag includes block time.** `head_lag_seconds` counts from the block's timestamp, so it's above zero even when Goldsky has the chain's newest block. It's never below zero.

## Errors

This endpoint returns the [same errors](https://docs.goldsky.com/feeds/api/overview.md#errors) as the other feeds. An unsupported chain returns `400 BAD_REQUEST`, and `error.message` lists the supported slugs.

## Billing

With an API key, each request is one compute unit, at \$10 per million. With [x402](https://docs.goldsky.com/feeds/api/overview.md#pay-per-request-with-x402), each request costs 10 atomic USDC (\$0.00001). See [Feeds pricing](https://docs.goldsky.com/pricing/summary.md#feeds).

## Example

```bash theme={"dark"}
curl -H "X-API-Key: $GOLDSKY_FEEDS_API_KEY" \
  "https://edge.goldsky.com/data/blocks/ethereum/head"
```

```json theme={"dark"}
{
  "chain": "ethereum",
  "number": 26292802,
  "timestamp": 1793209415,
  "head_lag_seconds": 5
}
```


## Related topics

- [Pricing: plans, metering, and product costs](https://docs.goldsky.com/pricing/summary.md)
- [Blocks](https://docs.goldsky.com/feeds/api/chain-datasets/blocks.md)
- [CLI Reference](https://docs.goldsky.com/reference/cli.md)
- [Get started with Feeds](https://docs.goldsky.com/feeds/quickstart.md)
- [Compose task triggers: cron, HTTP, and onchain](https://docs.goldsky.com/compose/task-triggers.md)
