Getting the token balances of an account is an essential task when dealing with cryptocurrencies, as it allows you to know the amount of tokens that an account holds. The Web3 APIs from Chainbase provide the ability to get all transactions and account balances in a straightforward way. By following the steps below, you can seamlessly get the native token balances of an account on a certain chain through a single API call using Chainbase API.
To better leverage the ability that Chainbase provides, you can register here for a free account and access to different APIs and data cloud.
After logging into Chainbase, visit the dashboard to get an overview. Create a new project in the console and get an API key.
fetch
in JavaScript.axios
in JavaScript. You need to install axios
using npm install axios --save
in the terminal first.Chainbase API Get native token balances takes the chain id and wallet address as parameters, and returns the value of native token balances.
To get data printed, run command node <filename>.js
in the terminal. In this case, the native token balances of Vitalik’s wallet on Ethereum is 0x122b7e019d9a0431a15
by the time of Mar. 17th, 2023.
If you want to know more details on the endpoint and optional parameters, check out:
If you meet any trouble following the tutorial, feel free to reach out to us in our Discord to get 24/7 community support.
Getting the token balances of an account is an essential task when dealing with cryptocurrencies, as it allows you to know the amount of tokens that an account holds. The Web3 APIs from Chainbase provide the ability to get all transactions and account balances in a straightforward way. By following the steps below, you can seamlessly get the native token balances of an account on a certain chain through a single API call using Chainbase API.
To better leverage the ability that Chainbase provides, you can register here for a free account and access to different APIs and data cloud.
After logging into Chainbase, visit the dashboard to get an overview. Create a new project in the console and get an API key.
fetch
in JavaScript.axios
in JavaScript. You need to install axios
using npm install axios --save
in the terminal first.Chainbase API Get native token balances takes the chain id and wallet address as parameters, and returns the value of native token balances.
To get data printed, run command node <filename>.js
in the terminal. In this case, the native token balances of Vitalik’s wallet on Ethereum is 0x122b7e019d9a0431a15
by the time of Mar. 17th, 2023.
If you want to know more details on the endpoint and optional parameters, check out:
If you meet any trouble following the tutorial, feel free to reach out to us in our Discord to get 24/7 community support.