Get Block Number by Timestamp
Retrieves the block number mined at a specific timestamp.
Authorizations
Enter your Etherscan API key, or set one up if you don't have one.
Query Parameters
Chain ID you query, eg 1 for Ethereum, 42161 for Arbitrum from our supported chains.
Set to block for this endpoint.
Set to getblocknobytime for this endpoint.
Unix timestamp in seconds.
Closest available block to the provided timestamp, either before or after.
Response
Successful response
1 if the request returned data, 0 otherwise. A status of 0 can indicate an error or a valid request that returned no records.
OK on success, otherwise an error description such as NOTOK. See common error messages.
Block number closest to the given timestamp.