Skip to Content
API ReferenceJSON-RPC Batch

JSON-RPC Batch

JSON-RPC Batch

Send multiple method calls in a single HTTP request by passing an array of JSON-RPC objects to POST /v1. Up to 50 requests per batch. Each request is executed independently — partial failures are possible. Responses are returned in the same order as the requests. Mix any methods freely (e.g. getBlockHeight + getBalance + getPrice in one call).

curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
  -H "Content-Type: application/json" \
[
  {
    "jsonrpc": "2.0",
    "method": "getBlockHeight",
    "params": {
      "chain": "ethereum"
    },
    "id": 1
  },
  {
    "jsonrpc": "2.0",
    "method": "getBalance",
    "params": {
      "chain": "ethereum",
      "address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
    },
    "id": 2
  },
  {
    "jsonrpc": "2.0",
    "method": "getPrice",
    "params": {
      "symbol": "ETH"
    },
    "id": 3
  }
]
Max Batch Size
50 requests per call
Request Format
Array of {jsonrpc, method, params, id} objects
Error Handling
Each request returns independently — failed items get an error object, successful items get a result

Response Fields

FieldType
jsonrpcstring
resultobject
dataobject
chainstring
heightinteger
idinteger
Try It
[
  {
    "jsonrpc": "2.0",
    "method": "getBlockHeight",
    "params": {
      "chain": "ethereum"
    },
    "id": 1
  },
  {
    "jsonrpc": "2.0",
    "method": "getBalance",
    "params": {
      "chain": "ethereum",
      "address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
    },
    "id": 2
  },
  {
    "jsonrpc": "2.0",
    "method": "getPrice",
    "params": {
      "symbol": "ETH"
    },
    "id": 3
  }
]

Example Batch Request

Send a JSON array to the same POST /v1 endpoint you use for single JSON-RPC requests. Each item must include its own jsonrpc, method, params, and id.

[ { "jsonrpc": "2.0", "method": "getBlockHeight", "params": { "chain": "ethereum" }, "id": 1 }, { "jsonrpc": "2.0", "method": "getBalance", "params": { "chain": "ethereum", "address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" }, "id": 2 }, { "jsonrpc": "2.0", "method": "getTokenMetadata", "params": { "chain": "ethereum", "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" }, "id": 3 } ]

cURL Example

curl -X POST https://your-endpoint.simplystaking.xyz/v1 \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_KEY" \ -d '[ { "jsonrpc": "2.0", "method": "getBlockHeight", "params": { "chain": "ethereum" }, "id": 1 }, { "jsonrpc": "2.0", "method": "getBalance", "params": { "chain": "ethereum", "address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" }, "id": 2 }, { "jsonrpc": "2.0", "method": "getTokenMetadata", "params": { "chain": "ethereum", "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" }, "id": 3 } ]'

Successful Response

[ { "jsonrpc": "2.0", "result": { "data": { "chain": "0x1", "height": 24535031 } }, "id": 1 }, { "jsonrpc": "2.0", "result": { "data": { "chain": "0x1", "address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", "token": "ETH", "balance": "32.126799033316011" } }, "id": 2 }, { "jsonrpc": "2.0", "result": { "data": { "chain": "ethereum", "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "name": "USD Coin", "symbol": "USDC", "decimals": 6, "totalSupply": "53151453828.474567" } }, "id": 3 } ]

Partial Failure Example

Batch items are independent. One request can fail while the rest succeed. Use the id field to match each response item back to the original request.

[ { "jsonrpc": "2.0", "result": { "data": { "chain": "0x1", "height": 24535031 } }, "id": 1 }, { "jsonrpc": "2.0", "error": { "code": 400, "message": "Invalid address" }, "id": 2 }, { "jsonrpc": "2.0", "result": { "data": { "chain": "ethereum", "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "name": "USD Coin", "symbol": "USDC", "decimals": 6, "totalSupply": "53151453828.474567" } }, "id": 3 } ]

Notes

  • You can mix methods freely in the same batch.
  • Maximum batch size is 50 requests.
  • Keep id values unique within a batch so response matching stays unambiguous.
  • A batch is still a single HTTP request, but Spectrum executes each JSON-RPC item independently.