Get Token Balance Details By Address#
Get Token Balance Detail for an address to get information about the balance of all tokens on that address.
Request Path#
GET
https://web3.okx200.com/api/v5/xlayer/address/token-balanceRequest Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
| chainShortName | String | Yes | The abbreviated name of the blockchain network, e.g, XLAYER |
| address | String | Yes | Address |
| protocolType | String | Yes | Contract protocol Type token_20 token_721 token_1155 |
| tokenContractAddress | String | No | Token Contract Address |
| page | String | No | Page |
| limit | String | No | The number of results returned per request. The maximum is 50. The default is 20. |
Response Parameters#
| Parameter | Type | Description |
|---|---|---|
| page | String | Current page number |
| limit | String | The amount of data |
| totalPage | String | Total number of pages |
| tokenList | Array | Token list |
| > symbol | String | Symbol of the token |
| > tokenContractAddress | String | Token Contract Address |
| > holdingAmount | String | The holding amount of the token |
| > priceUsd | String | Token price in USD |
| > valueUsd | String | Total token value in USD |
| > tokenId | String | NFT token ID |
Request Example#
shell
curl --location --request GET 'https://web3.okx200.com/api/v5/xlayer/address/token-balance?chainShortName=xlayer&address=0x1e4a5963abfd975d8c9021ce480b42188849d41d&protocolType=token_20&limit=1' \
--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'
Response Example#
json
{
"code": "0",
"msg": "",
"data": [
{
"limit": "1",
"page": "1",
"totalPage": "2",
"tokenList": [
{
"symbol": "USDT",
"tokenContractAddress": "0x1e4a5963abfd975d8c9021ce480b42188849d41d",
"tokenType": "ERC20",
"holdingAmount": "614.05118",
"priceUsd": "1.00062",
"valueUsd": "614.4318917316",
"tokenId": ""
}
]
}
]
}
