Skip to main content
Returns block headers for one chain, newest first by default. Look up one block by number or hash, or filter by a range of block numbers or timestamps. The most common use is turning a timestamp into a block number, and a block number into a timestamp.

Parameters

string
required
The chain’s slug, such as ethereum. See supported chains. Polygon is matic, not polygon.
integer
Return only the block with this number. Can’t be combined with hash or any range parameter.
string
Return only the block with this hash: 0x followed by 64 hex characters. Can’t be combined with number or any range parameter.
integer
Only return blocks numbered at or above this.
integer
Only return blocks numbered at or below this.
integer
Only return blocks at or after this time, in Unix seconds.
integer
Only return blocks at or before this time, in Unix seconds. With sort=number_desc and limit=1, it returns the newest block at or before the time.
string
default:"number_desc"
number_desc, newest first, or number_asc, oldest first.
integer
default:"100"
Rows per page, up to 1000. See pagination.
string
The next_cursor from a previous response. Use the same sort as the request that returned it.
With no filters, the request returns the chain’s newest blocks.

Response

object[]
One entry per block, in sort order.
integer
The page size used for this response.
string | null
Pass it as cursor to get the next page. null on the last page.

Supported chains

Blocks and Chain head support 21 chains, a different list from the wallet feeds’ chains. Pass the slug in the path: Any other value returns 400 BAD_REQUEST, and error.message lists the supported slugs. The live list is the chain enum in the OpenAPI spec.

How the data behaves

  • Recent blocks can change. A block near the chain head can be replaced in a reorganization. Requests with number, hash, number_lte, or timestamp_lte carry Cache-Control: public, max-age=300. Other requests carry public, max-age=2.
  • A block that doesn’t exist yet returns an empty page. Asking for a number above the chain head returns 200 with an empty data array, not an error. Use Chain head to see how far a chain goes.
  • Timestamps are Unix seconds. timestamp is an integer, not an RFC 3339 string as in the wallet feeds.

Errors

This endpoint returns the same errors as the other feeds. These are specific to it:

Billing

With an API key, each block returned is one compute unit, at $10 per million. An empty page is free. With x402, each request costs 10 atomic USDC ($0.00001), however many blocks it returns. See Feeds pricing.

Example

Find the newest Ethereum block at or before Unix time 1783820990:
To go the other way, from a block number to its timestamp, send number=25513360 instead.