Wallet API

Real-time Token Price#

Batch query for real-time token prices.

Supports real-time prices for non-native tokens.

Maximum 100 token prices can be queried per request.Request parameters should be passed in the form of an array.

Request Path#

POST https://www.okx.com/api/v5/wallet/token/real-time-price

Request Parameters#

ParameterTypeRequiredDescription
chainIndexStringYesUnique identifier of the blockchain
tokenAddressStringYesToken address.

Response Parameters#

ParameterTypeDescription
priceStringToken price
timeStringTimestamp of the price, Unix timestamp in milliseconds
chainIndexStringUnique identifier of the blockchain
tokenaddressStringToken address.

Request Example#

shell
curl --location --request POST 'https://www.okx.com/api/v5/wallet/token/real-time-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"
        }
    ]'

Response Example#

200
{
    
    "code": 0,
    "msg": "success",
    "data": [
        {
            "chainIndex": "1",
            "tokenAddress": "0xc18360217d8f7ab5e7c516566761ea12ce7f9d72"
            "time": "1716892020000",
            "price": "26.458143090226812",
        }
    ]
}