
How to Get the Holders of an ERC20 Token
IntroductionIn the world of cryptocurrency, knowing the holders of a particular token can provide valuable insights and opportunities for collaboration. Chainbase, a leading platform, offers a powerful API called getTokenHolders that allows you to retrieve a list of addresses for all the holders of a specific ERC20 token. This tutorial will guide you through the process of using Chainbase API to get the holders of a cryptocurrency deployed on various chains. By leveraging this information, yo...

How to Determine the Type of an EVM Contract
In common on-chain data parsing, there is often a large demand for determining the type of contract. This article will judge on relevant standards and engineering practices to determine whether the contract belongs to ERC20 / ERC721 / ERC1155. For more use cases, you can refer to the developer documentation of Chainbase, or ask the original author through Discord. We are happy to discuss issues related to Web3 infra, Data SDK, Chainbase APIs, etc.Rules to determine different contractsWith the...

How to Register a Chainbase Account?
To get started, go to the Chainbase official website.websiteClick on the dashboard to register a new account.loginEnter your email and password.Untitled.pngNext, create a new project in the console to obtain an API key. Now it's time to start your Web3 journey!
All-in-one web3 data infrastructure for indexing, transforming, and utilization of on-chain data at scale.

How to Get the Holders of an ERC20 Token
IntroductionIn the world of cryptocurrency, knowing the holders of a particular token can provide valuable insights and opportunities for collaboration. Chainbase, a leading platform, offers a powerful API called getTokenHolders that allows you to retrieve a list of addresses for all the holders of a specific ERC20 token. This tutorial will guide you through the process of using Chainbase API to get the holders of a cryptocurrency deployed on various chains. By leveraging this information, yo...

How to Determine the Type of an EVM Contract
In common on-chain data parsing, there is often a large demand for determining the type of contract. This article will judge on relevant standards and engineering practices to determine whether the contract belongs to ERC20 / ERC721 / ERC1155. For more use cases, you can refer to the developer documentation of Chainbase, or ask the original author through Discord. We are happy to discuss issues related to Web3 infra, Data SDK, Chainbase APIs, etc.Rules to determine different contractsWith the...

How to Register a Chainbase Account?
To get started, go to the Chainbase official website.websiteClick on the dashboard to register a new account.loginEnter your email and password.Untitled.pngNext, create a new project in the console to obtain an API key. Now it's time to start your Web3 journey!
All-in-one web3 data infrastructure for indexing, transforming, and utilization of on-chain data at scale.

Subscribe to Chainbase

Subscribe to Chainbase
Share Dialog
Share Dialog
<100 subscribers
<100 subscribers


This tutorial will show you how to use the Chainbase API's getTopTokenHolders function to get the top holders of a cryptocurrency that is on the Ethereum blockchain. Knowing who holds the most tokens can be helpful for many reasons, such as reaching out to them for collaborations and keeping track of the flow of funds.
Overview - Tools you need to work with Chainbase
Step 1: Set up a free account at Chainbase
Step 2: Write a script using the Chainbase API
Step 3: Print token holders
Conclusion
FAQs
To get started, you will need the following tools:
A free account at Chainbase with an API key.
An integrated development environment (IDE). We recommend using Visual Studio Code (VS Code).
To leverage the capabilities of Chainbase, follow these steps:
Register for a free account on the Chainbase website.
Log in to your Chainbase account and visit the dashboard to get an overview.
Create a new project in the console to obtain an API key.
You can use JavaScript and the Chainbase API to retrieve the top token holders. Here are two examples using different libraries: fetch and axios.
javascriptCopy code
network_id = '1'; // See https://docs.chainbase.com/reference/supported-chains to get the id of different chains.
token_addr = '0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0'; // Take MATIC token address as an example.
fetch(`https://api.chainbase.online/v1/token/top-holders?chain_id=${network_id}&contract_address=${token_addr}&page=1&limit=5`, {
method: 'GET',
headers: {
'x-api-key': CHAINBASE_API_KEY, // Replace the field with your API key.
'accept': 'application/json'
}
}).then(response => response.json())
.then(data => console.log(data.data))
.catch(error => console.error(error));
You need to install axios using npm install axios --save in the terminal first.
javascriptCopy code
network_id = '1'; // See https://docs.chainbase.com/reference/supported-chains to get the id of different chains.
token_addr = '0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0'; // Take MATIC token address as an example.
const axios = require('axios');
const options = {
url: `https://api.chainbase.online/v1/token/top-holders?chain_id=${network_id}&contract_address=${token_addr}&page=1&limit=5`,
method: 'GET',
headers: {
'x-api-key': CHAINBASE_API_KEY, // Replace the field with your API key.
'accept': 'application/json'
}
};
axios(options)
.then(response => console.log(response.data.data))
.catch(error => console.log(error));
The getTopTokenHolders function from the Chainbase API requires the chain ID and the contract address of the ERC20 token as input parameters. This function returns information regarding the top token holders. Also, you can use the page and limit parameters for pagination and to retrieve a specific number of top holders.
To print the token holders, execute the command node <filename>.js in the terminal, where <filename> represents the name of your script. Here is an example of the expected JSON data returned by the API:
jsonCopy code
{
"count": 593525,
"holders": [
{
"wallet_address": "0x5e3ef299fddf15eaa0432e6e66473ace8c13d908",
"amount": "3814264335.329752",
"usd_value": "4167560569.389670"
},
{
"wallet_address": "0x401f6c983ea34274ec46f84d70b31c151321188b",
"amount": "910440417.955799",
"usd_value": "994769961.668955"
},
{
"wallet_address": "0xcd6507d87f605f5e95c12f7c4b1fc3279dc944ab",
"amount": "590639315.000000",
"usd_value": "645347281.551875"
},
{
"wallet_address": "0xb316fa9fa91700d7084d377bfdc81eb9f232f5ff",
"amount": "434226114.715070",
"usd_value": "474446308.590553"
},
{
"wallet_address": "0xcbfe11b78c2e6cb25c6eda2c6ff46cd4755c8fca",
"amount": "273304816.000000",
"usd_value": "298619674.582000"
}
]
}
By following the tutorial steps, you have learned how to use the Chainbase API's getTopTokenHolders function to get details about the top holders of an ERC20 token deployed on the Ethereum blockchain.
Currently, we only provide information on Ethereum ERC-20 token holders. Data on additional chains will be available soon.
You can adjust the limit parameter in the API request to fetch more token holders. Increase the value to retrieve a larger list, bearing in mind that excessively high values may impact performance.
The Chainbase API already returns the token holders in descending order based on their holdings. The first holder in the list represents the top holder.
Yes, the API response provides the wallet address, the amount of tokens held, and the equivalent USD value. You can use this data to analyze and engage with the token holders.
Our API is unique in the industry because it provides real-time token holder information that can be sorted. Other APIs, like those used in browsers, usually have a cache value that lasts about 20 minutes.
Chainbase is an all-in-one data infrastructure for Web3 that allows you to index, transform, and use on-chain data at scale. By leveraging enriched on-chain data and streaming computing technologies across one data infrastructure, Chainbase automates the indexing and querying of blockchain data, enabling developers to accomplish more with less effort.
Want to learn more about Chainbase?
Visit our website chainbase.com Sign up for a free account, and Check out our documentation.
Website|Blog|Twitter|Discord|Link3
Original source:How to Get the Top Holders of an ERC20 Token in 2023
This tutorial will show you how to use the Chainbase API's getTopTokenHolders function to get the top holders of a cryptocurrency that is on the Ethereum blockchain. Knowing who holds the most tokens can be helpful for many reasons, such as reaching out to them for collaborations and keeping track of the flow of funds.
Overview - Tools you need to work with Chainbase
Step 1: Set up a free account at Chainbase
Step 2: Write a script using the Chainbase API
Step 3: Print token holders
Conclusion
FAQs
To get started, you will need the following tools:
A free account at Chainbase with an API key.
An integrated development environment (IDE). We recommend using Visual Studio Code (VS Code).
To leverage the capabilities of Chainbase, follow these steps:
Register for a free account on the Chainbase website.
Log in to your Chainbase account and visit the dashboard to get an overview.
Create a new project in the console to obtain an API key.
You can use JavaScript and the Chainbase API to retrieve the top token holders. Here are two examples using different libraries: fetch and axios.
javascriptCopy code
network_id = '1'; // See https://docs.chainbase.com/reference/supported-chains to get the id of different chains.
token_addr = '0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0'; // Take MATIC token address as an example.
fetch(`https://api.chainbase.online/v1/token/top-holders?chain_id=${network_id}&contract_address=${token_addr}&page=1&limit=5`, {
method: 'GET',
headers: {
'x-api-key': CHAINBASE_API_KEY, // Replace the field with your API key.
'accept': 'application/json'
}
}).then(response => response.json())
.then(data => console.log(data.data))
.catch(error => console.error(error));
You need to install axios using npm install axios --save in the terminal first.
javascriptCopy code
network_id = '1'; // See https://docs.chainbase.com/reference/supported-chains to get the id of different chains.
token_addr = '0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0'; // Take MATIC token address as an example.
const axios = require('axios');
const options = {
url: `https://api.chainbase.online/v1/token/top-holders?chain_id=${network_id}&contract_address=${token_addr}&page=1&limit=5`,
method: 'GET',
headers: {
'x-api-key': CHAINBASE_API_KEY, // Replace the field with your API key.
'accept': 'application/json'
}
};
axios(options)
.then(response => console.log(response.data.data))
.catch(error => console.log(error));
The getTopTokenHolders function from the Chainbase API requires the chain ID and the contract address of the ERC20 token as input parameters. This function returns information regarding the top token holders. Also, you can use the page and limit parameters for pagination and to retrieve a specific number of top holders.
To print the token holders, execute the command node <filename>.js in the terminal, where <filename> represents the name of your script. Here is an example of the expected JSON data returned by the API:
jsonCopy code
{
"count": 593525,
"holders": [
{
"wallet_address": "0x5e3ef299fddf15eaa0432e6e66473ace8c13d908",
"amount": "3814264335.329752",
"usd_value": "4167560569.389670"
},
{
"wallet_address": "0x401f6c983ea34274ec46f84d70b31c151321188b",
"amount": "910440417.955799",
"usd_value": "994769961.668955"
},
{
"wallet_address": "0xcd6507d87f605f5e95c12f7c4b1fc3279dc944ab",
"amount": "590639315.000000",
"usd_value": "645347281.551875"
},
{
"wallet_address": "0xb316fa9fa91700d7084d377bfdc81eb9f232f5ff",
"amount": "434226114.715070",
"usd_value": "474446308.590553"
},
{
"wallet_address": "0xcbfe11b78c2e6cb25c6eda2c6ff46cd4755c8fca",
"amount": "273304816.000000",
"usd_value": "298619674.582000"
}
]
}
By following the tutorial steps, you have learned how to use the Chainbase API's getTopTokenHolders function to get details about the top holders of an ERC20 token deployed on the Ethereum blockchain.
Currently, we only provide information on Ethereum ERC-20 token holders. Data on additional chains will be available soon.
You can adjust the limit parameter in the API request to fetch more token holders. Increase the value to retrieve a larger list, bearing in mind that excessively high values may impact performance.
The Chainbase API already returns the token holders in descending order based on their holdings. The first holder in the list represents the top holder.
Yes, the API response provides the wallet address, the amount of tokens held, and the equivalent USD value. You can use this data to analyze and engage with the token holders.
Our API is unique in the industry because it provides real-time token holder information that can be sorted. Other APIs, like those used in browsers, usually have a cache value that lasts about 20 minutes.
Chainbase is an all-in-one data infrastructure for Web3 that allows you to index, transform, and use on-chain data at scale. By leveraging enriched on-chain data and streaming computing technologies across one data infrastructure, Chainbase automates the indexing and querying of blockchain data, enabling developers to accomplish more with less effort.
Want to learn more about Chainbase?
Visit our website chainbase.com Sign up for a free account, and Check out our documentation.
Website|Blog|Twitter|Discord|Link3
Original source:How to Get the Top Holders of an ERC20 Token in 2023
No activity yet