LogoLogo
HomeMetadata APIAPI PROTwitter
Etherscan V2
Etherscan V2
  • Introduction
  • Chef's Pick
  • Rate Limits
  • V1 to V2 API Migration Guide
  • ✨Getting Started
    • Creating an Account
    • Getting an API Key
    • Supported Chains
    • Supported Endpoints
  • 🎯API Endpoints
    • Nametags
    • Accounts
    • Contracts
    • Transactions
    • Blocks
    • Logs
    • Geth/Parity Proxy
    • Tokens
    • Gas Tracker
    • Stats
    • L2 Deposits/Withdrawals
    • Usage
  • 🏆API PRO
    • Etherscan API PRO
    • Metadata/Name Tag API
  • 🍳Cookbook
    • Track Uniswap V4 DEX Trades
  • Get An Address's Full Transaction History
  • 🤝Support
    • FAQ
    • Legacy V1 Docs
    • Checking Usage
    • Common Error Messages
    • Getting Help
  • Visit Etherscan.io
Powered by GitBook
On this page
  • Get Block And Uncle Rewards by BlockNo
  • Get Block Transactions Count by BlockNo
  • Get Estimated Block Countdown Time by BlockNo
  • Get Block Number by Timestamp
  • Get Daily Average Block Size
  • Get Daily Block Count and Rewards
  • Get Daily Block Rewards
  • Get Daily Average Time for A Block to be Included in the Ethereum Blockchain
  • Get Daily Uncle Block Count and Rewards
  1. API Endpoints

Blocks

PreviousTransactionsNextLogs

Last updated 4 months ago

Endpoints with are under the API Pro subscription. To upgrade your API plan, browse through the page.

Get Block And Uncle Rewards by BlockNo

Returns the block reward and 'Uncle' block rewards.

https://api.etherscan.io/v2/api
   ?chainid=1
   &module=block
   &action=getblockreward
   &blockno=2165403
   &apikey=YourApiKeyToken

Try this endpoint in your

Query Parameters

Parameter
Description

blockno

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":{
      "blockNumber":"2165403",
      "timeStamp":"1472533979",
      "blockMiner":"0x13a06d3dfe21e0db5c016c03ea7d2509f7f8d1e3",
      "blockReward":"5314181600000000000",
      "uncles":[
         {
            "miner":"0xbcdfc35b86bedf72f0cda046a3c16829a2ef41d1",
            "unclePosition":"0",
            "blockreward":"3750000000000000000"
         },
         {
            "miner":"0x0d0c9855c722ff0c78f21e43aa275a5b8ea60dce",
            "unclePosition":"1",
            "blockreward":"3750000000000000000"
         }
      ],
      "uncleInclusionReward":"312500000000000000"
   }
}

Get Block Transactions Count by BlockNo

Returns the number of transactions in a specified block.

This endpoint is only available on Etherscan, `chainId` 1

https://api.etherscan.io/v2/api
   ?chainid=1
   &module=block
   &action=getblocktxnscount
   &blockno=2165403
   &apikey=YourApiKeyToken

Query Parameters

Parameter
Description

blockno

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":{
      "block":2165403,
      "txsCount":4,
      "internalTxsCount":0,
      "erc20TxsCount":0,
      "erc721TxsCount":0,
      "erc1155TxsCount":0
   }
}

Get Estimated Block Countdown Time by BlockNo

Returns the estimated time remaining, in seconds, until a certain block is mined.

https://api.etherscan.io/v2/api
   ?chainid=1
   &module=block
   &action=getblockcountdown
   &blockno=16701588
   &apikey=YourApiKeyToken

Query Parameters

Parameter
Description

blockno

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":{
      "CurrentBlock":"12715477",
      "CountdownBlock":"16701588",
      "RemainingBlock":"3986111",
      "EstimateTimeInSec":"52616680.2"
   }
}

Get Block Number by Timestamp

Returns the block number that was mined at a certain timestamp.

https://api.etherscan.io/v2/api
   ?chainid=1
   &module=block
   &action=getblocknobytime
   &timestamp=1578638524
   &closest=before
   &apikey=YourApiKeyToken

Query Parameters

Parameter
Description

timestamp

the integer representing the Unix timestamp in seconds.

closest

the closest available block to the provided timestamp, either before or after

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":"12712551"
}

Returns the daily average block size within a date range.

https://api.etherscan.io/v2/api
   ?chainid=1
   &module=stats
   &action=dailyavgblocksize
   &startdate=2019-02-01
   &enddate=2019-02-28
   &sort=asc
   &apikey=YourApiKeyToken

Query Parameters

Parameter
Description

startdate

the starting date in yyyy-MM-dd format, eg. 2019-02-01

enddate

the ending date in yyyy-MM-dd format, eg. 2019-02-28

sort

the sorting preference, use asc to sort by ascending and desc to sort by descending

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "UTCDate":"2019-02-01",
         "unixTimeStamp":"1548979200",
         "blockSize_bytes":20373
      },
      {
         "UTCDate":"2019-02-28",
         "unixTimeStamp":"1551312000",
         "blockSize_bytes":25117
      }
   ]
}

Returns the number of blocks mined daily and the amount of block rewards.

https://api.etherscan.io/v2/api
   ?chainid=1
   &module=stats
   &action=dailyblkcount
   &startdate=2019-02-01
   &enddate=2019-02-28
   &sort=asc
   &apikey=YourApiKeyToken 

Query Parameters

Parameter
Description

startdate

the starting date in yyyy-MM-dd format, eg. 2019-02-01

enddate

the ending date in yyyy-MM-dd format, eg. 2019-02-28

sort

the sorting preference, use asc to sort by ascending and desc to sort by descending

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "UTCDate":"2019-02-01",
         "unixTimeStamp":"1548979200",
         "blockCount":4848,
         "blockRewards_Eth":"14929.464690870590355682"
      },
      {
         "UTCDate":"2019-02-28",
         "unixTimeStamp":"1551312000",
         "blockCount":4366,
         "blockRewards_Eth":"12808.485512162356907132"
      }
   ]
}

Returns the amount of block rewards distributed to miners daily.

https://api.etherscan.io/v2/api
   ?chainid=1
   &module=stats
   &action=dailyblockrewards
   &startdate=2019-02-01
   &enddate=2019-02-28
   &sort=asc
   &apikey=YourApiKeyToken 

Query Parameters

Parameter
Description

startdate

the starting date in yyyy-MM-dd format, eg. 2019-02-01

enddate

the ending date in yyyy-MM-dd format, eg. 2019-02-28

sort

the sorting preference, use asc to sort by ascending and desc to sort by descending

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "UTCDate":"2019-02-01",
         "unixTimeStamp":"1548979200",
         "blockRewards_Eth":"15300.65625"
      },
      {
         "UTCDate":"2019-02-28",
         "unixTimeStamp":"1551312000",
         "blockRewards_Eth":"12954.84375"
      }
   ]
}

Returns the daily average of time needed for a block to be successfully mined.

https://api.etherscan.io/v2/api
   ?chainid=1
   &module=stats
   &action=dailyavgblocktime
   &startdate=2019-02-01
   &enddate=2019-02-28
   &sort=asc
   &apikey=YourApiKeyToken 

Query Parameters

Parameter
Description

startdate

the starting date in yyyy-MM-dd format, eg. 2019-02-01

enddate

the ending date in yyyy-MM-dd format, eg. 2019-02-28

sort

the sorting preference, use asc to sort by ascending and desc to sort by descending

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "UTCDate":"2019-02-01",
         "unixTimeStamp":"1548979200",
         "blockTime_sec":"17.67"
      },
      {
         "UTCDate":"2019-02-28",
         "unixTimeStamp":"1551312000",
         "blockTime_sec":"19.61"
      }
   ]
}

Returns the number of 'Uncle' blocks mined daily and the amount of 'Uncle' block rewards.

https://api.etherscan.io/v2/api
   ?chainid=1
   &module=stats
   &action=dailyuncleblkcount
   &startdate=2019-02-01
   &enddate=2019-02-28
   &sort=asc
   &apikey=YourApiKeyToken 

Query Parameters

Parameter
Description

startdate

the starting date in yyyy-MM-dd format, eg. 2019-02-01

enddate

the ending date in yyyy-MM-dd format, eg. 2019-02-28

sort

the sorting preference, use asc to sort by ascending and desc to sort by descending

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "UTCDate":"2019-02-01",
         "unixTimeStamp":"1548979200",
         "uncleBlockCount":287,
         "uncleBlockRewards_Eth":"729.75"
      },
      {
         "UTCDate":"2019-02-28",
         "unixTimeStamp":"1551312000",
         "uncleBlockCount":288,
         "uncleBlockRewards_Eth":"691.5"
      }
   ]
}

the integer block number to check block rewards for eg.

​​ Tip : The timestamp field is denoted in

Try this endpoint in your

the integer block number to get the transaction count for, eg.

Try this endpoint in your

the integer block number to estimate time remaining to be mined eg.

Try this endpoint in your

Tip : Convert a regular date-time to a

Get Daily Average Block Size

Try this endpoint in your

Get Daily Block Count and Rewards

Try this endpoint in your

Get Daily Block Rewards

Try this endpoint in your

Get Daily Average Time for A Block to be Included in the Ethereum Blockchain

Try this endpoint in your

Get Daily Uncle Block Count and Rewards

Try this endpoint in your

🎯
⏳
Unix timestamp.
🔗
browser
🔗
browser
🔗
browser
⏳
Unix timestamp.
🔗
browser
🔗
browser
🔗
browser
🔗
browser
🔗
browser
12697906
2165403
12697906
🔗
Etherscan APIs
browser