---
title: "Get wallet token balances across chains"
method: POST
path: "/?ankr_getAccountBalance"
tags: ["Token API"]
---

# Get wallet token balances across chains

`POST /?ankr_getAccountBalance`

## Request

- Base URL: `https://rpc.ankr.com/multichain/569ca1f392f7d3d0bb1073a1173ecb649af1d9249231fe59fa95db19d5ae41fe`
- URL: `https://rpc.ankr.com/multichain/569ca1f392f7d3d0bb1073a1173ecb649af1d9249231fe59fa95db19d5ae41fe/?ankr_getAccountBalance`
- Auth: none declared
- TypeScript: <https://skmtc.dev/ankr/apis/ankr-advanced-api/docs/%3Fankr_getAccountBalance/post.ts> (a function with typed inputs; its response is checked against the schema)

Returns the **total native + ERC-20 balance** of a wallet across one or more supported EVM chains, with USD valuations computed by Ankr's pricing service. Each asset includes contract address, decimals, raw integer balance, and a normalized human-readable balance.

Pass `walletAddress` (hex address, or ENS name on Ethereum). Scope to specific chains with the `blockchain` array, or omit it to query all supported chains. Filter by `onlyWhitelisted: true` (default) to limit results to tokens indexed on CoinGecko, or set to `false` for the full ERC-20 inventory the wallet has touched.

Pagination via `pageSize` + `pageToken`. The endpoint is part of the **Token API** product (700 compute units per call, $0.00007 at base rate).

## Request body

- object
  - `id` integer, required: Client-supplied request ID echoed in the response.
  - `jsonrpc` '2.0', required
  - `method` 'ankr_getAccountBalance', required
  - `params` object, required
    - `walletAddress` string, required: Wallet to query. Hex address (`0x…`) or ENS name on Ethereum (e.g. `vitalik.eth`).
    - `blockchain` string[]: Optional. One or more chains to query. Omit for all supported chains.
    - `nativeFirst` boolean: Sort native tokens first when true.
    - `onlyWhitelisted` boolean: Restrict to tokens listed on CoinGecko. Defaults to true; set false for the full ERC-20 inventory.
    - `pageSize` integer: Number of assets per page. Default is no pagination.
    - `pageToken` string: Opaque page token from a prior response's `nextPageToken`.

## Response `200`

Success. JSON-RPC `result` envelope contains the asset list, total USD valuation, and total count. Note: JSON-RPC errors (e.g. `-32602 invalid params`) are also returned with HTTP 200 — clients must check for `error` in the response body.

- object
  - `id` integer, required
  - `jsonrpc` '2.0', required
  - `result` object, required
    - `totalBalanceUsd` string, required: Sum of all asset USD values for the wallet, as a decimal string.
    - `totalCount` integer, required: Total number of ERC-20 and native-token holdings.
    - `nextPageToken` string: Page token for subsequent pages. Empty when no more pages remain.
    - `assets` object[], nullable, required: Asset entries. Native token for the chain plus any ERC-20 holdings.
      - `blockchain` 'arbitrum' | 'avalanche' | 'base' | 'bsc' | 'eth' | 'fantom' | 'flare' | 'gnosis' | 'linea' | 'optimism' | 'polygon' | 'scroll' | 'somnia_mainnet' | 'taiko' | 'telos' | 'xlayer' | 'avalanche_fuji' | 'base_sepolia' | 'eth_sepolia' | 'optimism_sepolia' | 'polygon_amoy', required
      - `tokenName` string, required
      - `tokenSymbol` string, required
      - `tokenDecimals` integer, required
      - `tokenType` string, required: `NATIVE` for the chain's native asset, or the ERC token standard (`ERC20`, …).
      - `holderAddress` string, required: Address of the wallet that holds the asset.
      - `contractAddress` string: ERC-20 contract address. Absent for native tokens.
      - `balance` string, required: Human-readable balance (decimal string).
      - `balanceRawInteger` string, required: Raw integer balance (`balance × 10^decimals`).
      - `balanceUsd` string, required: USD value of the holding.
      - `tokenPrice` string, required: Current unit price in USD.
      - `thumbnail` string, required: URL to the token logo.

## Other responses

- `400`: Bad Request — malformed JSON-RPC envelope or invalid `params`. The gateway rejects before the JSON-RPC layer processes the call.
- `401`: Unauthorized — missing or invalid API key in the server URL path. Verify that `{API_KEY}` is set to a valid project key.
- `429`: Too Many Requests — the API key has exceeded its rate or quota limits. Back off and retry; consider upgrading the Premium tier for higher limits.
- `500`: Server error — unexpected condition. Retry with exponential backoff; if it persists, file a ticket at https://www.ankr.com/support/.

---

[API](https://skmtc.dev/ankr/apis/ankr-advanced-api.md) - [All operations](https://skmtc.dev/ankr/apis/ankr-advanced-api/llms.txt) - [OpenAPI document](https://skmtc.dev/ankr/apis/ankr-advanced-api/revisions/77e494aeec1b?raw)
