Skip to main content
GET
Get Block Number by Timestamp

Authorizations

apikey
string
query
required

Your Etherscan API key.

Query Parameters

chainid
string
required

Chain ID you query, eg 1 for Ethereum, 8453 for Base from our supported chains.

module
string
default:block
required

Set to block for this endpoint.

action
string
default:getblocknobytime
required

Set to getblocknobytime for this endpoint.

timestamp
integer
required

Unix timestamp in seconds.

closest
string
required

Closest available block to the provided timestamp, either before or after.