Specific Token Balance#
Query the balance of a specific token under an address.
Request Path#
POST https://www.okx.com/api/v5/wallet/asset/token-balances-by-address
Request Parameters#
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 | 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.3 : Different inscription tokens are passed in the following formats:FBRC-20 : Use fbtc_fbrc20_name , such as fbtc_fbrc20_babymusk BRC-20 : Use btc-brc20-tick(name) , such as btc-brc20-ordi Runes : Use btc-runesMain-tickId , such as btc-runesMain-840000:2 SRC-20 : Use btc-src20-name , such as btc-src20-utxo |
filter | String | No | 0 : Filter out risky airdrop tokens 1 : Do not filter out risky airdrop tokens Default is to filter |
Response Parameters#
Parameter | Type | Description |
---|---|---|
tokenAssets | Array | List for token balances |
>chainIndex | String | Unique identifier for the chain |
>tokenAddress | String | Token address.If the return is an empty string "" , it means the query is for the native token of the corresponding blockchain. |
>address | String | Address |
>symbol | String | Token symbol |
>balance | String | Token balance. |
>tokenPrice | String | Token price in USD |
>tokenType | String | Token type: 1 : token 2 : inscription |
>transferAmount | String | The balance of BRC-20, FBRC-20, and other inscription assets that can be directly transferred or traded, commonly referred to as the transferable balance. |
>availableAmount | String | The amount of BRC-20, FBRC-20, and other inscription assets that need to complete the inscription process before they can be traded or transferred, usually referred to as the available balance or pending inscription balance. |
>isRiskToken | Boolean | true : flagged as a risk airdrop token false : not flagged |
Request Example#
shell
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 '{
"address": "0x50c476a139aab23fdaf9bca12614cdd54a4244e3",
"tokenAddresses": [
{
"chainIndex": "1",
"tokenAddress": ""
},
{
"chainIndex": "0",
"tokenAddress": "btc-brc20-psat"
}
]
}'
Response Example#
200
{
"code": "0",
"data": [
{
"chainIndex": "1",
"tokenAddress": "",
"address": "0x50c476a139aab23fdaf9bca12614cdd54a4244e3",
"symbol": "ETH",
"balance": "0.07210371955388872",
"tokenPrice": "2650.43",
"tokenType": "1",
"isRiskToken": false
},
{
"chainIndex": "0",
"tokenAddress": "btc-brc20-psat",
"address": "0x50c476a139aab23fdaf9bca12614cdd54a4244e3",
"symbol": "psat",
"balance": "1",
"tokenPrice": "140",
"tokenType": "2",
"isRiskToken": false
}
]
"msg": "success"
}