If you want to automatically get all the transfers of an ERC20 token, try Chainbase API Get token transfers by contract. You can easily retrieve all the transfers for any ERC20 token with its contract address by using Chainbase API.Documentation Index
Fetch the complete documentation index at: https://docs.chainbase.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview - Tools you need to work with Chainbase
- A free account at Chainbase with an API key.
- An IDE. Our examples are shown in JavaScript, you can use VS Code as your IDE for example.
- A contract address of an ERC20 token as your input.
Step 1: Set up a free account at Chainbase
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.
Step 2: Write script using Chainbase API
- Using
fetchin JavaScript.
- Using
axiosin JavaScript. You need to installaxiosusingnpm install axios --savein the terminal first.
Step 3: Print metadata of an ERC20 token
Chainbase API Get token transfers by contract takes the chain id and token contract address as parameters, and returns all the transfers of that ERC20 token. If you want to know transfers related to one specific address, input the address information in theaddress field. You can also know the total transfer times through the count field in the returned data.
To get data printed, run command node <filename>.js in the terminal. In this case, the data returned looks as follows.