Balances API
Get Balances by Contract

Get Balances by Contract

Overview

The Get Balances By Contract endpoint retrieves the balances of every holder for a specific ERC-20 token using its contract address, which is a required path parameter.

A successful request to the endpoint will return a JSON response with balances data labeled as items, which will include fields such as an EOA address, value_raw, value_calculated, seen_at_block_number, and estimated_usd_value. The token data will be shown at the top of the response.

📘️

The current calculation of total supply relies on transfers to and from the zeroth address. This method might not yield accurate results for tokens with unique minting mechanics, such as USDT or BNB.

Usage

The following request can give you the gist of how the endpoint operates.

import * as Parsiq from '@parsiq/parsiq.js';
 
const client = Parsiq.createClient(process.env.API_KEY, Parsiq.ChainId.ETH_MAINNET);
 
const balances = client.balances.getByContract(`0x362bc847A3a9637d3af6624EeC853618a43ed7D2`);
 
for await (const balance of balances) {
    console.log(balance);
}

Output:

{
  id: '000000000116405e-007f-00000004-0',
  address: '0x0845877ccfd0f4ae969fe142f6749022e9408a68',
  value_raw: '0',
  value_calculated: '0',
  seen_at_block_number: 18235486,
  estimated_usd_value: null
}

Parameters

Path params
chainId
string
REQUIRED
version
string
REQUIRED
contract
string
REQUIRED
Query params
offset
string
limit
number
estimate_cu
boolean