# Blockscout — List batches.

List Blockscout Optimism-family batches via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Blockscout, pass parameters such as Set, and retrieve structured data including batch number, associated L1 transaction hashes, and reported transaction count for batch explorer views, and rollup investigation, ready for production pipelines and AI agent automation.

Documentation: https://openany.si/blockscout/blockscout-list-batches/5c57cddb-13e4-4fac-9bb9-332655e0d0c3/
API ID: 5c57cddb-13e4-4fac-9bb9-332655e0d0c3
Provider: blockscout
Contract revision: 4
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/blockscout/{chain_id}/api/v2/optimism/batches
Page update time: 2026-12-03T02:49:19.509Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: none
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0 / call
The published contract currently has no usage charge. Authentication and service limits still apply.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:49:18.779Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "fixed",
  "priceMicroUsd": "0",
  "rounding": null,
  "unit": "call",
  "unitQuantity": null
}
```

## Usage and limits
## Blockscout Optimism Batches API

Supply chain\_id on optimism/batches. items describes batches with L2 block boundaries and L1 references. Continue with the exposed id query input, not the displayed batch number; items\_count must be at least 1.

## What You Can Build

- **Batch explorer views**: Display the route-specific batch identity and returned references.
- **Rollup investigation**: Keep chain context and continuation state with each result page.

## Documented Response Fields

| Field | Meaning |
| --- | --- |
| `items[].number` | Batch number |
| `items[].l2_start_block_number` | Start of the L2 block range |
| `items[].l2_end_block_number` | End of the L2 block range |
| `items[].l1_transaction_hashes[]` | Associated L1 transaction hashes |
| `items[].transactions_count` | Reported transaction count |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Blockscout — List batches. request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {
        "chain_id": {
          "type": "string",
          "description": "The ID of the blockchain"
        }
      },
      "required": [
        "chain_id"
      ]
    },
    "query": {
      "type": "object",
      "properties": {
        "items_count": {
          "type": "integer",
          "description": "Number of items per page",
          "minimum": 1
        },
        "id": {
          "type": "integer",
          "description": "ID for paging"
        }
      }
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "batch_data_container": {
            "type": "string"
          },
          "l1_timestamp": {
            "type": "string"
          },
          "l1_transaction_hashes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "l2_end_block_number": {
            "type": "integer"
          },
          "l2_start_block_number": {
            "type": "integer"
          },
          "number": {
            "type": "integer"
          },
          "transactions_count": {
            "type": "integer"
          }
        }
      }
    },
    "next_page_params": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        }
      }
    }
  }
}
```

## Request example
Scenario: Schema template · Schema template (not executed)
```bash
curl \
  'https://api.openany.si/v1/agent-apis/blockscout/%3Cchain_id%3E/api/v2/optimism/batches' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'
```

## Response example
Response illustration only. Placeholder values and unknown business fields are not recorded API results. Replace request placeholders before use.
Response template · not a real response · Documented HTTP 200
```json
{
  "items": [
    {
      "batch_data_container": "in_blob4844",
      "l1_timestamp": "<l1_timestamp>",
      "l1_transaction_hashes": [
        "<l1_transaction_hashes>"
      ],
      "l2_end_block_number": 0,
      "l2_start_block_number": 0,
      "number": 0,
      "transactions_count": 0
    }
  ],
  "next_page_params": {
    "id": 394591
  }
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### Which paging cursor does this route accept?
Use id from supported continuation context. It is separate from the returned batch number.

### Is this the Scroll or Arbitrum batches route?
No. This implementation is under optimism and has its own response fields and pagination.

### Does an L1 transaction hash contain the raw batch data?
It is a transaction reference. Raw transaction or data retrieval is a separate operation.

### Can I pass batch_numbers to this route?
No. This implementation exposes items_count and id, not batch_numbers.

### Which API key should I use?
Use your OpenAny API key as Bearer authentication on the documented OpenAny route.

### Where can I check the current request price?
Check the pricing area for the selected implementation. Follow its billing unit and any request-dependent rules before sending the request.

## Available implementations
- blockscout: https://openany.si/blockscout/blockscout-list-batches/5c57cddb-13e4-4fac-9bb9-332655e0d0c3/

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
