Granite Upgrade Activates in11d:22h:51m:43s
Balances

List ERC-20 balances

Lists ERC-20 token balances of a wallet address.

Balance at a given block can be retrieved with the blockNumber parameter.

Balance for specific contracts can be retrieved with the contractAddresses parameter.

GET
/v1/chains/{chainId}/addresses/{address}/balances:listErc20
x-glacier-api-key<token>

Api keys provide higher access to rate limits. To obtain an api key, sign up for an account at https://build.avax.network/console/utilities/data-api-keys.

In: header

Path Parameters

chainIdstring

A supported evm chain id or blockchain id. Use the /chains endpoint to get a list of supported chain ids.

addressstring

A wallet address.

Query Parameters

blockNumber?string

The block number, if not defined the block number will be the latest block.

pageToken?string

A page token, received from a previous list call. Provide this to retrieve the subsequent page.

pageSize?integer

The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 500.

Default10
Range1 <= value <= 500
filterSpamTokens?boolean

whether to filter out spam tokens from the response. Default is true.

Defaulttrue
contractAddresses?string

A comma separated list of contract addresses to filter by.

currency?string

The currency that return values should use. Defaults to USD.

Value in"usd" | "eur" | "aud" | "cad" | "chf" | "clp" | "cny" | "czk" | "dkk" | "gbp" | "hkd" | "huf" | "jpy" | "nzd"

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://data-api.avax.network/v1/chains/43114/addresses/0x71C7656EC7ab88b098defB751B7401B5f6d8976F/balances:listErc20?blockNumber=6479329&pageSize=10&contractAddresses=0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7%2C+0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB&currency=usd"
{
  "nextPageToken": "string",
  "nativeTokenBalance": {
    "name": "Wrapped AVAX",
    "symbol": "WAVAX",
    "decimals": 18,
    "logoUri": "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg",
    "chainId": "43114",
    "price": {
      "currencyCode": "usd",
      "value": "42.42"
    },
    "balance": "2000000000000000000",
    "balanceValue": {
      "currencyCode": "usd",
      "value": "42.42"
    }
  },
  "erc20TokenBalances": [
    {
      "address": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
      "name": "Wrapped AVAX",
      "symbol": "WAVAX",
      "decimals": 18,
      "logoUri": "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg",
      "ercType": "ERC-20",
      "price": {
        "currencyCode": "usd",
        "value": "42.42"
      },
      "chainId": "43114",
      "balance": "2000000000000000000",
      "balanceValue": {
        "currencyCode": "usd",
        "value": "42.42"
      },
      "tokenReputation": "Malicious"
    }
  ]
}
{
  "message": "string",
  "statusCode": 400,
  "error": "Bad Request"
}
{
  "message": "string",
  "statusCode": 401,
  "error": "Unauthorized"
}
{
  "message": "string",
  "statusCode": 403,
  "error": "Forbidden"
}
{
  "message": "string",
  "statusCode": 404,
  "error": "Not Found"
}
{
  "message": "string",
  "statusCode": 429,
  "error": "Too Many Requests"
}
{
  "message": "string",
  "statusCode": 500,
  "error": "Internal Server Error"
}
{
  "message": "string",
  "statusCode": 502,
  "error": "Bad Gateway"
}
{
  "message": "string",
  "statusCode": 503,
  "error": "Service Unavailable"
}

Is this guide helpful?