ankr_getAccountBalance
Get wallet token balances across chains
POST/?ankr_getAccountBalance
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
Responses
- 200
- 400
- 401
- 429
- 500
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.
Bad Request — malformed JSON-RPC envelope or invalid params. The gateway rejects before the JSON-RPC layer processes the call.
Unauthorized — missing or invalid API key in the server URL path. Verify that {API_KEY} is set to a valid project key.
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.
Server error — unexpected condition. Retry with exponential backoff; if it persists, file a ticket at https://www.ankr.com/support/.