Batch requests
Send a non-empty array of JSON-RPC requests, each with a distinct id. Match replies by id; the server may return them in a different order.
bashbash
curl 'https://ethras.org/v1/ethereum/<YOUR_KEY>' \-H 'Content-Type: application/json' \-d '[{"id":1,"jsonrpc":"2.0","method":"eth_chainId","params":[]},{"id":2,"jsonrpc":"2.0","method":"eth_blockNumber","params":[]}]'
jsonjson
[{"id": 1,"jsonrpc": "2.0","result": "0x1"},{"id": 2,"jsonrpc": "2.0","result": "0x186da89"}]
Partial failures
When the batch reaches method execution, entries can succeed or fail independently. For example, an unavailable method can produce an error for its own id:
jsonjson
[{"id": 1,"jsonrpc": "2.0","result": "0x1"},{"id": 2,"jsonrpc": "2.0","error": {"code": -32601,"message": "Method not found"}}]
- Each call in an accepted batch counts individually toward QPS and daily quota: a batch of 20 uses 20. Rejected requests do not imply that any entry was executed.
- Responses may arrive out of order — match by
id, not position. - Keep batches modest (≤20 requests) to avoid oversized payloads and slow slots dragging the whole response.
- The gateway defaults to at most 100 entries and a 1 MiB request body; exceeding either limit rejects the request with HTTP
413. Upstreams can impose lower limits. - Authentication, rate limits, malformed input or transport failures can reject the whole batch. Do not assume every failure body is an array.
- A batch is not an atomic snapshot. Pin a block number or supported block-hash selector for consistent state reads rather than using
latestindependently. - JSON-RPC notifications do not provide confirmation. Use an explicit
idfor each call whose result you need.