Market API

Get Total Value#

Retrieve the total balance of all tokens and DeFi assets under an account.

Request URL#

GET https://web3.okx.com/api/v5/dex/balance/total-value

Request Parameters#

ParameterTypeRequiredDescription
addressStringYesGet the total valuation for the address
chainsStringNoFilter chains for which to query total assets, separated by ",". Supports up to 50 chains..
e.g., 1: Ethereum.
See more here.
assetTypeStringNoQuery balance type. Default is to query all asset balances.
0: Query total balance for all assets, including tokens and DeFi assets.
1: Query only token balance.
2: Query only DeFi balance.
excludeRiskTokenBooleanNoOption to filter out risky airdrop & honeypot tokens. Default is to filter.
true: filter out, false: do not filter out
It supports only ETHBSCSOLBASE for honeypot tokens, more chains will be supported soon.

Response Parameters#

ParameterTypeDescription
totalValueStringTotal asset balance based on the query type, returned in USD

Request Example#

shell
curl --location --request GET 'https://web3.okx.com/api/v5/dex/balance/total-value?accountId=e7dba4c2-666d-496a-ad92-768d29291fee&chains=' \
--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'

Response Example#

200
{
    "code": "0",
    "msg": "success",
    "data": [
        {
            "totalValue": "1172.895057177065864522056725546579939398"
        }
    ]
}