{"uid":"cap_YxIFUdMPJ7z49xRuJPzUg","slug":"saylor-innovations-data-desk-block-at-time-7ecaa3e6","name":"Saylor Innovations Data Desk: Block at Time","description":"Find the block mined at or before any date or unix time on 16 EVM chains, with the gap in seconds, the next block and the chain's block interval.","url":"https://saylorinnovations.com/api/chain/block-at-time?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["chain","timestamp"],"properties":{"chain":{"type":"string","description":"chain name (ethereum, base, arbitrum, optimism, polygon, bsc, avalanche, gnosis, linea, scroll, mantle, blast, sonic, celo, berachain, unichain) or chain id"},"timestamp":{"type":"string","description":"unix seconds, unix milliseconds, or an ISO date such as 2024-01-31 or 2024-01-31T12:00:00Z"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","required":["chain","chain_id","requested_time","block_number","block_time","seconds_before_request","note","source"],"properties":{"note":{"type":"string","description":"plain-language reading of the result"},"chain":{"type":"string","description":"the chain name that was queried"},"source":{"type":"string","description":"where the data was read from or how it was computed"},"lookups":{"type":"number","description":"node requests used"},"chain_id":{"type":"number","description":"EIP-155 chain id of that network"},"block_time":{"type":"string","description":"that block's time, UTC"},"block_number":{"type":"number","description":"last block at or before that time"},"latest_block":{"type":"number","description":"current chain tip"},"requested_time":{"type":"string","description":"the time asked for, UTC"},"next_block_number":{"type":["number","null"],"description":"the following block"},"seconds_before_request":{"type":"number","description":"gap between the block and the requested time"}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_IsT20SnLbIR7CvxDYIswN","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns the EVM block mined at or before a given timestamp on 16 supported chains, along with the gap in seconds, the next block number, and the chain's block interval.","exampleAgentPrompt":"What was the Ethereum block number at midnight UTC on March 15, 2024? I also need to know how many seconds before that time the block was mined and what the next block was.","exampleUseCases":[{"title":"Historical snapshot for DeFi audit","prompt":"What block was Base chain at on 2024-06-01T00:00:00Z? I need the block number, when exactly that block was mined, and the next block number so I can query on-chain state at that point."},{"title":"Cross-chain event correlation","prompt":"I need to find the closest block on both Arbitrum and Optimism to unix timestamp 1704067200 — can you look up the block number, the exact block time, and how many seconds off it was from my timestamp for each chain?"},{"title":"Smart contract deployment window check","prompt":"On Polygon, what was the block number just before 2023-11-15T09:30:00Z? I want to know the block time, the gap in seconds, and the next block number to bracket the deployment window."}],"resultDescription":"A JSON object containing the chain name and chain ID, the requested time in UTC, the resolved block number (last block at or before the requested time), the exact block timestamp in UTC, the gap in seconds between the block and the requested time, the next block number, the current chain tip, a plain-language note summarizing the result, the data source used, and the number of node requests made.","failureModes":["Unsupported chain name or chain ID returns an error","Timestamp in an unrecognized format may be rejected","Timestamp far in the future beyond the chain tip cannot be resolved","Network or node errors may cause lookup failures","Malformed query parameters return a 4xx error"],"whenToPreferThis":"Use this endpoint when you need to resolve a human-readable date or unix timestamp to an exact EVM block number on any of the 16 supported chains (Ethereum, Base, Arbitrum, Optimism, Polygon, BSC, Avalanche, Gnosis, Linea, Scroll, Mantle, Blast, Sonic, Celo, Berachain, Unichain). It is ideal for historical data queries, on-chain state lookups at a specific point in time, or correlating off-chain events with on-chain activity. Prefer it over manual binary search or RPC calls when you want a single API call that handles the bisection logic and returns contextual metadata like gap seconds and next block.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-22T12:41:59.946Z","isFirstParty":false,"canonicalSlug":"saylor-innovations-data-desk-block-at-time-7ecaa3e6"}