Portal deweloperski
Motyw

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-fills

Request Parameters#

ParameterTypeRequiredDescription
chainIndexStringYesUnique identifier of the chain, e.g., 1 for ETH, 0 for BTC. See Get Block API Supported Chains for supported values.
heightStringYesBlock height (digits only).

Response Parameters#

ParameterTypeDescription
chainIndexStringUnique identifier of the chain.
hashStringBlock hash.
heightStringBlock height.
validatorStringBlock producer / super node / validator.
blockTimeStringBlock time, as a Unix timestamp in milliseconds, e.g., 1597026383085.
txnCountStringNumber of transactions contained in the block.
amountStringTotal transaction amount in the block.
blockSizeStringBlock size, in bytes.
mineRewardStringBlock reward. Total block earnings equal mineReward + totalFee.
totalFeeStringSum of all transaction fees in the block.
feeSymbolStringTransaction fee currency.
ommerBlockStringNumber of ommer (uncle) blocks.
merkleRootHashStringMerkle root hash.
gasUsedStringGas used.
gasLimitStringGas limit.
gasAvgPriceStringAverage gas price.
stateStringBlock state: pending when confirming, done when confirmed. Chains where this does not apply return an empty string "".
burntStringAmount of transaction fees burnt.
txnInternalStringNumber of internal transactions contained in the block.
minerStringMiner address hash.
difficultyStringMining difficulty.
nonceStringOn PoW blockchains, the nonce describes the mining difficulty.
tipsStringTips.
confirmStringNumber of confirmations.
baseFeePerGasStringBase 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"
        }
    ]
}