# Block Number by Timestamp

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

Returns the closest blockchain block number (height) to a given Unix timestamp for a specified chain

## Facts

- Endpoint: POST https://stablecrypto.dev/api/defillama/coins/block
- 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/block-number-by-timestamp-1b9757e9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_z-m1pevkg9o0TwQT-ZrlC

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-by-timestamp-1b9757e9 -d '<json body>'
```

Example prompt: What was the closest Ethereum block number to Unix timestamp 1700000000?

## When to prefer this

Use this endpoint when you need to anchor a historical on-chain query to a specific point in time — for example, looking up token prices, balances, or DeFi protocol state at a particular timestamp. Prefer this over RPC-based alternatives when you need a quick, multi-chain lookup without managing your own node.

## Known failure modes

- Invalid chain name returns an error or empty result
- Timestamp far in the future or before genesis block may return no result
- Network timeouts or DefiLlama API downtime result in HTTP 5xx
- Missing required fields (chain or timestamp) return a validation error

## How this service works

Pay-per-request access to CoinGecko, DefiLlama, Alchemy, and Etherscan APIs. No auth, no subscriptions.

## Output

Returns a JSON object with the block height (block number) and the actual timestamp of that block on the specified chain, using DefiLlama's block index.

## Example request

```json
{
 "chain": "ethereum",
 "timestamp": 1700000000
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "chain": {
   "type": "string",
   "description": "Chain name (e.g. \"ethereum\")"
  },
  "timestamp": {
   "type": "number",
   "description": "Unix timestamp"
  }
 }
}
```

## More

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