Avalanche RPC Endpoint Documentation | ERPC
Avalanche RPC Endpoint Documentation
Use ERPC as your Avalanche RPC endpoint for HTTP JSON-RPC requests and WebSocket subscriptions. Avalanche RPC is part of ERPC's RPC APIs within our Global Edge Blockchain Infrastructure, and the API key can be managed from the ERPC Web Dashboard.
You can use the same RPC key as Solana and Ethereum.
Please add your API key to the 'api-key' parameter.
Endpoints
Send JSON-RPC 2.0 requests as HTTP POST to:
text
https://edge.erpc.global/ava?api-key=<YOUR_API_KEY>https://edge.erpc.global/ava?api-key=<YOUR_API_KEY>For subscriptions, connect over WebSocket to:
text
wss://edge.erpc.global/ava?api-key=<YOUR_API_KEY>wss://edge.erpc.global/ava?api-key=<YOUR_API_KEY>The upstream API is selected by the exact JSON-RPC method name, so C-Chain, X-Chain, and P-Chain calls all go to the same endpoint.
Examples
Here is an HTTP request example.
bash
curl https://edge.erpc.global/ava?api-key=<YOUR_API_KEY> --header 'Content-Type: application/json' --data '{
"jsonrpc":"2.0","id":1,
"method":"eth_blockNumber"
}'curl https://edge.erpc.global/ava?api-key=<YOUR_API_KEY> --header 'Content-Type: application/json' --data '{
"jsonrpc":"2.0","id":1,
"method":"eth_blockNumber"
}'Here is a WebSocket subscription example.
bash
wscat -c "wss://edge.erpc.global/ava?api-key=<YOUR_API_KEY>"
# After connected, send:
{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}wscat -c "wss://edge.erpc.global/ava?api-key=<YOUR_API_KEY>"
# After connected, send:
{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}You can obtain and check your API key on the ERPC Web Dashboard: ERPC Web Dashboard
Batch Requests
JSON-RPC batches of up to 256 calls per HTTP request are supported for C-Chain EVM methods, and JSON-RPC notifications are also accepted. The native Avalanche namespaces —
avax.*, avm.*, platform.*, proposervm.*, and info.upgrades — are single-call. Each call in a batch is metered as its own call.Usage Metering
Usage is metered in tokens at a flat rate per JSON-RPC call — the same rate for every Avalanche RPC method. Each entry in an HTTP batch and each JSON-RPC call sent over a WebSocket connection is metered separately. You can check the current per-call token rate in the Avalanche RPC API Reference.
Supported Methods
The endpoint covers the C-Chain EVM JSON-RPC method families —
eth_*, net_*, txpool_*, and web3_* — including account and block reads (eth_getBalance, eth_getBlockByNumber, eth_getLogs), transaction flow (eth_sendRawTransaction, eth_getTransactionReceipt), fee data (eth_gasPrice, eth_maxPriorityFeePerGas), call simulation (eth_call, eth_estimateGas), filters (eth_newFilter, eth_getFilterChanges), txpool inspection (txpool_status, txpool_content), the C-Chain extensions (eth_getAssetBalance, eth_baseFee), and WebSocket subscriptions (eth_subscribe, eth_unsubscribe).The native Avalanche APIs are served from the same endpoint: C-Chain atomic operations (
avax.getAtomicTx, avax.getUTXOs, avax.issueTx), the X-Chain (avm.getBalance, avm.getTx, avm.issueTx), the P-Chain (platform.getCurrentValidators, platform.getStake, platform.getHeight, platform.issueTx, proposervm.getProposedHeight), and network upgrade timings (info.upgrades).For the complete method list with request and response shapes, see the Avalanche RPC API Reference.
Response Status Codes
| HTTP status | Meaning |
|---|---|
| 200 | Upstream JSON-RPC response. |
| 400 | Missing API key, or an invalid JSON-RPC request. |
| 401 | Unauthorized API key. |
| 429 | Rate limited. The retry-after header gives the wait in seconds. |
| 502 | The upstream RPC request could not be completed. |
| 503 | The service is temporarily unavailable. |
A JSON-RPC method outside the published catalog is answered with HTTP
400 and JSON-RPC error -32601 (Method not found), and a batch above 256 calls is answered with HTTP 400.WebSocket connections use
101 (protocol upgrade accepted) and 426 (a WebSocket Upgrade handshake is required) in addition to the codes above.Avalanche RPC Methods and Documentation
For the full list of standard methods, parameters, and subscription specifications, please refer to the official documentation. It covers both HTTP and WebSocket usage.
- C-Chain (EVM JSON-RPC): https://build.avax.network/docs/rpcs/c-chain
- X-Chain (
avm.*): https://build.avax.network/docs/rpcs/x-chain - P-Chain (
platform.*): https://build.avax.network/docs/rpcs/p-chain






