Portal para programadores
Tema

Get Block List#

Get the block list information of the chains, and only return nearly 10,000 block list data.

Request Path#

GET
https://web3.okx.com/api/v5/xlayer/block/block-list

Request Parameters#

ParameterTypeRequiredDescription
chainShortNameStringYesThe abbreviated name of the blockchain network, e.g, XLAYER
heightStringNoHeight
limitStringNoThe number of results returned per request. The maximum is 100. The default is 20.
pageStringNoPage

Response Parameters#

ParameterTypeDescription
pageStringCurrent page number
limitStringThe amount of data
totalPageStringTotal number of pages
chainFullNameStringThe full name of the blockchain network, e.g. X Layer
chainShortNameStringThe abbreviated name of the blockchain network, e.g. XLAYER
blockListArrayBlock list
> hashStringBlock hash
> heightStringBlock height
> validatorStringValidator
> blockTimeStringThe Unix timestamp for when the block was validated, in milliseconds format, e.g., 1597026383085.
> txnCountStringThe number of transactions contained in the block
> blockSizeStringBlock size. The unit is: bytes
> mineRewardStringBlock reward, block revenue is equal to mineReward + totalFee
> totalFeeStringThe sum of all fees in the block, in the currency of the fee
> feeSymbolStringFee currency
> avgFeeStringAverage transaction fee
> ommerBlockStringThe number of ommer blocks
> gasUsedStringActual amount of gas used
> gasLimitStringGas limit
> gasAvgPriceStringGas avg price
> stateStringDifferent block states:"pending" indicates that confirmation is currently in progress"done" indicates completion.
> burntStringDestruction fee amount

Request Example#

shell
curl --location --request GET 'https://web3.okx.com/api/v5/xlayer/block/block-list?chainShortName=xlayer&limit=1' \
--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": [
        {
            "page": "1",
            "limit": "1",
            "totalPage": "10000",
            "chainFullName": "X Layer",
            "chainShortName": "XLAYER",
            "blockList": [
                {
                    "hash": "0x70d4e7c0ddc5993ded572728e02761c0a10ccae28f3133b43dfbad3bb0aa6fd4",
                    "height": "31122982",
                    "validator": "0x610de9141a2c51a9a9624278aa97fbe54b27c102",
                    "blockTime": "1755486326000",
                    "txnCount": "12",
                    "blockSize": "2497",
                    "mineReward": "0.00200257336085162",
                    "totalFee": "0.00200257336085162",
                    "feeSymbol": "OKB",
                    "avgFee": "0.000166881113404302",
                    "ommerBlock": "0",
                    "gasUsed": "1947524",
                    "gasLimit": "0",
                    "gasAvgPrice": "0.000000001028266332",
                    "state": "",
                    "burnt": ""
                }
            ]
        }
    ]
}