Get Block Details#
Retrieve the block header details for a block at a specified height, including the block producer, gas, difficulty, confirmations, and other complete fields.
Supported chains: see Get Block API Supported Chains (apiName: block-fills).
Request URL#
GET
https://web3.okx.com/api/v6/explorer/block/block-fillsRequest 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 | Yes | Block height (digits only). |
Response Parameters#
| Parameter | Type | Description |
|---|---|---|
| chainIndex | String | Unique identifier of the chain. |
| 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. |
| amount | String | Total transaction amount 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. |
| ommerBlock | String | Number of ommer (uncle) blocks. |
| merkleRootHash | String | Merkle root hash. |
| 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. |
| txnInternal | String | Number of internal transactions contained in the block. |
| miner | String | Miner address hash. |
| difficulty | String | Mining difficulty. |
| nonce | String | On PoW blockchains, the nonce describes the mining difficulty. |
| tips | String | Tips. |
| confirm | String | Number of confirmations. |
| baseFeePerGas | String | Base fee per gas. |
Request Example#
shell
curl --location --request GET 'https://web3.okx.com/api/v6/explorer/block/block-fills?chainIndex=1&height=19000000' \
--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": [
{
"chainIndex": "1",
"hash": "0xba9ded5ca1ec9adb9451bf062c9de309d9552fa0f0254a7b982d3daf7ae436cd",
"height": "19000000",
"validator": "beaverbuild",
"blockTime": "1705146239000",
"txnCount": "150",
"amount": "213.6975",
"blockSize": "57619",
"mineReward": "0.044304750347454041",
"totalFee": "0.352967975656501696",
"feeSymbol": "ETH",
"ommerBlock": "0",
"merkleRootHash": "0x2f8b104344fca4fbca3b6ba1b46247ae2ac02c15dcd7a19b4549351c110c6c5a",
"gasUsed": "12849554",
"gasLimit": "30000000",
"gasAvgPrice": "0.000000027468899821",
"state": "",
"burnt": "0.308663225309047655",
"txnInternal": "46",
"miner": "0x95222290dd7278aa3ddd389cc1e1d165cc4bafe5",
"difficulty": "0",
"nonce": "0000000000000000",
"tips": "0.000866267",
"confirm": "1024",
"baseFeePerGas": "0.000000024021260851"
}
]
}
