{"uid":"cap_mYU_CWRsBpDJ2aWHQx1r2","slug":"blockchain-block-number-by-timestamp-lookup-d13759f3","name":"Blockchain Block Number by Timestamp Lookup","description":"Generate an AI_POLICY.md and a pull request template with an AI-disclosure section for your open-source repo. Free, runs in your browser.","url":"https://ai-policy-kit.moneymaker-ai.workers.dev/api/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","time"],"properties":{"time":{"type":"string","description":"unix seconds, unix ms, or ISO 8601 (UTC)"},"chain":{"enum":["base","ethereum","bsc","arbitrum","optimism","polygon","gnosis","celo"],"type":"string"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"block":128381698,"chain":"bsc","exact":true,"rounds":7,"chainId":56,"next_block":128381699,"latest_block":128445498,"block_time_utc":"2026-10-18T14:53:53.000Z","requested_time_utc":"2026-10-18T14:53:53.000Z","next_block_time_utc":"2026-10-18T14:53:54.000Z"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_AIpy1S5946d-cpIzpMuFw","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns the block number (and surrounding block metadata) on a given blockchain that corresponds to a specified timestamp","exampleAgentPrompt":"What block number was active on Base at 2026-10-18T14:53:53 UTC?","exampleUseCases":[{"title":"DeFi snapshot at specific block","prompt":"I need to know which Ethereum block was mined at exactly midnight UTC on January 1 2025 — can you look that up for me?"},{"title":"Arbitrage replay on BSC","prompt":"Find the BSC block number that corresponds to the unix timestamp 1729259633 so I can replay the on-chain state at that moment."},{"title":"Cross-chain event alignment","prompt":"I'm aligning events across chains — what was the Polygon block number at 2025-06-15T09:00:00Z?"}],"resultDescription":"A JSON object containing the resolved block number, chain name, chain ID, the exact UTC time of that block, the next block number and its time, the latest block number at query time, whether the match was exact, and the number of search rounds taken to converge.","failureModes":["Invalid or unsupported chain name returns an error","Malformed or out-of-range timestamp causes a 400 error","Timestamp far in the future may return an estimate rather than an exact block","Network or upstream node timeout may cause 5xx response","Missing required query parameters (chain or time) returns a validation error"],"whenToPreferThis":"Choose this endpoint when you need to map a human-readable or programmatic timestamp to a specific block number on a supported EVM-compatible chain (Base, Ethereum, BSC, Arbitrum, Optimism, Polygon, Gnosis, Celo). It is ideal for DeFi analytics, historical state queries, cross-chain event alignment, and smart contract audit workflows where you need precise block-time correspondence without running your own node.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-19T12:41:06.868Z","isFirstParty":false,"canonicalSlug":"blockchain-block-number-by-timestamp-lookup-d13759f3"}