Market API

Get Batch Token Price#

Retrieve the latest price for multiple tokens

Request URL#

POST https://web3.okx.com/api/v5/dex/market/price-info

Request Parameters#

ParameterTypeRequiredDescription
chainIndexStringYesUnique identifier for the chain.
e.g., 1: Ethereum.
See more here.
tokenContractAddressStringYesToken contract address (e.g., 0x382bb369d343125bfb2117af9c149795c6c65c50),Supports batch queries:Up to 100 addresses can be entered, separated by commas.

Response Parameters#

ParameterTypeDescription
chainIndexStringUnique identifier for the chain (e.g., 1: Ethereum; see more here).
tokenContractAddressStringToken contract address (e.g., 0x382bb369d343125bfb2117af9c149795c6c65c50)
timeStringTimestamp of the price, Unix timestamp format in milliseconds
priceStringLatest token price
marketCapStringToken marketcap
priceChange5MString5 min price change
priceChange1HString1 hour price change
priceChange4HString4 hour price change
priceChange24HString24 hour price change
volume5MString5 min volume
volume1HString1 hour volume
volume4HString4 hour volume
volume24HString24 hour volume

Request Example#

shell
curl --location --request POST 'https://web3.okx.com/api/v5/dex/market/price' \
--header 'Content-Type: application/json' \
--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": "66",
          "tokenContractAddress":"0x382bb369d343125bfb2117af9c149795c6c65c50"
      }
  ]'

Response Example#

200
{
    "code":"0",
    "msg":"",
    "data":[
    {
    "chainIndex": "66",
    "tokenContractAddress": "0x382bb369d343125bfb2117af9c149795c6c65c50",
    "time": "1716892020000",
    "price": "26.458143090226812",
    "marketCap": "27036475.39446733583542349",
    "priceChange5M": "-2.12",
    "priceChange1H": "1",
    "priceChange4H": "-4.69",
    "priceChange24H": "61.4",
    "volume5M": "95979.673920807940184",
    "volume1H": "1101091.054193115633995724",
    "volume4H": "3944418.057408155962911033",
    "volume24H": "16606779.022519656093301767"
    }
    ]
}