Batch Calls
A batch call sends an array of JSON-RPC requests in one HTTP call; most chains accept up to 400 calls per batch, but batches under 50 perform best.
Batch calling allows you to send multiple JSON-RPC requests within a single API call. Instead of making dozens of individual requests, you can bundle them together into one batch, reducing network round trips and improving overall efficiency when interacting with the blockchain.
All batch requests are forwarded and processed as raw node requests, without additional Gateway-level enhancements or optimisations.
Batch Limits & Recommendations
A batch size of up to 50 requests generally performs well. However, some RPC methods are significantly more resource-intensive than others. In such cases, even smaller batches may overload nodes and result in slow responses or timeouts.
When performance issues occur:
- Reduce batch size – split large batches into smaller groups.
- Fallback to single requests – for especially heavy or computationally expensive methods.
Hard Limits (per chain)
The following hard limits apply to batch requests:
- Most chains: Up to 400 calls per batch
- Polygon: Up to 100 calls per batch
- NEAR: Not natively supported. Tatum provides an additional batching layer with a limit of 5 calls per batch.
NoteEach JSON object in the array counts as an individual request. For example, 10 objects in a batch = 10 requests billed, each at its method's credit cost. See how much a Tatum RPC request costs.
Batch Call Format
A batch call consists of a JSON array containing standard JSON-RPC request objects. Each object follows the same schema as a regular single JSON-RPC request.
The example below batches two calls on Ethereum. For another chain, use its gateway URL, and add as many request objects to the array as you need. Batch calls are available on paid plans only; on other plans, the gateway answers with error -16402.
Request Example:
curl --location 'https://ethereum-mainnet.gateway.tatum.io' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {YOUR_API_KEY}' \
--data '[
{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
},
{
"jsonrpc": "2.0",
"method": "eth_getBlockByNumber",
"params": ["latest", true],
"id": 2
}
]'const { TatumSDK, Network } = require('@tatumio/tatum');
(async () => {
const tatum = await TatumSDK.init({
network: Network.ETHEREUM,
apiKey: '{YOUR_API_KEY}',
});
const request = [
{
jsonrpc: '2.0',
id: 1,
method: 'eth_blockNumber',
params: [],
},
{
jsonrpc: '2.0',
id: 2,
method: 'eth_getBlockByNumber',
params: ['latest', true],
},
];
const batchResponse = await tatum.rpc.rawBatchRpcCall(request);
console.log(batchResponse);
await tatum.destroy();
})();Performance Considerations
Some blockchains do not handle large batch requests efficiently. Large payloads may result in degraded performance or request timeouts.
For example, see known issues with Optimism: Optimism debug_trace and node performance issues.
Best Practices
- ✅ Keep batches under 50 items for reliability.
- ✅ Use a unique ID for each request in the batch.
- ✅ Validate each request format and parameters before sending.
- ✅ Distribute heavy workloads across multiple smaller batches.
- ✅ Monitor for timeouts and retry with reduced batch sizes when necessary.
Updated 2 days ago