# Financial Data x402 – Block by Timestamp

> Financial Data x402 – Block by Timestamp is a paid API for AI agents from x402financialdata.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Returns the Ethereum block number closest to a given Unix timestamp, paid per-call via USDC over the x402 protocol.

## Facts

- Endpoint: GET https://x402financialdata.com/block-by-timestamp
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/financial-data-x402-block-by-timestamp-cc8e32d3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_AsfR8OjK-TlL0fCuhrKuO

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 financial-data-x402-block-by-timestamp-cc8e32d3
```

Example prompt: What Ethereum block number was mined just before Unix timestamp 1780000000? I need the closest block before that time on ETH.

## When to prefer this

Choose this endpoint when you need to map a specific Unix timestamp to an Ethereum block number without signing up for an API key or subscription — ideal for agents that need pay-as-you-go on-chain historical lookups, smart contract state queries anchored to a moment in time, or DeFi data pipelines that bill per-call via USDC over x402.

## Known failure modes

- Missing required 'timestamp' query parameter returns an error
- Unsupported chain value (only 'eth' is supported) returns a validation error
- Future timestamp with no mined blocks yet may return an error or unexpected result
- Payment failure or insufficient USDC balance causes x402 payment rejection
- Invalid 'closest' enum value (not 'before' or 'after') returns a validation error

## How this service works

Pay-per-call stock, macro, on-chain, and crypto data over the x402 protocol. USDC on Base or Solana, no API keys, no subscriptions.

## Output

Returns a JSON object with the chain name ('eth'), the closest direction used ('before' or 'after'), the requested Unix timestamp, and the resolved Ethereum block number as an integer (e.g. {"chain":"eth","closest":"before","timestamp":1780000000,"block_number":25196227}).

## 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"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "timestamp"
     ],
     "properties": {
      "chain": {
       "enum": [
        "eth"
       ],
       "type": "string",
       "description": "Which chain to query. Only 'eth' is supported right now."
      },
      "closest": {
       "enum": [
        "before",
        "after"
       ],
       "type": "string",
       "description": "Return the closest block before or after the timestamp, default 'before'."
      },
      "timestamp": {
       "type": "integer",
       "description": "Unix timestamp (seconds)."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "chain": "eth",
  "closest": "before",
  "timestamp": 1780000000,
  "block_number": 25196227
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/financial-data-x402-block-by-timestamp-cc8e32d3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402financialdata.com](https://www.zero.xyz/host/x402financialdata.com/llms.txt)
