获取链上交易统计信息#
查询指定公链的链上交易统计信息,包括未确认交易数、24 小时交易量、交易总数与平均 TPS 等。
支持的链:见获取公链信息 API 支持的链(apiName:transaction)。
请求地址#
GET
https://web3.okx.com/api/v6/explorer/info/transaction请求参数#
| 参数名 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| chainIndex | String | 是 | 链唯一标识,如 ETH 为 1、BTC 为 0;支持范围见获取公链信息 API 支持的链 |
响应参数#
| 参数名 | 类型 | 描述 |
|---|---|---|
| chainIndex | String | 链唯一标识 |
| symbol | String | 公链原生代币 |
| pendingTransactionCount | String | 未确认交易数 |
| transactionValue24h | String | 24 小时的链上交易量 |
| totalTransactionCount | String | 链上交易总数 |
| tranRate | String | 50 个区块的平均 TPS |
| avgTransactionCount24h | String | 24 小时平均交易数量 |
| avgTransactionCount24hPercent | String | 24 小时平均交易数量涨幅 |
| pendingTransactionSize | String | 未确认交易的大小 |
请求示例#
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": ""
}
]
}
