Portal deweloperski
Motyw

Get Historical Public Chain Statistics#

Returns daily historical statistics for the specified chain, including daily new addresses, transaction count, contract calls, transaction fees, and network utilization, sorted by time in descending order with cursor-based pagination. Only supported on selected major chains.

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

Request URL#

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

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.
startTimeStringNoQuery start time in Unix timestamp milliseconds, e.g., 1597026383085. The span between startTime and endTime cannot exceed 1 year.
endTimeStringNoQuery end time. Returns statistics earlier than this date, in Unix timestamp milliseconds, e.g., 1597026383085.
cursorStringNoPagination cursor. Omit for the first page; pass back the cursor from the previous response unchanged when paginating.
limitStringNoNumber of results per page. Default 20, maximum 100.

Response Parameters#

ParameterTypeDescription
limitStringMaximum number of results per page.
cursorStringCursor for the next page; an empty string means no more pages. Pass it back unchanged — clients should not parse or construct it.
statsHistoryListArrayList of historical statistics.
> timeStringDate at daily granularity, in Unix timestamp milliseconds, e.g., 1597026383085.
> newAddressCountStringNumber of new addresses per day.
> totalTransactionCountStringTotal number of transactions per day.
> totalContractCallsStringTotal number of onchain contract calls per day.
> transactionFeeStringDaily transaction fees paid to validators, denominated in the native token.
> networkUtilizationStringDaily network utilization, i.e., total gas used / total gas limit per day.

Request Example#

shell
curl --location --request GET 'https://web3.okx.com/api/v6/explorer/info/stats?chainIndex=1&limit=2' \
--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": [
        {
            "limit": "2",
            "cursor": "1753545600000",
            "statsHistoryList": [
                {
                    "time": "1753632000000",
                    "newAddressCount": "95321",
                    "totalTransactionCount": "1345678",
                    "totalContractCalls": "2456789",
                    "transactionFee": "1023.45",
                    "networkUtilization": "0.5234"
                },
                {
                    "time": "1753545600000",
                    "newAddressCount": "92104",
                    "totalTransactionCount": "1312456",
                    "totalContractCalls": "2401233",
                    "transactionFee": "987.12",
                    "networkUtilization": "0.5108"
                }
            ]
        }
    ]
}