# Block by Timestamp – x402node

> Block by Timestamp – x402node is a paid API for AI agents from api.x402node.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Returns the block number closest to a given Unix timestamp on a specified blockchain, enabling historical on-chain queries without manual binary search.

## Facts

- Endpoint: GET https://api.x402node.dev/prices/block
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/block-by-timestamp-x402node-b412ca1d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_9JG2sGjl4KV_XGt3HOVGT

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-by-timestamp-x402node-b412ca1d
```

Example prompt: What was the closest Ethereum block to January 1st 2024 at midnight UTC? Give me the block number so I can use it for a historical on-chain snapshot.

## When to prefer this

Use this endpoint when you need to anchor a historical on-chain query (e.g. token balances, prices, liquidity) to a specific moment in time and need the corresponding block number. It eliminates the need to implement and run a binary search over block timestamps yourself. Prefer this over manually querying RPC endpoints when you want a quick, single-call resolution of timestamp-to-block without maintaining archive node access.

## Known failure modes

- Invalid or unsupported chain identifier returns an error
- Unix timestamp out of range (before genesis or in the future) returns an error
- Missing required parameters return a 400-level error
- Payment not fulfilled or insufficient USDC balance returns a 402 error
- Archive node unavailable for the requested chain may return a 503

## How this service works

Block height closest to a given unix timestamp on a chain, a primitive for historical on-chain queries. Saves agents a binary search over block times. Live block lookup. block by timestamp, block at time, historical block, archive query helper, chain block Accepts payment on Base or Solana — either network works.

## Output

Returns the block number (height) on the specified chain that is closest to the provided Unix timestamp, along with the actual block timestamp for verification — saving the caller from performing a binary search over block times.

## 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": [
      "timestamp"
     ],
     "properties": {
      "chain": {
       "type": "string",
       "description": "e.g. ethereum, base, arbitrum (default ethereum)"
      },
      "timestamp": {
       "type": "string",
       "description": "unix seconds"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/block-by-timestamp-x402node-b412ca1d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.x402node.dev](https://www.zero.xyz/host/api.x402node.dev/llms.txt)
