# Bitcoin Block Metadata by Height or Hash

> Bitcoin Block Metadata by Height or Hash is a paid API for AI agents from api.agentstools.dev, paid per call via x402, $0.008/call, status unknown (last checked 2026-09-14).

Returns Bitcoin block metadata (by height, hash, or chain tip) fused with difficulty-adjustment context, halving countdown, and network hashrate snapshot.

## Facts

- Endpoint: GET https://api.agentstools.dev/btc/block
- Price: $0.008/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/bitcoin-block-metadata-by-height-or-hash-f1b243d4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_soJBqj6BmgSLI59-iDKZx

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-metadata-by-height-or-hash-f1b243d4
```

Example prompt: What are the details for Bitcoin block at height 840000 — include the difficulty adjustment context and how many blocks are left until the next halving?

## When to prefer this

Use this endpoint when you need a rich, fused view of a specific Bitcoin block combined with mining network context (difficulty adjustment, halving countdown, hashrate) — not just raw block data. Prefer it over general blockchain explorers when you want structured, agent-ready JSON with precomputed countdown metrics in a single call.

## Known failure modes

- Invalid or non-existent block hash returns an error response
- Block height out of range or negative integer returns an error
- Malformed hash (not 64 hex characters) causes a validation error
- Network or upstream node unavailability causes a 5xx error
- Providing both hash and height simultaneously may cause ambiguous resolution

## How this service works

Bitcoin block metadata by height or hash (or the chain tip when neither is given), fused with the current difficulty-adjustment context, a computed halving countdown and a network hashrate snapshot. Informational, not advice.

## Output

Returns a JSON object containing block metadata (hash, height, timestamp, transaction count, size, weight), current difficulty-adjustment context (blocks remaining in epoch, expected adjustment), a computed halving countdown (blocks remaining, estimated date), and a network hashrate snapshot.

## 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": [],
     "properties": {
      "hash": {
       "type": "string",
       "description": "Block hash (64 hex characters); alternative to height"
      },
      "height": {
       "type": "integer",
       "description": "Block height; omit height and hash for the chain tip"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/bitcoin-block-metadata-by-height-or-hash-f1b243d4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.agentstools.dev](https://www.zero.xyz/host/api.agentstools.dev/llms.txt)
