<!-- source: https://secondlayer.tools/docs/api-reference#batch-read -->

## Batch public reads

`POST /v1/batch`

Up to 10 GET reads under `/v1/index/`, `/v1/subgraphs`, `/v1/streams/` and `/v1/contracts` in one round trip. Items run in parallel through the full app, so auth, rate limits and retention apply per item; the request's `Authorization` header is forwarded to every item. Results come back in request order, each with its own HTTP status and JSON body. A refused or failed item does not fail the batch.

### Body

| Field | Type | Description |
| --- | --- | --- |
| `requests` | array of object, required | The reads to run, 1 to 10. |

### Returns

One `BatchResponse` object.

### Responses

- `200` One result per request, in request order
- `400` The body is not `{ requests: [...] }`, `requests` is empty, or it holds more than 10 items (`VALIDATION_ERROR`)
- `401` This bind requires the instance token, and it was missing or wrong

### Example

```bash
curl -X POST https://api.secondlayer.tools/v1/batch \
  -H "Authorization: Bearer $SECONDLAYER_API_KEY" \
  --json '{
  "requests": [
    {
      "path": "/v1/streams/tip"
    },
    {
      "path": "/v1/streams/canonical/9048876"
    },
    {
      "path": "/api/subgraphs"
    }
  ]
}'
```

```json
{
  "results": [
    {
      "path": "/v1/streams/tip",
      "status": 200,
      "body": {
        "block_height": 9048928,
        "block_hash": "0xe79ae38b78b37ad1f5d16c7afd04b4e202efe8d983d981803b785ca64257933f",
        "burn_block_height": 968284,
        "finalized_height": 9048671,
        "lag_seconds": 4,
        "oldest_seekable_height": null,
        "oldest_cursor": null
      }
    },
    {
      "path": "/v1/streams/canonical/9048876",
      "status": 200,
      "body": {
        "block_height": 9048876,
        "block_hash": "0xba0676b375e8d5fc1495a02847cc3cc32b5f7c2113a5e73999d94ee8d75ebde4",
        "burn_block_height": 968284,
        "burn_block_hash": "0x00000000000000000001b1cadea50180db28922325872c9f16ca19edda3f8bae",
        "is_canonical": true
      }
    },
    {
      "path": "/api/subgraphs",
      "status": 400,
      "body": {
        "error": "Path not allowed in batch (public /v1 reads only)",
        "code": "VALIDATION_ERROR"
      }
    }
  ]
}
```
