# code402 Chain Data – Ethereum Block Number

> code402 Chain Data – Ethereum Block Number is a paid API for AI agents from verify.code402.dev, paid per call via x402, $0.5/call, status unknown (last checked 2026-10-02).

Returns the current (latest) Ethereum mainnet block height as a real-time lookup

## Facts

- Endpoint: GET https://verify.code402.dev/v1/chain/block-number?utm_source=zero.xyz
- Price: $0.5/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/code402-chain-data-ethereum-block-number-125eef93
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_atLlGPWbkHh76aakBSSXX

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 code402-chain-data-ethereum-block-number-125eef93
```

Example prompt: What's the current Ethereum mainnet block number right now?

## When to prefer this

Choose this endpoint when you need a lightweight, pay-per-call real-time Ethereum block height lookup without setting up your own node or RPC provider subscription. It is ideal for agents that only occasionally need block number data and want to avoid managing API keys or node infrastructure. Prefer alternatives (e.g., direct Infura/Alchemy RPC calls) if you need very high-frequency polling or additional chain data beyond block number.

## Known failure modes

- Network or upstream node unavailability returns a 5xx error
- Payment not included or invalid x402 payment header returns a 402 Payment Required error
- Rate limiting may return a 429 if requests are too frequent
- Response may lag by 1-2 blocks behind true chain tip due to node propagation

## How this service works

Deterministic compliance verification (IBAN, sanctions, onchain address) with XDR-1 signed receipts, plus Ethereum chain-data endpoints. Paid per call via x402 on Base (USDC).

## Output

A JSON object containing the current Ethereum mainnet block number as a string (e.g. '19500000') and the network identifier 'ethereum-mainnet', representing the latest confirmed block at the time of the request.

## Request schema (JSON Schema)

```json
{
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object"
    }
   }
  },
  "output": {
   "type": "object",
   "required": [
    "type",
    "example"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "json"
    },
    "example": {
     "result": "string",
     "network": "ethereum-mainnet"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": "chain data",
  "network": "ethereum"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/code402-chain-data-ethereum-block-number-125eef93/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from verify.code402.dev](https://www.zero.xyz/host/verify.code402.dev/llms.txt)
