Batch query the real-time prices of various assets, including chain native tokens, contract based tokens, and assets in the BTC ecosystem such as BRC-20, Runes, ARC-20, and SRC-20 etc.
You can batch query the real-time prices of up to 20 tokens at a time, using the array format as shown in the request example.
POST https://www.okx.com/api/v5/wallet/token/current-price
Parameter | Type | Required | Description |
---|---|---|---|
chainIndex | String | Yes | Unique identifier of the blockchain |
tokenAddress | String | Yes | Token address |
Parameter | Type | Description |
---|---|---|
price | String | Token price |
time | String | Timestamp of the price, Unix timestamp in milliseconds |
chainIndex | String | Unique identifier of the blockchain |
tokenaddress | String | Token address |
curl --location --request POST 'https://www.okx.com/api/v5/wallet/token/current-price' \
--header 'Content-Type: application/json' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--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' \
--data-raw '[
{
"chainIndex": "1",
"tokenAddress":"0xdac17f958d2ee523a2206206994597c13d831ec7"
},
{
"chainIndex":"1",
"tokenAddress": "0xdac17f955d2ee523a2206206994597c13d831ein"
},
{
"chainIndex": "0",
"tokenAddress": "btc-arc20-00009b954c9f1358de9c089f95ec420132e4106a89c8fbb3cfda198ae1e5f9d5i0"
},
{
"chainIndex": "0",
"tokenAddress": "btc-runesMain-840000:2"
}
]'
{
"code": 0,
"msg": "success",
"data": [
{
"chainIndex": "1",
"tokenAddress": "0xc18360217d8f7ab5e7c516566761ea12ce7f9d72"
"time": "1716892020000",
"price": "26.458143090226812",
},
{
"chainIndex": "0",
"tokenAddress": "btc-brc20-ordi",
"time": "1724147119541",
"price": "32.430139864000000000"
},
{
"chainIndex": "0",
"tokenAddress": "btc-arc20-00009b954c9f1358de9c089f95ec420132e4106a89c8fbb3cfda198ae1e5f9d5i0",
"time": "1724153703045",
"price": "0.003558564230000000"
},
{
"chainIndex": "0",
"tokenAddress": "btc-runesMain-840000:2",
"time": "1724145196000",
"price": "0.000455104500000000"
}
]
}