Skip to main content

Balance

About

Balance API is used to get the information about balances of addresses

Routes

POST /balance

Returns information about both token and native balances of addresses on specified networks.

Request body format

{
"networks": {
"network_id_1": ["address_1", "address_2"],
"network_id_2": ["address_3", "address_4"]
}
}

In request body networks is a record which uses network_id as a key and arrays of addresses as values Any unsupported network ids are skipped.

Example:

{
"networks": {
"bch": ["qzh96ajgz9ufvs4zmrzq8jr95s7nm0qlnclvk3vpe0"],
"litecoin": ["LW1LMwNjA6EAJm6BC87EGm6PgHgWcPDgbW"],
"polkadot": ["14Ns6kKbCoka3MS4Hn6b7oRw9fFejG8RH5rq5j63cWUfpPDJ"]
}
}

Response is an array of balances of those addresses. Every balance object has the following format

{
"coinId": "litecoin",
"blockchain": "litecoin",
"tokenName": "Litecoin",
"tokenSymbol": "LTC",
"tokenDecimals": 8,
"contractAddress": null,
"holderAddress": "ltc1qxed5qmdzycen6zmvcueuwjc6lgtuvmld0acqsd",
"tokenType": "NATIVE",
"thumbnail": "https://coin-images.coingecko.com/coins/images/2/thumb/litecoin.png?1696501400",
"balance": "0.10085843",
"balanceUsd": "11.1609938638",
"tokenPrice": "110.66",
"updatedAt": 1759321714700,
"priceChange24h": 5.3,
"priceChangePercent24h": 5.02816
}

Result fields

FieldTypeDescription
coinIdstringCoin id from CoinGecko
blockchainstringNetwork of the balance object. One of the supported Networks
tokenNamestringName of the token
tokenSymbolstringSymbol of the token
tokenDecimalsnumberAmount of decimals the token uses
contractAddressstring / nullAddress of the token contract or null in case it does not exist, for example Litecoin
holderAddressstringAddress to which this balance belongs to
tokenTypestringType of the token. There are 2 possible values: NATIVE and TOKEN
thumbnailstringUrl to the token icon
balancestring / nullBalance of the token formatted using token decimals. So 0.5 Bitcoin is 0.5, not 50000000. null if failed to get token balance.
balanceUsdstring / nullBalance of the token in USD. null if failed to get token balance or token price.
tokenPricestring / nullPrice of the token in USD. null if failed to get it.
updatedAt(Optional) numberUNIX time of the last update of the token price
priceChange24h(Optional) numberChange of price in USD during the last 24 hours
priceChangePercent24h(Optional) numberChange of price in percents during the last 24 hours
subchain(Optional) stringSubchain of the balance. Used by Polkadot. Currently only polkadot subchain is supported.
error(Optional) stringError message in case token balance fetch failed.
About Bitcoin Cash

Currently only native currency is supported on Bitcoin Cash. Other currencies may receive support in the future

POST /balance/token

Returns address balance of one particular token.

Request body format

{
"networkId": "network_id",
"address": "user_address",
"tokenAddress": "address_of_the_token"
}

tokenAddress in request body is optional. If it is absent, the native balance is returned

Example:

{
"networkId": "litecoin",
"address": "ltc1qxed5qmdzycen6zmvcueuwjc6lgtuvmld0acqsd"
}

Response format

{
balance: "1.0";
balanceUsd: "1.0";
price: "1.0";
}

Result fields

FieldTypeDescription
balancestring / nullBalance of the token formatted using token decimals. So 0.5 Bitcoin is 0.5, not 50000000. null if failed to get token balance.
balanceUsdstring / nullBalance of the token in USD. null if failed to get token balance or token price.
pricestring / nullPrice of the token in USD. null if failed to get it.
About Bitcoin Cash

Currently only native currency is supported on Bitcoin Cash. Other currencies may receive support in the future