Портал разработчиков
Тема

Get Public Chain Transaction Statistics#

Query on-chain transaction statistics for a specific chain, including pending transaction count, 24-hour transaction volume, total transaction count, and average TPS.

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

Request URL#

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

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.
pendingTransactionCountStringNumber of pending transactions.
transactionValue24hString24-hour on-chain transaction volume.
totalTransactionCountStringTotal on-chain transaction count.
tranRateStringAverage TPS over the last 50 blocks.
avgTransactionCount24hString24-hour average transaction count.
avgTransactionCount24hPercentStringChange in the 24-hour average transaction count.
pendingTransactionSizeStringSize of pending transactions.

Request Example#

shell
curl --location --request GET 'https://web3.okx.com/api/v6/explorer/info/transaction?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",
            "pendingTransactionCount": "147583",
            "transactionValue24h": "2412345.8",
            "totalTransactionCount": "2915678123",
            "tranRate": "14.2",
            "avgTransactionCount24h": "1234567",
            "avgTransactionCount24hPercent": "0.023",
            "pendingTransactionSize": ""
        }
    ]
}