# Bitcoin Blocks Range API

> Bitcoin Blocks Range API is a paid API for AI agents from api.chainmarket-api.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-11-21).

Returns up to 144 consecutive Bitcoin blocks descending from a given height (or chain tip), with fee, reward, size, weight, tx count, and mining pool data per block.

## Facts

- Endpoint: GET https://api.chainmarket-api.workers.dev/api/crypto/btc-blocks-range?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-blocks-range-api-ef891858
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_BSZotn0jk7OlmZuexRGVj

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-blocks-range-api-ef891858
```

Example prompt: Can you pull the last 50 Bitcoin blocks starting from height 850000 — I want to see the fees, rewards, tx counts, and which mining pools mined each one?

## When to prefer this

Choose this endpoint when you need a batch of consecutive Bitcoin blocks with rich per-block stats (fees, rewards, pool attribution, weight) in a single call — especially for trend analysis, mining pool research, or fee monitoring over a range. Prefer over single-block lookups when you need historical context across many blocks at once.

## Known failure modes

- Invalid or out-of-range fromHeight returns an error or empty result
- count outside 1-144 range may return an error or be clamped
- Chain tip lag may result in slightly stale data near the tip
- Network timeout if the Workers endpoint is under load
- Missing pool attribution if block coinbase is unrecognized

## How this service works

Up to 144 consecutive Bitcoin blocks descending from fromHeight (or tip). Returns height, hash, time, size, weight, tx count, fees, subsidy, reward, median fee sat/vB, and pool name for each block.

## Output

An ordered list of up to 144 Bitcoin block records, each containing: block height, hash, timestamp, size (bytes), weight (WU), transaction count, total fees (sats), subsidy (sats), total reward (sats), median fee rate (sat/vB), and attributed mining pool name.

## 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": [],
     "properties": {
      "count": {
       "type": "string",
       "description": "Number of consecutive blocks to return, 1 to 144 (default 15)"
      },
      "fromHeight": {
       "type": "string",
       "description": "Starting block height (descending downwards, optional default: latest tip)"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/bitcoin-blocks-range-api-ef891858/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.chainmarket-api.workers.dev](https://www.zero.xyz/host/api.chainmarket-api.workers.dev/llms.txt)
