Skip to content
TraceFast Docs

Which block was the chain's at a given time

Open the latest blocks in TraceFast →

The last block whose time is at or before a Unix time, and the first block after it — the bracket around the moment. Block times rise strictly with the number, so the answer is exact. final: false means the time is after the newest block: a later block may still land at or before it, so ask again later; nextBlock is then absent. If blocks around the time are temporarily unavailable, the method answers 422 coverage_gap rather than a pair across the gap. Pass a block's number to the block methods for its contents.

GET https://tracefast.xyz/api/v1/chains/1/blocks/at-time
ParameterInTypeNotes
timestampqueryintegerUnix time, seconds. Required.

Access — an API key on the Enriched Data plan or higher (plans), or no key at all: pay per call with x402 at the same path on https://mpp.tracefast.xyz/api/v1, at the price its 402 states. As a tool for AI agents: get_block_at_time on the MCP server. Stable — see stability.

chains/1 is a literal: other chain ids answer 404 chain_not_supported. An unknown query parameter is refused rather than ignored.

Response

200 application/json. Lists in the example are cut to two entries.

{
  "data": {
    "chainId": 1,
    "timestamp": 1767225600,
    "block": {
      "number": 24136052,
      "timestamp": 1767225599
    },
    "nextBlock": {
      "number": 24136053,
      "timestamp": 1767225611
    },
    "final": true
  },
  "meta": {
    "chain": "ethereum",
    "timestamp": 1794918315745,
    "cached": false,
    "asOfBlock": 24136052,
    "docs": "https://docs.tracefast.xyz/api/block-at-time"
  }
}

data

FieldMeaning
blockThe last block whose time is at or before timestamp.
chainIdChain id. 1 is Ethereum mainnet.
finaltrue once a block after timestamp exists: no later block can land at or before it.
nextBlockThe first block after timestamp. Absent while no such block exists yet.
timestampThe time asked about, Unix seconds.

data.block

FieldMeaning
numberBlock height.
timestampUnix seconds.

data.nextBlock

The same fields as data.block.

meta is the same envelope on every method — see conventions.

Errors

StatusWhen
400bad_request: timestamp missing or not a non-negative integer (reason: timestamp_invalid), or an unknown query parameter
404chain_not_supported, or an unknown path
422block_not_available (reason: coverage_gap): blocks around the time are temporarily unavailable; retry later

Malformed input, unknown parameters and the key check's 401/403/429/503 are the same for every method — see conventions and API keys.


Last updated 19 Nov 2026, 11:46 UTC · verified against TraceFast v1.0.332 · Markdown