🧑🔧
How to Use BlockVision's API service to track your ERC-20 token
With this guide, you will learn how to take advantage of BlockVision's Powerful APIs to check any information you want to know without scanning the entire chain.

Enter BlockVision's dashboard and click "App" on the sidebar, you'll see the guiding page like the following picture. Now create your App by clicking "Create your App now".
If you have finished reading How to create App in the previous tutorial, please just skip to Step 3.

In the previous tutorial, we created ERC-20 Token and minted our NFT on Rinkeby. And in this step, we'll create an App on Rinkeby network to show you how it works.
Once you create your App, you can see it on "MyApp" List. Now use the API Key to check the information.

In the previous tutorial, we created and sent our ERC-20 standard token.
  • Our contract address: 0x31d911BF5945644115bD20382AcAdc399175E117
  • Our account address: 0x42f58a73e8d1abcde3d9ae90d7871515dae61c3b
Select Method erc20_transfers and paste the request parameters with our information. Send the request and check the result of the response.
response
You can see the transfer's info easily and clearly. Not only the method erc20_transfers is provided, but also your transaction information can be tracked by using other power APIs that BlockVision provides such as erc20_filterAccounts API.

BlockVision's erc20_filterAccounts offers you a method to filter contract's ranking info at any time, through which you can get a snapshot of the accounts' info easily.
Currently, we only provide this API to some specific users who initiatively require it. If you need it, please do not hesitate to contact us to open this API for you via Discord or Email.
In our previous operation in How to Create your Own ERC-20 Token, we minted and sent our BVExample to another account. By filtering the ERC-20 Token's contract address, we can see the account info clearly in a specific block number.
curl --location --request POST 'apis.blockvision.org/v1/<your-api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": 1,
"jsonrpc": "2.0",
"method": "erc20_filterAccounts",
"params": {
"contractAddress":"0x31d911bf5945644115bd20382acadc399175e117",
"blockNumber": 10362777,
"pageSize":10,
"pageIndex":1
}
}'
Here is the response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"data": [
{
"contractAddress": "",
"blockNumber": 10362737,
"accountAddress": "0x42f58a73E8D1ABcde3D9ae90D7871515daE61c3b",
"value": "99990000000000000000"
},
{
"contractAddress": "",
"blockNumber": 10362737,
"accountAddress": "0x7a8cf01D2d22F4215DB92633096eeD373B8B3f0d",
"value": "10000000000000000"
}
],
"nextPageIndex": 1
}
}
We use 10362777 --- the number of the block as the filter condition. As we can see from the response, the token balance of the contract in the height of the block of 10362737 are "99990000000000000000" and "10000000000000000".
Then we send some BVExampleTokens to another account and set the "blockNumber" field to zero in the request. Then by default, it will return the latest token balance.
Let's have a try.
curl --location --request POST 'apis.blockvision.org/v1/<your-api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": 1,
"jsonrpc": "2.0",
"method": "erc20_filterAccounts",
"params": {
"contractAddress":"0x31d911bf5945644115bd20382acadc399175e117",
"blockNumber": 0,
"pageSize":10,
"pageIndex":1
}
}'
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"data": [
{
"contractAddress": "",
"blockNumber": 10416165,
"accountAddress": "0x42f58a73E8D1ABcde3D9ae90D7871515daE61c3b",
"value": "93990000000000000000"
},
{
"contractAddress": "",
"blockNumber": 10421341,
"accountAddress": "0x2a829F43990DBe645485614CEF6a8360C0F51106",
"value": "5000000000000000000"
},
{
"contractAddress": "",
"blockNumber": 10421341,
"accountAddress": "0x7a8cf01D2d22F4215DB92633096eeD373B8B3f0d",
"value": "1010000000000000000"
}
],
"nextPageIndex": 1
}
}
If BlockNumber is not set to 0 in the request, then BlockVision's API can be used as a snapshot of account balance information. According to this information, you can easily track property transfers and account history information.

On the other hand, if you want to know the snapshot information of different tokens in a single account, you can also use the erc20_accountPosition API provided by BlockVision to obtain the history information of tokens owned by the account. As above, we can filter and query snapshot by setting the blockNumber field value in the erc20_accountPosition request.
As is shown below:
curl --location --request POST 'apis.blockvision.org/v1/<your-api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": 1,
"jsonrpc": "2.0",
"method": "erc20_accountPositions",
"params": {
"accountAddress":"0x7a8cf01D2d22F4215DB92633096eeD373B8B3f0d",
"blockNumber": 10416162,
"pageSize": 50,
"pageIndex": 1
}
}'
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"data": [
{
"value": "10000000000000000",
"contractAddress": "0x31d911BF5945644115bD20382AcAdc399175E117"
},
{
"value": "80000000000000000000",
"contractAddress": "0x01BE23585060835E02B77ef475b0Cc51aA1e0709"
}
],
"nextPageIndex": 1
}
}
Similarly, if we set the value of the blockNumber field to zero, it will return the latest token information of the account. According to different block numbers, we can clearly track the historical changes of the account token.
As is shown below:
curl --location --request POST 'apis.blockvision.org/v1/<your-api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": 1,
"jsonrpc": "2.0",
"method": "erc20_accountPositions",
"params": {
"accountAddress":"0x7a8cf01D2d22F4215DB92633096eeD373B8B3f0d",
"blockNumber": 0,
"pageSize": 50,
"pageIndex": 1
}
}'
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"data": [
{
"value": "80000000000000000000",
"contractAddress": "0x01BE23585060835E02B77ef475b0Cc51aA1e0709"
},
{
"value": "1010000000000000000",
"contractAddress": "0x31d911BF5945644115bD20382AcAdc399175E117"
}
],
"nextPageIndex": 1
}
}

If you just need a simple query about your information, we highly recommend you to use BlockVision's Console for query operations.
Just with several clicks, you will see the information you need.
Navigate to BlockVision Console, you can pick a suitable network and make the request:
Then the response will be shown below the "Send Request" Button:
Now you know how to take advantage of BlockVision's APIs. Start your journey and explore more by yourself😃
Copy link
On this page
Step 1: Create your App on BlockVision
Step 2: Name your App with a brief description and configure your App's network.
Step 3: Check our information in BlockVision's Console
Step 4: Have A Try On BlockVision Powerful API
erc20_filterAccounts
erc20_accountPosition
Step 5: Try It On BlockVision Console