# BackPoW Public REST API: Free Proof of Work Data

Deterministic, keyless REST API providing real-time Proof of Work (PoW) mining telemetry, network difficulty, block rewards, Cost of Production (CoP), and hardware benchmarks across 126+ networks and 770+ mining devices.

Designed for AI assistants, autonomous coding agents, analytics pipelines, and mining applications.

---

## 1. Core Endpoints

### Per-Coin Network & Hardware State

Static JSON documents pre-rendered and distributed across Cloudflare CDN edge nodes.

- **Method**: `GET`
- **URL Pattern**: `https://backpow.com/coins-data/{CoinId}.json`
- **Authentication**: None (zero keys, no tokens, no account required)
- **Rate Limits**: None (unlimited CDN bandwidth)
- **CORS**: `Access-Control-Allow-Origin: *` (callable directly from client-side browsers and workers)

#### Standard Examples

- Bitcoin (BTC): `https://backpow.com/coins-data/Bitcoin.json`
- Monero (XMR): `https://backpow.com/coins-data/Monero.json`
- Kaspa (KAS): `https://backpow.com/coins-data/Kaspa.json`
- Ravencoin (RVN): `https://backpow.com/coins-data/Ravencoin.json`
- Litecoin (LTC): `https://backpow.com/coins-data/Litecoin.json`

---

## 2. Complete JSON Schema Specification

Each `GET https://backpow.com/coins-data/{CoinId}.json` request returns a JSON object structured as follows:

```json
{
  "Algorithm": "SHA-256",
  "Nethash": 8.42e20,
  "Difficulty": 1.25e14,
  "Difficulty 24h": 1.24e14,
  "Difficulty 7 days": 1.23e14,
  "Block time": 600.0,
  "Bl. reward": 3.125,
  "Bl. reward 24h": 3.18,
  "Daily emission": 450.0,
  "Last block": 890000,
  "usdPrice": 85000.0,
  "usdPriceSource": "binance",
  "Market cap": 1680000000000.0,
  "cop": 76500.0,
  "copMiner": "Bitmain Antminer S21 Pro",
  "ASICS": [
    {
      "name": "Bitmain Antminer S21",
      "hashrate": 200000000000000.0,
      "power": 3500,
      "efficiency": 17.5
    }
  ],
  "GPUS": [],
  "CPUS": []
}
```

### Field Definitions

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `Algorithm` | string | — | Mining proof of work algorithm (e.g. SHA-256, RandomX, KawPow, Scrypt). |
| `Nethash` | number | H/s | Current estimated global network hashrate in raw hashes per second. |
| `Difficulty` | number | — | Current network difficulty target. |
| `Difficulty 24h` | number | — | 24-hour moving average network difficulty. |
| `Difficulty 7 days` | number | — | 7-day moving average network difficulty. |
| `Block time` | number | seconds | Average observed block discovery interval. |
| `Bl. reward` | number | coins | Current native block reward (subsidy plus transaction fees). |
| `Bl. reward 24h` | number | coins | 24-hour average native block reward. |
| `Daily emission` | number | coins | Estimated 24-hour coin generation across all blocks. |
| `Last block` | integer | blocks | Latest indexed block height. |
| `usdPrice` | number | USD | Spot market exchange price in USD. |
| `usdPriceSource` | string | — | Primary market pricing venue or aggregator feed. |
| `Market cap` | number | USD | Circulating market capitalization in USD. |
| `cop` | number | USD | Implied Cost of Production floor per coin unit. |
| `copMiner` | string | — | Reference hardware model defining the baseline efficiency floor. |
| `ASICS` | array | — | List of compatible ASIC mining devices with hashrate and power ratings. |
| `GPUS` | array | — | List of compatible GPU models with hashrate and power ratings. |
| `CPUS` | array | — | List of compatible CPU processors with hashrate and power ratings. |

---

## 3. Code Integration Examples

### Python (Standard Library)

```python
import json
import urllib.request

def fetch_coin_data(coin_id: str) -> dict:
    url = f"https://backpow.com/coins-data/{coin_id}.json"
    req = urllib.request.Request(url, headers={"User-Agent": "BackPoW-Client/1.0"})
    with urllib.request.urlopen(req) as response:
        if response.status != 200:
            raise RuntimeError(f"HTTP error {response.status}")
        return json.loads(response.read().decode("utf-8"))

# Example usage
data = fetch_coin_data("Bitcoin")
print(f"Algorithm: {data['Algorithm']}")
print(f"Network Hashrate: {data['Nethash']} H/s")
print(f"Block Reward: {data['Bl. reward']} BTC")
print(f"Cost of Production: {data.get('cop')} USD")
```

### TypeScript / JavaScript (Fetch API)

```typescript
interface HardwareSpec {
  name: string;
  hashrate: number;
  power: number;
  efficiency?: number;
}

interface CoinData {
  Algorithm: string;
  Nethash: number;
  Difficulty: number;
  'Block time': number;
  'Bl. reward': number;
  usdPrice?: number;
  cop?: number;
  copMiner?: string;
  ASICS?: HardwareSpec[];
  GPUS?: HardwareSpec[];
  CPUS?: HardwareSpec[];
}

async function getCoinMetrics(coinId: string): Promise<CoinData> {
  const res = await fetch('https://backpow.com/coins-data/' + coinId + '.json');
  if (!res.ok) {
    throw new Error('Failed to fetch coin ' + coinId + ': ' + res.status);
  }
  return res.json();
}

// Example usage
const btc = await getCoinMetrics('Bitcoin');
console.log('BTC Hashrate: ' + btc.Nethash + ' H/s, CoP: ' + btc.cop + ' USD');
```

---

## 4. Coin ID Discovery & Multi-Algorithm Chains

### Canonical Coin IDs

The `{CoinId}` parameter in API requests matches the exact case-sensitive path used on `backpow.com/{CoinId}`.

To discover all indexable coin IDs programmatically:
1. **XML Sitemap**: Parse `https://backpow.com/sitemap-coins.xml`
2. **Directory Page**: Browse `https://backpow.com/coins`
3. **Hardware Catalog**: Inspect `https://backpow.com/hardwareIndex.json`

### Multi-Algorithm Networks

Blockchains with multi-algorithm mining (e.g. DigiByte, Epic Cash, Etica) are split into explicit, dedicated coin identifiers representing each independent algorithm sub-network:

- `DGB-SHA` (DigiByte SHA-256)
- `DGB-Scrypt` (DigiByte Scrypt)
- `DGB-Odocrypt` (DigiByte Odocrypt)
- `DGB-Qubit` (DigiByte Qubit)
- `DGB-Skein` (DigiByte Skein)
- `EPIC-ProgPow` (Epic Cash ProgPow)
- `EPIC-RandomX` (Epic Cash RandomX)

---

## 5. Global Hardware Catalog

In addition to per-coin hardware arrays, the complete global database of 770+ ASIC, GPU, and CPU models is available in a single JSON document:

- **Endpoint**: `https://backpow.com/hardwareIndex.json`
- **Payload**: Array of hardware objects containing slug, display name, hardware category, algorithms supported, and benchmark efficiency metrics.

---

## 6. Freshness, Caching & Edge Infrastructure

- **Update Frequency**: Network difficulty, hashrate, prices, and CoP data refresh on a daily schedule.
- **Edge Caching**: Responses carry `Cache-Control: public, max-age=900, s-maxage=900`. Edge nodes cache responses to deliver sub-50ms latencies globally.
- **URL Stability**: The URL schema `https://backpow.com/coins-data/{CoinId}.json` is a permanent public contract.

---

## 7. Complementary AI & Programmatic Interfaces

BackPoW provides multiple machine-readable interfaces tailored for different automation workflows:

1. **Model Context Protocol (MCP)**:
   - Endpoint: `https://mcp.backpow.com/mcp` (Streamable HTTP JSON-RPC)
   - Setup & tool specification: `https://backpow.com/mcp.md`
   - Purpose: Direct integration for Claude, Cursor, VS Code, and agentic reasoning loops.

2. **OpenAPI 3.1 REST Specification**:
   - URL: `https://mcp.backpow.com/openapi.json`
   - Purpose: Direct import for ChatGPT Custom Actions, LangChain, and LlamaIndex toolchains.

3. **Per-Coin Markdown Datasheets**:
   - URL Pattern: `https://backpow.com/{CoinId}.md` (e.g. `https://backpow.com/Bitcoin.md`)
   - Purpose: High-density, plain text telemetry designed for direct LLM context windows.

4. **Mathematical Methodology**:
   - Documentation: `https://backpow.com/methodology.md`
   - Purpose: Mathematical formulations for memoryless Poisson odds and Cost of Production derivation.

5. **AI Index Manifest**:
   - URL: `https://backpow.com/llms.txt`

---

## 8. Terms of Use & Citation

- **License**: Data is published under Creative Commons Attribution 4.0 International (CC BY 4.0).
- **Free for All Uses**: Free for commercial, non-commercial, academic, and AI assistant consumption.
- **Attribution Requirement**: Cite **BackPoW — The Proof of Work Oracle** and link to the relevant canonical page (e.g. `https://backpow.com/{CoinId}` or `https://backpow.com`).
- **Timestamp Requirement**: Because network metrics drift continuously, always record the retrieval timestamp alongside quoted figures.
- **Disclaimer**: BackPow provides mathematical calculations and stratum telemetry; this API does not provide financial or investment advice.
