# Bitcoin Mempool API
> Live Bitcoin on-chain and mempool data as an API, built on the open mempool.space dataset — a different layer from market-price feeds. Get recommended transaction fees (sat/vB) for fast, half-hour, hour and economy confirmation, the current mempool state with its fee histogram, the most recent blocks and full block detail by height or hash (size, weight, transaction count, mining pool, reward and fees). Look up any Bitcoin address for its confirmed and unconfirmed balance and transaction counts, or any transaction by id for its inputs, outputs, fee and confirmation status. Track the difficulty-adjustment countdown, mining-pool hashrate share, the network hashrate over time and the current BTC price. Real on-chain data, no key needed upstream. Ideal for wallets, block explorers, fee estimators, mining dashboards and crypto analytics.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/mempool-api/..."
```

## Pricing
- **Free** (Free) — 7,000 calls/Mo, 2 req/s
- **Starter** ($6/Mo) — 100,000 calls/Mo, 8 req/s
- **Pro** ($22/Mo) — 550,000 calls/Mo, 25 req/s
- **Mega** ($75/Mo) — 2,800,000 calls/Mo, 50 req/s

## Endpoints

### Bitcoin

#### `GET /v1/address` — Address balance & tx counts

**Parameters:**
- `address` (query, required, string) — A Bitcoin address Example: `1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/mempool-api/v1/address?address=1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
```

**Response:**
```json
{
    "data": {
        "chain": {
            "balance": 5720796473,
            "tx_count": 63008,
            "spent_sum": 0,
            "funded_sum": 5720796473
        },
        "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
        "mempool": {
            "tx_count": 0,
            "spent_sum": 0,
            "funded_sum": 0
        }
    },
    "meta": {
        "timestamp": "2026-06-08T01:19:53.991Z",
        "request_id": "88fa4a88-3294-41ca-b1ae-5b6601e58bd7"
    },
    "status": "ok",
    "message": "Address retrieved successfully",
    "success": true
}
```

#### `GET /v1/block` — Block detail by height or hash

**Parameters:**
- `height` (query, optional, string) — Block height, e.g. 800000 Example: `800000`
- `hash` (query, optional, string) — Block hash (alternative to height)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/mempool-api/v1/block?height=800000"
```

**Response:**
```json
{
    "data": {
        "block": {
            "bits": 386218132,
            "hash": "00000000000000000002a7c4c1e48d76c5a37902165a270156b7a8d72728a054",
            "size": 1634536,
            "nonce": 106861918,
            "height": 800000,
            "weight": 3992881,
            "version": 874340352,
            "tx_count": 3721,
            "timestamp": 1690168629,
            "difficulty": 53911173001054.586,
            "merkle_root": "91f01a00530c8c83617190048ea8b0814d506cf24dfdbcf8893f8f0cab7f0855",
            "previous_block": "000000000000000000012117ad9f72c1c0e42227c2d042dca23e6b96bd9fbb55"
        }
    },
    "meta": {
        "timestamp": "2026-06-08T01:19:54.117Z",
        "request_id": "f8f068dd-483a-408f-84f8-925e24d8dfef"
    },
    "status": "ok",
    "message": "Block retrieved successfully",
    "success": true
}
```

#### `GET /v1/blocks` — The most recent blocks

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/mempool-api/v1/blocks"
```

**Response:**
```json
{
    "data": {
        "count": 15,
        "blocks": [
            {
                "bits": 386008719,
                "hash": "00000000000000000000ca26e1b2c9ac55324209c6359ba124122d46c1dfacbd",
                "pool": "MARA Pool",
                "size": 1604000,
                "nonce": 2353618982,
                "height": 952789,
                "reward": 314001818,
                "weight": 3993095,
                "version": 662069248,
                "tx_count": 5055,
                "fee_range": [
                    0.5857142857142857,
                    0.6132142857142857,
                    0.6188571428571429,
                    0.6385714285714286,
                    1.0857142857142856,
                    2.315315315315315,
                    50
                ],
                "timestamp": 1780880962,
                "difficulty": 138955357012247.3,
                "median_fee": 1,
                "total_fees": 1501818,
                "merkle_root": "0d354f298792189dbf3c69ba68d541034e0d6b4dc5c7282b6cc47e3d54a9b339",
                "previous_block": "00000000000000000000470626c3e621eb50c928bf9d42ca9315b1b13027fc11"
            },
            {
                "bits": 386008719,
                "hash": "00000000000000000000470626c3e621eb50c928bf9d42ca9315b1b13027fc11",
                "pool": "Foundry USA",
                "size": 1616051,
                "nonce": 2734003080,
                "height": 952788,
                "reward": 313353970,
       
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/difficulty` — Difficulty-adjustment status

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/mempool-api/v1/difficulty"
```

**Response:**
```json
{
    "data": {
        "remaining_time": 523326747,
        "progress_percent": 61.35912698412699,
        "remaining_blocks": 779,
        "difficulty_change": -10.614686483539892,
        "previous_retarget": 1.7190077664198355,
        "estimated_retarget_date": 1781404921747
    },
    "meta": {
        "timestamp": "2026-06-08T01:19:55.625Z",
        "request_id": "ee6053cd-3bb8-4ce6-b31a-31f77f4d3f4a"
    },
    "status": "ok",
    "message": "Difficulty retrieved successfully",
    "success": true
}
```

#### `GET /v1/fees` — Recommended transaction fees (sat/vB)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/mempool-api/v1/fees"
```

**Response:**
```json
{
    "data": {
        "hour": 1,
        "unit": "sat/vB",
        "economy": 1,
        "fastest": 1,
        "minimum": 1,
        "half_hour": 1
    },
    "meta": {
        "timestamp": "2026-06-08T01:19:55.731Z",
        "request_id": "311941c0-bd73-4921-9242-b65092be9351"
    },
    "status": "ok",
    "message": "Fees retrieved successfully",
    "success": true
}
```

#### `GET /v1/hashrate` — Network hashrate over time

**Parameters:**
- `period` (query, optional, string) — 24h | 3d | 1w | 1m | … Example: `1m`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/mempool-api/v1/hashrate?period=1m"
```

**Response:**
```json
{
    "data": {
        "count": 31,
        "period": "1m",
        "hashrates": [
            {
                "hashrate": 9.873315544973881e+20,
                "timestamp": 1778284800
            },
            {
                "hashrate": 1.104548446767261e+21,
                "timestamp": 1778371200
            },
            {
                "hashrate": 9.939410890887741e+20,
                "timestamp": 1778457600
            },
            {
                "hashrate": 1.107902334414321e+21,
                "timestamp": 1778544000
            },
            {
                "hashrate": 8.649437798573863e+20,
                "timestamp": 1778630400
            },
            {
                "hashrate": 9.163139560685774e+20,
                "timestamp": 1778716800
            },
            {
                "hashrate": 9.87446035292961e+20,
                "timestamp": 1778803200
            },
            {
                "hashrate": 9.686996303082559e+20,
                "timestamp": 1778889600
            },
            {
                "hashrate": 1.029772883544185e+21,
                "timestamp": 1778976000
            },
            {
                "hashrate": 9.603486290337243e+20,
                "timestamp": 1779062400
            },
            {
                "hashrate": 9.364806032762224e+20,
                "timestamp": 1779148800
            },
            {
                "hashrate": 9.629338250505994e+20,
                "timestamp": 177
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/mempool` — Current mempool state & fee histogram

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/mempool-api/v1/mempool"
```

**Response:**
```json
{
    "data": {
        "count": 103132,
        "vsize": 43079120,
        "total_fee": 9138330,
        "fee_histogram": [
            {
                "vsize": 55589,
                "fee_rate": 4.0306334
            },
            {
                "vsize": 54249,
                "fee_rate": 3.0214286
            },
            {
                "vsize": 50594,
                "fee_rate": 2.3
            },
            {
                "vsize": 50008,
                "fee_rate": 2.0434783
            },
            {
                "vsize": 50044,
                "fee_rate": 1.95
            },
            {
                "vsize": 68263,
                "fee_rate": 1.5755396
            },
            {
                "vsize": 50670,
                "fee_rate": 1.204599
            },
            {
                "vsize": 50053,
                "fee_rate": 1.0920246
            },
            {
                "vsize": 57734,
                "fee_rate": 1.0215827
            },
            {
                "vsize": 50220,
                "fee_rate": 1.0070423
            },
            {
                "vsize": 60202,
                "fee_rate": 1
            },
            {
                "vsize": 50042,
                "fee_rate": 0.77697843
            },
            {
                "vsize": 56841,
                "fee_rate": 0.65467626
            },
            {
                "vsize": 87933,
                "fee_rate": 0.64028776
            },
      
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/mining` — Mining-pool share

**Parameters:**
- `period` (query, optional, string) — 24h | 3d | 1w | 1m | 3m | 6m | 1y | … Example: `1w`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/mempool-api/v1/mining?period=1w"
```

**Response:**
```json
{
    "data": {
        "pools": [
            {
                "name": "Foundry USA",
                "blocks": 234,
                "empty_blocks": 0,
                "share_percent": 27
            },
            {
                "name": "AntPool",
                "blocks": 163,
                "empty_blocks": 0,
                "share_percent": 18.8
            },
            {
                "name": "F2Pool",
                "blocks": 99,
                "empty_blocks": 0,
                "share_percent": 11.4
            },
            {
                "name": "SpiderPool",
                "blocks": 90,
                "empty_blocks": 0,
                "share_percent": 10.4
            },
            {
                "name": "ViaBTC",
                "blocks": 76,
                "empty_blocks": 0,
                "share_percent": 8.8
            },
            {
                "name": "MARA Pool",
                "blocks": 42,
                "empty_blocks": 0,
                "share_percent": 4.8
            },
            {
                "name": "SECPOOL",
                "blocks": 38,
                "empty_blocks": 1,
                "share_percent": 4.4
            },
            {
                "name": "Luxor",
                "blocks": 35,
                "empty_blocks": 0,
                "share_percent": 4
            },
            {
                "name": "OCEAN",
                "blocks": 28,
                "empty_blocks": 0,
                "s
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/price` — Current BTC price

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/mempool-api/v1/price"
```

**Response:**
```json
{
    "data": {
        "aud": 89425,
        "cad": 88000,
        "eur": 54745,
        "gbp": 47501,
        "jpy": 10123923,
        "usd": 63058,
        "time": 1780881305
    },
    "meta": {
        "timestamp": "2026-06-08T01:19:56.073Z",
        "request_id": "18a89d49-c68b-4392-b2e7-cf3c551a4bd9"
    },
    "status": "ok",
    "message": "Price retrieved successfully",
    "success": true
}
```

#### `GET /v1/tx` — Transaction detail by id

**Parameters:**
- `txid` (query, required, string) — A transaction id (64 hex) Example: `4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/mempool-api/v1/tx?txid=4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"
```

**Response:**
```json
{
    "data": {
        "transaction": {
            "fee": 0,
            "size": 204,
            "txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
            "status": {
                "confirmed": true,
                "block_time": 1231006505,
                "block_height": 0
            },
            "weight": 816,
            "outputs": [
                {
                    "type": "p2pk",
                    "value": 5000000000
                }
            ],
            "version": 1,
            "locktime": 0,
            "total_out": 5000000000,
            "input_count": 1,
            "output_count": 1
        }
    },
    "meta": {
        "timestamp": "2026-06-08T01:19:56.158Z",
        "request_id": "bd1be1c2-b441-4cc5-8659-fa9e41c7cb7b"
    },
    "status": "ok",
    "message": "Transaction retrieved successfully",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Service description & endpoints

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/mempool-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "service": "mempool-api",
        "endpoints": {
            "GET /v1/tx": "Transaction detail (txid=).",
            "GET /v1/fees": "Recommended fees (sat/vB).",
            "GET /v1/meta": "This document.",
            "GET /v1/block": "Block detail by height= or hash=.",
            "GET /v1/price": "Current BTC price.",
            "GET /v1/blocks": "The most recent blocks.",
            "GET /v1/mining": "Mining-pool share (period=24h|1w|1m|…).",
            "GET /v1/address": "Address stats (address=).",
            "GET /v1/mempool": "Current mempool state & fee histogram.",
            "GET /v1/hashrate": "Network hashrate (period=).",
            "GET /v1/difficulty": "Difficulty-adjustment status."
        },
        "description": "Live Bitcoin blockchain & mempool data via mempool.space: recommended fees, mempool state, recent blocks and block detail, address and transaction lookup, the difficulty adjustment, mining-pool share, network hashrate and the BTC price. Real on-chain data, no key."
    },
    "meta": {
        "timestamp": "2026-06-08T01:19:56.239Z",
        "request_id": "09dea5db-fce1-482b-bb4e-e0fea56982df"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/mempool-api
OpenAPI spec: https://www.oanor.com/api/mempool-api/openapi.json
