# Blockscout Optimism Batch Details by Number

> Blockscout Optimism Batch Details by Number is a paid API for AI agents from api.blockscout.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-11).

Retrieves detailed information about a specific Optimism L2 batch by its batch number on a given chain

## Facts

- Endpoint: GET https://api.blockscout.com/%7Bchain_id%7D/api/v2/optimism/batches/%7Bnumber%7D
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/blockscout-optimism-batch-details-by-number-55caf4c7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xfqGJ9NUJ9ukcJinuRk2F

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability blockscout-optimism-batch-details-by-number-55caf4c7
```

Example prompt: Can you look up the details for Optimism batch number 12345 on Blockscout? I want to know the L1 transaction hash and how many L2 transactions it included.

## When to prefer this

Use this endpoint when you need detailed information about a specific Optimism L2 batch by its sequential number, particularly for tracing L2-to-L1 submission, verifying batch finality, or debugging transaction inclusion. Prefer this over general transaction search when you already know the batch number and need structured batch-level metadata rather than individual transaction details.

## Known failure modes

- Batch number not found — returns 404 if the batch does not exist
- Invalid chain_id — returns error if the chain is not supported
- Malformed path parameters — returns 422 or 400 for non-numeric batch numbers
- Rate limiting or payment failure — returns 402 if x402 payment is not provided
- Network timeout — upstream blockchain node may be slow or unavailable

## How this service works

Explore crypto activities with Blockscout's multichain search. Find transactions, addresses, tokens, and dapps across top blockchain networks — your go-to explorer for cross-chain blockchain data

## Output

Returns a JSON object containing details about the specified Optimism batch, including batch number, timestamp, transaction count, L1 transaction hash, block range covered, and status/finalization information.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "pathParams": {
     "type": "object",
     "properties": {
      "number": {
       "type": "string"
      },
      "chain_id": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {}
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/blockscout-optimism-batch-details-by-number-55caf4c7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.blockscout.com](https://www.zero.xyz/host/api.blockscout.com/llms.txt)
