# Agent402 Block Info

> Agent402 Block Info is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Fetches on-chain block metadata (hash, number, gas, timestamp, tx count) for a given block on Ethereum-compatible networks

## Facts

- Endpoint: GET https://agent402.tools/api/block-info
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-block-info-53d8b648
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_I4oVVf_eMa-nBASYaCj9O

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 agent402-block-info-53d8b648
```

Example prompt: What are the details for the latest block on Base — give me the block number, timestamp, transaction count, gas used, and base fee?

## When to prefer this

Use this endpoint when you need lightweight, pay-per-call block metadata from EVM-compatible chains without setting up RPC infrastructure, managing API keys, or signing up for a service. Ideal for agents that need occasional block lookups across multiple chains (Base, Ethereum, Polygon, Arbitrum, Optimism) with micro-payments via USDC on Base or other supported chains. Prefer this over self-managed RPC nodes when simplicity, multi-chain coverage, and zero-signup access matter more than bulk throughput.

## Known failure modes

- Invalid block number format returns an error (must be decimal, 0x hex, or 'latest')
- Unsupported network name returns an error (only ethereum, base, polygon, arbitrum, optimism accepted)
- Network RPC unavailable may return a timeout or upstream error
- Block number higher than current chain head returns not-found or error
- Payment failure (insufficient USDC balance or unsupported chain) results in HTTP 402 with payment details

## How this service works

Header-level detail for one block on Ethereum, Base, Polygon, Arbitrum, or Optimism: hash, timestamp (unix + ISO), transaction count, gas used/limit, base fee. Pass a block number, 0x hex, or "latest". Keyless multi-endpoint failover. ?block=latest&network=base

## Output

Returns a JSON object with the block hash, block number, gas used, gas limit, transaction count, base fee per gas (in wei), Unix timestamp, ISO 8601 timestamp, and the network name for the requested block.

## 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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [],
     "properties": {
      "block": {
       "type": "string",
       "description": "Block number (decimal or 0x hex) or \"latest\" (default latest)."
      },
      "network": {
       "type": "string",
       "description": "ethereum / base / polygon / arbitrum / optimism (default base)."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "network",
      "number",
      "hash",
      "timestamp",
      "timestampIso",
      "txCount",
      "gasUsed",
      "gasLimit",
      "baseFeePerGas"
     ],
     "properties": {
      "hash": {
       "type": "string"
      },
      "number": {
       "type": "integer"
      },
      "gasUsed": {
       "type": "string"
      },
      "network": {
       "type": "string"
      },
      "txCount": {
       "type": "integer"
      },
      "gasLimit": {
       "type": "string"
      },
      "timestamp": {
       "type": "integer"
      },
      "timestampIso": {
       "type": "string"
      },
      "baseFeePerGas": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "hash": "0x…",
  "number": 27000000,
  "gasUsed": "8123456",
  "network": "base",
  "txCount": 142,
  "gasLimit": "180000000",
  "timestamp": 1753747200,
  "timestampIso": "2026-07-29T00:00:00.000Z",
  "baseFeePerGas": "4100000"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-block-info-53d8b648/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
