Portal pentru dezvoltatori
Temă

Get Basic Block Statistics#

Query basic block statistics for a specific chain, including latest block height, first block information, average block interval, and average block size.

Supported chains: see Get Chain Info API Supported Chains (apiName: block).

Request URL#

GET
https://web3.okx.com/api/v6/explorer/info/block

Request Parameters#

ParameterTypeRequiredDescription
chainIndexStringYesUnique identifier of the chain, e.g., 1 for ETH, 0 for BTC. See Get Chain Info API Supported Chains for supported values.

Response Parameters#

ParameterTypeDescription
chainIndexStringUnique identifier of the chain.
symbolStringNative token of the chain.
lastHeightStringLatest block height.
firstExchangeHistoricalTimeStringTime of the first transaction. Unix timestamp in milliseconds, e.g., 1597026383085.
firstBlockTimeStringTime of the first block. Unix timestamp in milliseconds, e.g., 1597026383085.
firstBlockHeightStringHeight of the first block.
avgBlockIntervalStringAverage block interval (past week).
avgBlockSize24hStringAverage block size (24 hours).
avgBlockSize24hPercentStringChange in average block size.
mediaBlockSizeStringMedian block size (past week).
halveTimeStringHalving time. Unix timestamp in milliseconds, e.g., 1597026383085.

Request Example#

shell
curl --location --request GET 'https://web3.okx.com/api/v6/explorer/info/block?chainIndex=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": [
        {
            "chainIndex": "1",
            "symbol": "ETH",
            "lastHeight": "22990123",
            "firstExchangeHistoricalTime": "",
            "firstBlockTime": "1438269973000",
            "firstBlockHeight": "0",
            "avgBlockInterval": "12.08",
            "avgBlockSize24h": "78345",
            "avgBlockSize24hPercent": "0.0123",
            "mediaBlockSize": "72110",
            "halveTime": ""
        }
    ]
}