Ankr API
Multi-chain RPC and advanced APIs for reading blockchain data.
What it does
Ankr offers public and premium RPC endpoints for 75+ chains, plus an ‘Advanced API’ that answers multichain data questions in one call — token balances, NFT holdings, transaction history, token prices and logs across many networks — via extra JSON-RPC methods.
Base URL
Authentication
The public endpoints (rpc.ankr.com/eth, /polygon, /bsc…) need no key but are rate-limited. Premium RPC and the Advanced API use a key in the path: rpc.ankr.com/{chain}/{API_KEY} and rpc.ankr.com/multichain/{API_KEY}.
Code examples
curl -s -X POST https://rpc.ankr.com/eth \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'import requests
r = requests.post(f"https://rpc.ankr.com/multichain/{KEY}", json={
"jsonrpc": "2.0", "id": 1, "method": "ankr_getAccountBalance",
"params": {"walletAddress": "0xd8dA6BF...",
"blockchain": ["eth", "polygon", "bsc"]}}, timeout=15)
for a in r.json()["result"]["assets"]:
print(a["blockchain"], a["tokenSymbol"], a["balance"])Rate limits & quotas
Public endpoints: roughly 30 requests/second per IP, no archive data, best-effort availability — fine for testing, not production. A free registered plan raises limits and unlocks the Advanced API with a monthly credit budget. Over the limit: HTTP 429.
Key response fields
| result | Standard JSON-RPC result for eth_* methods |
| (ankr_getAccountBalance) result.assets[] | Per-chain token balances with USD value |
| (ankr_getNFTsByOwner) result.assets[] | NFTs with collection, image and traits |
| (ankr_getTokenPrice) result.usdPrice | Current price for a token contract |
| result.nextPageToken | Cursor for paginated Advanced API results |
Common errors
| 429 | Public-endpoint rate limit — register for a key or slow down. |
| -32600 / -32602 | Malformed JSON-RPC request or bad params (e.g. unknown blockchain value). |
| 401 | Advanced API called without a valid key in the path. |
When to use it (and alternatives)
Great for a quick keyless RPC during development, and the Advanced API is a tidy way to get cross-chain balances/NFTs without wiring up per-chain calls. For heavier production RPC, Alchemy or Infura; for GraphQL-style on-chain analytics, Bitquery.
FAQ
Can I use the public endpoints in production?
Not recommended — they are shared, rate-limited to ~30 rps, lack archive data and have no uptime guarantee. Register for a free key and use a dedicated endpoint for anything real.
What is the multichain endpoint?
rpc.ankr.com/multichain/{key} exposes the Advanced API methods (ankr_*) that aggregate data across chains in a single request — balances, NFTs, transfers, prices, logs.
Which chains are supported?
75+, including all major EVM L1s/L2s and several non-EVM chains. The chain slug goes in the URL path for RPC; the blockchain param lists them for Advanced API calls.
New to APIs?
Short guides for working with this API — and any other.