Get Token Index Price#
The index price refers to a currency price calculated from the prices of multiple third-party data sources.
Batch query for index token prices, maximum 100 token prices can be queried per request.
Request Parameters should be passed in the form of an array.
Request URL#
POST https://web3.okx.com/api/dex/index/current-price
Request Parameters#
Parameter | Type | Required | Description |
---|---|---|---|
chainIndex | String | Yes | Unique identifier of the blockchain |
tokenContractAddress | String | Yes | Token address.1 : Pass an empty string "" to query the native token of the corresponding chain.2 : Pass the specific token contract address to query the corresponding token. |
Response Parameters#
Parameter | Type | Description |
---|---|---|
price | String | Token price |
time | String | Timestamp of the price, Unix timestamp in milliseconds |
chainIndex | String | Unique identifier of the blockchain |
tokenContractAddress | String | Token address. |
Request Example#
shell
curl --location --request POST 'https://web3.okx.com/api/v5/dex/index/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",
"tokenContractAddress":"0xc18360217d8f7ab5e7c516566761ea12ce7f9d72"
},
]'
Response Example#
200
{
"code": 0,
"msg": "success",
"data": [
{
"chainIndex": "1",
"tokenContractAddress": "0xc18360217d8f7ab5e7c516566761ea12ce7f9d72"
"time": "1716892020000",
"price": "26.458143090226812",
}
]
}