# Bitcoin Network Difficulty Chart API

> Bitcoin Network Difficulty Chart API is a paid API for AI agents from api.blockchain.info, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-30).

Returns time-series chart data for Bitcoin network mining difficulty over a specified time period

## Facts

- Endpoint: POST https://api.blockchain.info/explorer-gateway-kt/x402/charts/difficulty?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/bitcoin-network-difficulty-chart-api-6efe20fd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_iYh3WmF8dn9w0wm5vs6NG

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-network-difficulty-chart-api-6efe20fd -d '<json body>'
```

Example prompt: Pull the Bitcoin network difficulty chart from Blockchain.com for the past year with an 8-hour rolling average so I can see how mining difficulty has trended.

## When to prefer this

Choose this endpoint when you need historical or recent Bitcoin network difficulty data in time-series form, especially when you want configurable timespans, rolling averages, and sampling for visualization. It is part of Blockchain.com's official explorer infrastructure, making it a reliable source for on-chain Bitcoin metrics. Prefer it over generic crypto APIs when you specifically need difficulty chart data with fine-grained time controls.

## Known failure modes

- Invalid timespan format returns error or empty data
- Unsupported chart format enum value causes validation failure
- Payment not received (402) when x402 payment header is missing or insufficient
- Rate limiting if too many requests are made in quick succession
- Server-side data gaps may produce incomplete value arrays

## How this service works

Paid AI-agent access to Blockchain.com Explorer API

## Output

Returns a JSON object containing the chart name ('Difficulty'), unit ('difficulty'), time period granularity ('day'), status ('ok'), a human-readable description of the metric, and an array of {x: unix_timestamp, y: difficulty_value} data points representing the Bitcoin network's estimated mining difficulty over the requested timespan.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "cors": {
   "type": "boolean",
   "default": false,
   "description": "Enable CORS headers"
  },
  "format": {
   "enum": [
    "json",
    "csv"
   ],
   "type": "string",
   "default": "json",
   "description": "Response format:\n- `json` — Returns structured JSON with metadata and values\n- `csv` — Returns raw CSV data with timestamp and value columns (no metadata)\n"
  },
  "sampled": {
   "type": "boolean",
   "default": true,
   "description": "Apply sampling to reduce data points"
  },
  "metadata": {
   "type": "boolean",
   "default": false,
   "description": "Include metadata in response"
  },
  "timespan": {
   "type": "string",
   "default": "1y",
   "example": "1y",
   "description": "Time period (e.g., \"24h\", \"7d\", \"1y\", \"3y\")"
  },
  "rollingAverage": {
   "type": "string",
   "default": "8h",
   "example": "8h",
   "description": "Rolling average window (e.g., \"8h\", \"24h\")"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "format": "application/json",
 "example": {
  "name": "Difficulty",
  "unit": "difficulty",
  "period": "day",
  "status": "ok",
  "values": [
   {
    "x": 1704067200,
    "y": 72000000000000
   },
   {
    "x": 1704153600,
    "y": 72100000000000
   }
  ],
  "description": "The estimated difficulty of the bitcoin network"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/bitcoin-network-difficulty-chart-api-6efe20fd/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.blockchain.info](https://www.zero.xyz/host/api.blockchain.info/llms.txt)
