Balances API
Get Balances by Address

Get Balances by Address

Overview

The Get Balances by Address endpoint provides access to both native currency and ERC-20 tokens in an EOA wallet, whose address 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 value_raw, value_calculated, seen_at_block_number, estimated_usd_value, and token data.

Usage

In this example, we obtain the balances of the EOA wallet's address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045.

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

Output:

{
  id: '0000000001189c2a-0081-00000006-1',
  value_raw: '281592053100000000',
  value_calculated: '0.2815920531',
  estimated_usd_value: null,
  seen_at_block_number: 18390058,
  token: {
    address: '0x9f9ab4a7f129576422c5334f90c37a0e76cfd674',
    decimals: 1,
    symbol: null,
    name: null,
    estimated_usd_price: null
  }
}

Parameters

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