Balances API
Get Contract Metadata

Get Contract Metadata

Overview

The Get Contract Metadata endpoint gathers fundamental metadata associated with a specific ERC-20 contract, which is a required path parameter.

A successful request to the endpoint will return a JSON response containing metadata for a particular ERC-20 contract, which will include fields such as total_supply_raw, total_supply_calculated, and estimated_usd_price.

📘️

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.

Querying via Postman

If you prefer querying via Postman, the description of PARSIQ Endpoints for Get Contract Metadata (opens in a new tab) might come in handy. There you will find examples and responses for good and bad requests as well as parameter definitions and their example values.

Usage

In this example, we are looking up the PRQ contract's metadata.

import * as Parsiq from '@parsiq/parsiq.js';
 
const client = Parsiq.createClient(process.env.API_KEY, Parsiq.ChainId.ETH_MAINNET);
 
const contractMetadata = await client.balances.getContractMetadata(
    `0x362bc847A3a9637d3af6624EeC853618a43ed7D2`
);
 
console.log(contractMetadata)

Output:

{
  address: '0x362bc847A3a9637d3af6624EeC853618a43ed7D2',
  symbol: 'PRQ',
  name: 'Parsiq Token',
  decimals: 18,
  total_supply_raw: '310256872000000000000000000',
  total_supply_calculated: '310256872',
  estimated_usd_price: null
}

Parameters

Path params
chainId
string
REQUIRED
version
string
REQUIRED
contract
string
REQUIRED
Query params
estimate_cu
boolean