How to view your crypto balance in different blockchains using Covalent API

BereziukVolodymyr
2 min readApr 25, 2021

--

Imagine you are a software developer or crypto enthusiasts and you want to build an application that will display your coins amount. This task is a big challenge for developers because you should read a lot of documentation and write tons of code for different Mainnet blockchains. But there is a solution and it is Covalent API.

Covalent provides a unified access point to different blockchains via API. Right now next Mainnets supported: Ethereum, Polygon/Matic, Avalanche C-Chain, Binance Smart Chain.
So let’s look at how we can use Covalent API to get our coin amount.

So this is the current balance in the wallet.

Now if we will look at API documentation there is GET request to get account balance, /v1/{chain_id}/address/{address}/balances_v2/
Add chain_id — 1 for Ethereum and wallet address

From line 17 you can see a balance ETH which respects to amount of 1.25 ETH in the wallet. Also price of 1 ETH as quote_rate field and total amount in USD in the quote field

So with Covalent API, it's easy to query your wallet balance.

Twitter: @Covalent_HQ
Telegram: https://t.me/CovalentHQ
Discord: https://discord.gg/M4aRubV
Web: https://www.covalenthq.com/

--

--

No responses yet