Ethereum RPC Quickstart | ERPC

Ethereum RPC Quickstart

This guide takes you from zero to your first Ethereum JSON-RPC response with ERPC.

1. Get Your API Key

You can obtain and check your API key on the ERPC Web Dashboard: ERPC Web Dashboard
Already using ERPC for Solana? You can use the same RPC key as Solana.

2. Make Your First Request

Send a JSON-RPC 2.0 request as an HTTP POST, with your API key in the api-key parameter:
bash
curl https://edge.erpc.global/eth?api-key=<YOUR_API_KEY> --header 'Content-Type: application/json' --data '{
  "jsonrpc":"2.0","id":1,
  "method":"eth_blockNumber"
}'
The response returns the latest block number in hexadecimal:
json
{ "jsonrpc": "2.0", "id": 1, "result": "0x..." }
You can check which chain the endpoint serves with eth_chainId:
bash
curl https://edge.erpc.global/eth?api-key=<YOUR_API_KEY> --header 'Content-Type: application/json' --data '{
  "jsonrpc":"2.0","id":1,
  "method":"eth_chainId"
}'

3. Subscribe over WebSocket

The WebSocket endpoint accepts standard eth_subscribe subscriptions:
bash
wscat -c "wss://edge.erpc.global/eth?api-key=<YOUR_API_KEY>"
# After connected, send:
{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}
For the available subscription types, refer to the official Ethereum JSON-RPC documentation linked below.

4. Batch Requests

You can send up to 256 JSON-RPC calls in a single HTTP request. Each call in a batch is metered as its own call.
bash
curl https://edge.erpc.global/eth?api-key=<YOUR_API_KEY> --header 'Content-Type: application/json' --data '[
  {"jsonrpc":"2.0","id":1,"method":"eth_blockNumber"},
  {"jsonrpc":"2.0","id":2,"method":"eth_gasPrice"}
]'

Next Steps