# Block Number Lookup (Base & Ethereum)

> Block Number Lookup (Base & Ethereum) is a paid API for AI agents from x402-micro-pay.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-11-20).

Returns the current latest block number for Base and/or Ethereum chains, optionally with block timestamps, paid per-call via x402/USDC.

## Facts

- Endpoint: POST https://x402-micro-pay.com/api/skills/block-number?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/block-number-lookup-base-ethereum-e4a75714
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_6DjTooAKjy-k1A1eKwU06

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 block-number-lookup-base-ethereum-e4a75714 -d '<json body>'
```

Example prompt: What's the current block number on Base right now, and include the timestamp for the latest block?

## When to prefer this

Use this endpoint when you need the current canonical block number for Base or Ethereum chains without setting up API keys or accounts — ideal for AI agents that need on-chain synchronization points, timestamped block anchors, or chain-tip references in automated workflows. Prefer this over direct RPC calls when you want a simple JSON wrapper with no infrastructure overhead and micropayment-based access.

## Known failure modes

- HTTP 402 returned if payment not attached — must pay $0.001 USDC via x402 on Base before retrying
- Invalid chain value (not 'base' or 'ethereum') returns a validation error
- RPC node unavailability may cause missing or stale block data
- chains array with 0 items or >2 items rejected by schema
- Malformed request_id (non-alphanumeric characters) causes rejection

## How this service works

41 pay-per-call JSON APIs for AI agents. No account or API key: an unpaid POST returns HTTP 402, pay in USDC on Base with x402 v2, retry. Prices from $0.001 per call.

## Output

Returns a JSON object with ok:true and a data object containing results array with chain name, chain_id, block_number, block_hex, and optionally timestamp/timestamp_iso for each requested chain. Also includes a summary string (e.g. 'base#22000000'), confidence score, data_as_of timestamp, and a 'next' array suggesting related skills to call.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "chains": {
   "type": "array",
   "items": {
    "enum": [
     "base",
     "ethereum"
    ],
    "type": "string"
   },
   "default": [
    "base"
   ],
   "maxItems": 2,
   "minItems": 1,
   "uniqueItems": true
  },
  "request_id": {
   "type": "string",
   "pattern": "^[A-Za-z0-9._:-]+$",
   "maxLength": 64,
   "minLength": 1,
   "description": "Optional idempotency key. Echoed back; a credit-pack redemption with the same request_id and body is charged once."
  },
  "include_timestamp": {
   "type": "boolean",
   "default": false,
   "description": "When true, also fetch eth_getBlockByNumber for the tip timestamp"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "data": {
   "as_of": "2026-10-26T14:00:00Z",
   "results": [
    {
     "chain": "base",
     "chain_id": 8453,
     "block_hex": "0x14fb180",
     "timestamp": null,
     "block_number": 22000000,
     "timestamp_iso": null
    }
   ]
  },
  "next": [
   "tx_status",
   "gas_price"
  ],
  "skill": "block_number",
  "charged": true,
  "service": "block_number",
  "sources": [
   {
    "url": "chain:8453",
    "name": "base eth_blockNumber",
    "fetched_at": "2026-10-26T14:00:00Z"
   }
  ],
  "summary": "base#22000000",
  "version": "1.0.0",
  "warnings": [],
  "confidence": 0.95,
  "data_as_of": "2026-10-26T14:00:00Z",
  "generated_at": "2026-10-26T14:00:00Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/block-number-lookup-base-ethereum-e4a75714/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-micro-pay.com](https://www.zero.xyz/host/x402-micro-pay.com/llms.txt)
