# Blockscout ZKSync Batch Count

> Blockscout ZKSync Batch Count 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-12).

Returns the total number of ZKSync batches on a specified blockchain network via Blockscout's explorer API

## Facts

- Endpoint: GET https://api.blockscout.com/%7Bchain_id%7D/api/v2/zksync/batches/count
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/blockscout-zksync-batch-count-ec3fa6c2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_cG29QqRLHSPXLGCgqQ7V7

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-zksync-batch-count-ec3fa6c2
```

Example prompt: How many ZKSync batches have been processed so far on chain ID 324? Pull the count from Blockscout.

## When to prefer this

Use this endpoint when you need a lightweight, single-number count of total ZKSync batches on a specific chain via Blockscout. Prefer this over full batch list endpoints when you only need the aggregate count for dashboards, health checks, or monitoring, and do not require individual batch details.

## Known failure modes

- Invalid or unsupported chain_id returns an error or empty response
- Chain does not support ZKSync batches, returning 0 or an error
- Network timeout or API unavailability
- Payment failure due to insufficient x402 USDC balance

## 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 single integer representing the total count of ZKSync batches processed on the specified blockchain network. The response is a plain JSON number (e.g., 0 or any positive integer).

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

## Response schema (JSON Schema)

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

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/blockscout-zksync-batch-count-ec3fa6c2/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)
