# Bitcoin Block Header Lookup

> Bitcoin Block Header Lookup is a paid API for AI agents from diamond.btc-intel.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-11-21).

Fetches the header metadata for a specific Bitcoin block by height or hash, including tx count, difficulty, confirmations, and timestamp.

## Facts

- Endpoint: GET https://diamond.btc-intel.workers.dev/api/x402/block_header?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-21
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/bitcoin-block-header-lookup-8c2a4309
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_sx7fI4yc29rKqk3Js2unA

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 bitcoin-block-header-lookup-8c2a4309
```

Example prompt: What's the block header for Bitcoin block 974000 — give me the hash, timestamp, transaction count, difficulty, and how many confirmations it has?

## When to prefer this

Use this endpoint when you need lightweight, pay-per-call block header metadata (height, hash, timestamp, tx count, difficulty, confirmations) without running a full node or subscribing to a plan. Ideal for one-off lookups, verification workflows, or agents that need on-demand Bitcoin block data at low cost ($0.002 USDC). Prefer over block explorer scraping for reliability and structured JSON output.

## Known failure modes

- Invalid block_id format (not a valid height integer or 64-char hex hash) returns an error
- Block height beyond the current chain tip returns not-found error
- Network or worker timeout returns a 5xx error
- Orphaned block hash may return unexpected results
- Missing block_id parameter returns a 400 validation error

## How this service works

Header of any Bitcoin block by height or hash: hash, previous and next hash, merkle root, time, median time past, bits, difficulty, nonce, version, tx count, confirmations.

## Output

Returns a JSON object with the block's 64-character hex hash, UTC timestamp when it was mined, an as-of UTC freshness timestamp, block height, number of transactions in the block, mining difficulty, and confirmation count since that block.

## 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",
     "required": [
      "block_id"
     ],
     "properties": {
      "block_id": {
       "type": "string",
       "maxLength": 64,
       "description": "Block height (for example 974000) or block hash (64 hex characters)"
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "hash": "00000000000000000000d7d13f5ac024052cad9613d9a6608f76df081d74e865",
  "time": "2026-11-07T18:00:00Z",
  "as_of": "2026-11-07T18:00:00Z",
  "height": 974000,
  "product": "block_header",
  "tx_count": 3600,
  "difficulty": 150000000000000,
  "confirmations": 957
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/bitcoin-block-header-lookup-8c2a4309/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from diamond.btc-intel.workers.dev](https://www.zero.xyz/host/diamond.btc-intel.workers.dev/llms.txt)
