Vývojářský portál
Motiv

Get Block List#

Get the TradeZone block list with optional filtering by block height.

Request Path#

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

Request Parameters#

ParameterTypeRequiredDescription
chainShortNameStringYesThe abbreviated name of the blockchain network, e.g, TRADE_ZONE
heightStringNoThe block height to filter by
limitIntegerNoThe number of results returned per request. The maximum is 100. The default is 20.
pageIntegerNoPage number, default 1

Response Parameters#

ParameterTypeDescription
pageStringCurrent page number
limitStringNumber of results per page
totalPageStringTotal number of pages
totalStringTotal number of records
dataArrayBlock list
> hashStringBlock hash
> heightStringBlock height
> minerStringBlock producer address
> blockTimeStringBlock time (ms)
> transactionCountStringNumber of transactions in the block

Request Example#

shell
curl --location --request GET 'https://web3.okx.com/api/v5/xlayer/tz/block/block-list?chainShortName=TRADE_ZONE&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": "13107437",
            "total": "13107437",
            "data": [
                {
                    "hash": "0x0aa0d3d8e43f9b75260eaac71e73091377c5c2142d93e47433428900071955b2",
                    "height": "21324075",
                    "miner": "0x4d3b3c2eea46467131ecdf6bd4a8787612651408",
                    "blockTime": "1779167409217",
                    "transactionCount": "0"
                }
            ]
        }
    ]
}