Retrieve the balance of specific tokens held by an address.
POST https://www.okx.com/api/v5/wallet/asset/token-balances-by-address
Parameter | Type | Required | Description |
---|---|---|---|
address | String | Yes | Address |
tokenAddresses | Array | Yes | List of tokens addresses to query. Maximum of 20 items. |
>chainIndex | String | Yes | Unique identifier for the chain |
>tokenAddress | String | Yes | Contract address of the token; use an empty string "" for native token |
filter | String | No | 0 : Filter out risky airdrop tokens 1 : Do not filter out risky airdrop tokens Default is to filter |
Parameter | Type | Description |
---|---|---|
tokenAssets | Array | List for token balances |
>chainIndex | String | Unique identifier for the chain |
>tokenAddress | String | Contract address |
>symbol | String | Token symbol |
>balance | String | Token balance |
>tokenPrice | String | Token price in USD |
>tokenType | String | Token type: 1 : token 2 : inscription |
>isRiskToken | Boolean | true : flagged as a risk airdrop token false : not flagged |
curl --location --request POST 'https://www.okx.com/api/v5/wallet/asset/token-balances' \
--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 '{
"accountId": "",
"tokenAddresses": [
{
"chainIndex": "1",
"tokenAddress": ""
},
{
"chainIndex": "0",
"tokenAddress": "btc-brc20-psat"
}
]
}'
{
"code": "0",
"data": [
{
"chainIndex": "1",
"tokenAddress": "",
"symbol": "ETH",
"balance": "0.07210371955388872",
"tokenPrice": "2650.43",
"tokenType": "1",
"isRiskToken": false
},
{
"chainIndex": "0",
"tokenAddress": "btc-brc20-psat",
"symbol": "psat",
"balance": "1",
"tokenPrice": "140",
"tokenType": "2",
"isRiskToken": false
}
]
"msg": "success"
}