Get Block List#
Retrieve the block list for a specified chain, returned from newest to oldest by block height. Use the height parameter to locate the block at a specific height.
Supported chains: see Get Block API Supported Chains (apiName: block-list).
Request URL#
GET
https://web3.okx.com/api/v6/explorer/block/block-listRequest 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. |
| height | String | No | Block height (digits only). When provided, returns the block at that height; when omitted, returns the latest block list. |
| 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. |
| chainIndex | String | Unique identifier of the chain. |
| blockList | Array | Block list. |
| > hash | String | Block hash. |
| > height | String | Block height. |
| > validator | String | Block producer / super node / validator. |
| > blockTime | String | Block time, as a Unix timestamp in milliseconds, e.g., 1597026383085. |
| > txnCount | String | Number of transactions contained in the block. |
| > blockSize | String | Block size, in bytes. |
| > mineReward | String | Block reward. Total block earnings equal mineReward + totalFee. |
| > totalFee | String | Sum of all transaction fees in the block. |
| > feeSymbol | String | Transaction fee currency. |
| > avgFee | String | Average transaction fee per transaction. |
| > ommerBlock | String | Number of ommer (uncle) blocks. |
| > gasUsed | String | Gas used. |
| > gasLimit | String | Gas limit. |
| > gasAvgPrice | String | Average gas price. |
| > state | String | Block state: pending when confirming, done when confirmed. Chains where this does not apply return an empty string "". |
| > burnt | String | Amount of transaction fees burnt. |
Request Example#
shell
curl --location --request GET 'https://web3.okx.com/api/v6/explorer/block/block-list?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": "2",
"chainIndex": "1",
"blockList": [
{
"hash": "0xba9ded5ca1ec9adb9451bf062c9de309d9552fa0f0254a7b982d3daf7ae436cd",
"height": "19000000",
"validator": "beaverbuild",
"blockTime": "1705146239000",
"txnCount": "150",
"blockSize": "57619",
"mineReward": "0.044304750347454041",
"totalFee": "0.352967975656501696",
"feeSymbol": "ETH",
"avgFee": "0.0023",
"ommerBlock": "0",
"gasUsed": "12849554",
"gasLimit": "30000000",
"gasAvgPrice": "0.000000027468899821",
"state": "",
"burnt": "0.308663225309047655"
}
]
}
]
}
