{"uid":"cap_z-m1pevkg9o0TwQT-ZrlC","slug":"block-number-by-timestamp-1b9757e9","name":"Block Number by Timestamp","description":"Pay-per-request access to CoinGecko, DefiLlama, Alchemy, and Etherscan APIs. No auth, no subscriptions.","url":"https://stablecrypto.dev/api/defillama/coins/block","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"chain":{"type":"string","description":"Chain name (e.g. \"ethereum\")"},"timestamp":{"type":"number","description":"Unix timestamp"}}},"responseSchema":null,"example":{"request":{"chain":"ethereum","timestamp":1700000000},"response":{"height":18573051,"timestamp":1700000003}},"exampleRequest":{"chain":"ethereum","timestamp":1700000000},"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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_XSBs3pgujC2iYpctMgbV6","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 closest blockchain block number (height) to a given Unix timestamp for a specified chain","exampleAgentPrompt":"What was the closest Ethereum block number to Unix timestamp 1700000000?","exampleUseCases":null,"resultDescription":"Returns a JSON object with the block height (block number) and the actual timestamp of that block on the specified chain, using DefiLlama's block index.","failureModes":["Invalid chain name returns an error or empty result","Timestamp far in the future or before genesis block may return no result","Network timeouts or DefiLlama API downtime result in HTTP 5xx","Missing required fields (chain or timestamp) return a validation error"],"whenToPreferThis":"Use this endpoint when you need to anchor a historical on-chain query to a specific point in time — for example, looking up token prices, balances, or DeFi protocol state at a particular timestamp. Prefer this over RPC-based alternatives when you need a quick, multi-chain lookup without managing your own node.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:52:31.534Z","isFirstParty":false}