Get Block Statistics#
Retrieve daily historical block statistics for a chain, including the number of blocks produced, average block size, block rewards, and average block interval. Data is returned by date from most recent to oldest. Only some major chains are supported (BTC, ETH, TRON, and major EVM chains).
Supported chains: see Get Block API Supported Chains (apiName: block-stats).
Request URL#
GET
https://web3.okx.com/api/v6/explorer/block/block-statsRequest Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
| chainIndex | String | Yes | Unique identifier of the chain, e.g., 1 for ETH, 0 for BTC. See Get Block API Supported Chains for supported values. |
| startTime | String | No | Query start time, as a Unix timestamp in milliseconds, e.g., 1597026383085. The interval between startTime and endTime must not exceed 1 year. |
| endTime | String | No | Query end time, as a Unix timestamp in milliseconds, e.g., 1597026383085. The interval between startTime and endTime must not exceed 1 year. |
| cursor | String | No | Pagination cursor. Pass the cursor returned by the previous response; omit it on the first request. |
| limit | String | No | Number of results to return. Defaults to the most recent 20, up to a maximum of 100. |
Response Parameters#
| Parameter | Type | Description |
|---|---|---|
| limit | String | Maximum number of results per page. |
| cursor | String | Cursor for the next page; an empty string means no more pages. Pass it back as-is; clients should not parse or construct it. |
| blockHistoryList | Array | Historical block statistics. |
| > time | String | Date, at daily granularity, as a Unix timestamp in milliseconds, e.g., 1597026383085. |
| > blockCount | String | Total number of blocks produced that day. |
| > blockSize | String | Average block size that day, in bytes. |
| > mineReward | String | Total block rewards that day. |
| > rewardSymbol | String | Currency of the total block rewards that day. |
| > avgBlockInterval | String | Average block interval that day, in seconds. |
Request Example#
shell
curl --location --request GET 'https://web3.okx.com/api/v6/explorer/block/block-stats?chainIndex=1&limit=20' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z'
Response Example#
json
{
"code": "0",
"msg": "",
"data": [
{
"limit": "20",
"cursor": "MTcwNTA1OTgzOTAwMA",
"blockHistoryList": [
{
"time": "1705104000000",
"blockCount": "7126",
"blockSize": "98510",
"mineReward": "327.5041",
"rewardSymbol": "ETH",
"avgBlockInterval": "12.12"
},
{
"time": "1705017600000",
"blockCount": "7130",
"blockSize": "97236",
"mineReward": "331.2087",
"rewardSymbol": "ETH",
"avgBlockInterval": "12.11"
}
]
}
]
}
