# Blockscout Optimism Output Roots API

> Blockscout Optimism Output Roots API 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 paginated list of Optimism output roots (L2-to-L1 state commitments) for a specified blockchain chain via Blockscout

## Facts

- Endpoint: GET https://api.blockscout.com/%7Bchain_id%7D/api/v2/optimism/output-roots
- 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-output-roots-api-af2ba22b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_fxfQA-4JVoK2In7Yw_IM0

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-output-roots-api-af2ba22b
```

Example prompt: Can you pull the latest Optimism output roots for chain ID 10 from Blockscout, showing the 25 most recent entries starting from index 100?

## When to prefer this

Use this endpoint when you need structured, paginated access to Optimism output root data (L2 state commitments to L1) for a specific chain via Blockscout's API. Prefer this over generic block explorers when you need machine-readable output root history with L1/L2 cross-reference data in a single call.

## Known failure modes

- Invalid chain_id returns 404 or empty results
- Out-of-range index returns empty items array
- Malformed query params return 400 Bad Request
- Rate limiting or payment failure returns 402 Payment Required
- Chain not supported by Blockscout returns error or empty response

## 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 paginated array of Optimism output root objects, each containing the output root hash, L1 timestamp, L1 block number, L2 block number, L2 output index, and the L1 transaction hash where the root was submitted. Also includes next_page_params for cursor-based pagination.

## 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": {
      "chain_id": {
       "type": "string"
      }
     }
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "index": {
       "type": "integer"
      },
      "items_count": {
       "type": "integer"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "items": [
   {
    "output_root": "string",
    "l1_timestamp": "string",
    "l1_block_number": 0,
    "l2_block_number": 0,
    "l2_output_index": 0,
    "l1_transaction_hash": "string"
   }
  ],
  "next_page_params": {}
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/blockscout-optimism-output-roots-api-af2ba22b/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)
