開發者平臺
主題

获取链上交易统计信息#

查询指定公链的链上交易统计信息,包括未确认交易数、24 小时交易量、交易总数与平均 TPS 等。

支持的链:见获取公链信息 API 支持的链apiNametransaction)。

请求地址#

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

请求参数#

参数名类型是否必填描述
chainIndexString链唯一标识,如 ETH 为 1、BTC 为 0;支持范围见获取公链信息 API 支持的链

响应参数#

参数名类型描述
chainIndexString链唯一标识
symbolString公链原生代币
pendingTransactionCountString未确认交易数
transactionValue24hString24 小时的链上交易量
totalTransactionCountString链上交易总数
tranRateString50 个区块的平均 TPS
avgTransactionCount24hString24 小时平均交易数量
avgTransactionCount24hPercentString24 小时平均交易数量涨幅
pendingTransactionSizeString未确认交易的大小

请求示例#

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'

响应示例#

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": ""
        }
    ]
}