钱包 API
实时币价查询

实时币价查询#

批量查询币种的实时价格。 每次最多可以批量查询 20 个代币的实时价格,按请求示例内的数组格式查询。

请求路径#

POST https://www.okx.com/api/v5/waas/wallet/token/current-price

请求参数#

ParameterTypeRequiredDescription
chainIndexStringYes链唯一标识
tokenAddressStringYes代币地址

响应参数#

ParameterTypeDescription
priceString代币价格
timeString价格的时间,Unix 时间戳格式,用毫秒表示。
chainIndexString链唯一标识
tokenaddressString代币地址

请求示例#

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

响应示例#

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