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
| Field | Type | Description |
|---|---|---|
| coinId | string | Coin id from CoinGecko |
| blockchain | string | Network of the balance object. One of the supported Networks |
| tokenName | string | Name of the token |
| tokenSymbol | string | Symbol of the token |
| tokenDecimals | number | Amount of decimals the token uses |
| contractAddress | string / null | Address of the token contract or null in case it does not exist, for example Litecoin |
| holderAddress | string | Address to which this balance belongs to |
| tokenType | string | Type of the token. There are 2 possible values: NATIVE and TOKEN |
| thumbnail | string | Url to the token icon |
| balance | string / null | Balance of the token formatted using token decimals. So 0.5 Bitcoin is 0.5, not 50000000. null if failed to get token balance. |
| balanceUsd | string / null | Balance of the token in USD. null if failed to get token balance or token price. |
| tokenPrice | string / null | Price of the token in USD. null if failed to get it. |
| updatedAt | (Optional) number | UNIX time of the last update of the token price |
| priceChange24h | (Optional) number | Change of price in USD during the last 24 hours |
| priceChangePercent24h | (Optional) number | Change of price in percents during the last 24 hours |
| subchain | (Optional) string | Subchain of the balance. Used by Polkadot. Currently only polkadot subchain is supported. |
| error | (Optional) string | Error message in case token balance fetch failed. |
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
| Field | Type | Description |
|---|---|---|
| balance | string / null | Balance of the token formatted using token decimals. So 0.5 Bitcoin is 0.5, not 50000000. null if failed to get token balance. |
| balanceUsd | string / null | Balance of the token in USD. null if failed to get token balance or token price. |
| price | string / null | Price of the token in USD. null if failed to get it. |
Currently only native currency is supported on Bitcoin Cash. Other currencies may receive support in the future