Skip to main content
GET
/
v2
/
api
Get Block Number by Timestamp
curl --request GET \
  --url https://api.etherscan.io/v2/api
{
  "status": "1",
  "message": "OK",
  "result": "9251482"
}

Documentation Index

Fetch the complete documentation index at: https://docs.etherscan.io/llms.txt

Use this file to discover all available pages before exploring further.

Query Parameters

apikey
string
default:"YourApiKeyToken"
Your Etherscan API key.
chainid
string
default:"1"
Chain ID you query, eg 1 for Ethereum, 8453 for Base from our supported chains.
module
string
default:"block"
Set to block for this endpoint.
action
string
default:"getblocknobytime"
Set to getblocknobytime for this endpoint.
timestamp
integer
default:"1578638524"
Unix timestamp in seconds.
closest
string
default:"before"
Closest available block to the provided timestamp, either before or after.
{
  "status": "1",
  "message": "OK",
  "result": "9251482"
}