How to get token holder data

GoldRush TeamUpdated 6 min read

Fetch every holder of an ERC-20 token or NFT collection with the GoldRush API: page through the list, pull holders at a past date and compute supply shares.

What a token holder list is

A token holder list is every address with a non-zero balance of one token, and how much each holds. No contract stores that list: a token only records balances, and the set of holders has to be rebuilt from every Transfer event since the token was deployed. The GoldRush Token Holders API does that indexing for you and returns the list in one paginated endpoint, token_holders_v2.

Developers use holder lists for:

  • airdrop and reward snapshots, where eligibility is fixed at one block;
  • holder concentration and whale tracking for research and risk;
  • governance, to read voting power at a proposal's snapshot block;
  • token pages and dashboards that show holder counts and top holders;
  • token gating, to check who holds an NFT collection.

Before you start: API key, token address, chain and Node.js

  • A GoldRush API key in the GOLDRUSH_API_KEY environment variable. Sign up for the 14-day free trial, which includes 25,000 credits.
  • The token's contract address. This guide uses UNI on Ethereum, 0x1f9840a85d5af5bf1d1762f925bdaddc4201f984.
  • The chain name, such as eth-mainnet or base-mainnet, or its chain ID. Token Holders chain support lists all 16 chains.
  • Node.js 18 or later for the JavaScript, which uses the built-in fetch. Steps 2 to 4 build on each other: put their blocks in one file, in order, and save it as holders.mjs, so Node runs it as an ES module and top-level await works (node holders.mjs).

Step 1: Fetch the latest holders

Call the endpoint with the chain and the token address, and send your key as a Bearer token:

API=https://api.covalenthq.com/v1UNI=0x1f9840a85d5af5bf1d1762f925bdaddc4201f984 curl "$API/eth-mainnet/tokens/$UNI/token_holders_v2/" \  -H "Authorization: Bearer $GOLDRUSH_API_KEY"

The response holds one item per holder, 100 per page by default. Here is one item from the UNI holders on 31 December 2025, abridged, with the balance rounded:

{  "contract_decimals": 18,  "contract_name": "Uniswap",  "contract_ticker_symbol": "UNI",  "contract_address": "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984",  "address": "0x1a9c8182c09f50c8318d769245bea52c32be35bc",  "balance": "269634857290000000000000000",  "total_supply": "1000000000000000000000000000",  "block_height": 24128884}
  • balance and total_supply are raw integers at the token's decimals, sent as strings. Divide by 10^contract_decimals to display them.
  • block_height is the block the list is from.
  • pagination.total_count, next to the items, is the number of holders: 386,723 for UNI at the end of 2025.

Step 2: Page through every holder

Ask for 1,000 holders per request with page-size=1000 (the other allowed size is 100) and step page-number from 0 until pagination.has_more is false. Requesting pages one after another keeps the list in order and stops on the last page, partial or not.

const API = "https://api.covalenthq.com/v1";const headers = {    Authorization: `Bearer ${process.env.GOLDRUSH_API_KEY}`,}; // Every holder of a token, 1,000 per request, until has_more is false.// params can add date or block-height for a past snapshot.async function getAllHolders(chain, token, params = {}) {    const holders = [];    for (let page = 0; ; page++) {        const qs = new URLSearchParams({            ...params,            "page-size": "1000",            "page-number": String(page),        });        const url = `${API}/${chain}/tokens/${token}/token_holders_v2/?${qs}`;        const res = await fetch(url, { headers });        // Errors come back as { data: null, error: true, error_code, error_message }; a request with no        // Authorization header gets an HTML 401 from the edge instead, so don't assume the body is JSON.        const body = await res.json().catch(() => null);        if (!res.ok || !body || body.error) {            throw new Error(`GoldRush ${body?.error_code ?? res.status}: ${body?.error_message ?? res.statusText}`);        }        const { data } = body;        holders.push(...data.items);        if (!data.pagination.has_more) return holders;    }} const UNI = "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984";const holders = await getAllHolders("eth-mainnet", UNI);console.log(holders.length, "holders");

The TypeScript SDK does the same loop for you: client.BalanceService.getTokenHoldersV2ForTokenAddress(chain, token) returns an async iterator with one page per step.

Step 3: Get holders at a past date or block

Pass date (YYYY-MM-DD) or block-height and every holder comes back as of one block. Rerun the same request and you get the same list, which is what an airdrop snapshot or a governance count needs. Add this to the same file; it reuses getAllHolders and UNI:

// Every UNI holder as of 31 Dec 2025, from one blockconst snapshot = await getAllHolders("eth-mainnet", UNI, {    date: "2025-12-31",}); // Or pin an exact blockconst atBlock = await getAllHolders("eth-mainnet", UNI, {    "block-height": "24128884",});

Past snapshots work on the Foundational chains, which include Ethereum and Base. On the other chains, date and block-height return a 400; call without them for the latest holders. See which chains serve past snapshots.

Step 4: Turn balances into shares of supply

Every item carries total_supply, so a holder's share needs no second request. At 18 decimals the raw values pass JavaScript's safe integer range, so divide them as BigInts. Take out addresses that can't move tokens first: the 0x…dead burn address is the second largest UNI holder. Add this to the same file; it reads snapshot from Step 3:

const BURN = "0x000000000000000000000000000000000000dead";const supply = BigInt(snapshot[0].total_supply); // Raw balances are integers at the token's decimals: keep them BigIntconst live = snapshot    .filter((h) => h.address !== BURN)    .map((h) => ({ address: h.address, balance: BigInt(h.balance) }))    .sort((a, b) => (b.balance > a.balance) - (b.balance < a.balance)); const top10 = live.slice(0, 10).reduce((sum, h) => sum + h.balance, 0n); // Share of total supply held by the 10 largest holders, in percentconsole.log(Number((top10 * 10_000n) / supply) / 100);

For Gini and HHI concentration metrics over the same list, see Measuring token holder concentration.

NFT holders

The same endpoint takes an ERC-721 collection's contract address and returns every address that holds at least one token in it:

# Every address holding a Bored Ape Yacht Club NFTAPI=https://api.covalenthq.com/v1BAYC=0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d curl "$API/eth-mainnet/tokens/$BAYC/token_holders_v2/?page-size=1000" \  -H "Authorization: Bearer $GOLDRUSH_API_KEY"

To go the other way, from one wallet to the NFTs it holds, use NFTs for an address.

Handle errors from the token holders endpoint

A failed request returns the same envelope as a successful one, with data set to null, and getAllHolders throws on it. The error handling docs show this body for a chain the API doesn't serve:

{ "data": null, "error": true, "error_message": "Chain nosuchchain-mainnet not supported.", "error_code": 501 }

A 501 is a stable answer: the chain or endpoint can't serve the request, so retrying it unchanged returns the same error. Check the chain name against Token Holders chain support. A 400 on a request with date or block-height means the chain doesn't serve past snapshots (Step 3). A request with no Authorization header is refused by the edge proxy with an HTML 401 page rather than JSON, which is why getAllHolders doesn't assume the body parses. Error responses cost no credits, so a page that fails mid-list can be retried from its page-number.

What token holder data costs in credits

Each holder returned costs 0.02 credits, for the latest list and past snapshots alike. A page of 1,000 holders costs 20 credits, and the full UNI list at the end of 2025 (386,723 holders) costs about 7,734.46. The pricing calculator estimates a month of calls.

Frequently asked questions

Is there a free API for token holders?

GoldRush's 14-day free trial includes 25,000 credits, enough for 1,250,000 holders at 0.02 credits each.

How do I get all holders of an ERC-20 token?

Call token_holders_v2 with page-size=1000 and step page-number from 0 until pagination.has_more is false. pagination.total_count tells you how many holders, and so how many pages, to expect.

Can I get the holders of a token on a past date?

Yes, on the Foundational chains, which include Ethereum and Base. Pass date (YYYY-MM-DD) or block-height. On other chains those params return a 400.

Which chains does the token holders endpoint support?

16, including Ethereum, Base, Arbitrum, Polygon, BNB Smart Chain and Optimism. Token Holders chain support lists every chain and which serve past snapshots.

Does it work for ERC-1155 tokens?

The endpoint is documented for ERC-20 and ERC-721 tokens. For the NFTs one wallet holds across standards, including ERC-1155, use NFTs for an address instead.

Next steps

Get new guides by email

New tutorials and best practices for building with blockchain data, sent as they're published.