# Lightning Network API
> Live data for Bitcoin's Lightning Network — the instant-payment layer on top of Bitcoin — served straight from mempool.space's public API, no key, nothing cached. The stats endpoint returns the state of the whole network: how many nodes and payment channels exist, the total capacity locked in Bitcoin, the average and median channel capacity, the average fee rate, and the split between clearnet and Tor nodes — the network runs tens of thousands of channels holding thousands of BTC. The top endpoint is the node league table, ranked by liquidity (capacity) or by connectivity (channel count), with each node's alias, capacity and channel count — Bitfinex and Binance run some of the largest routing nodes. The search endpoint finds nodes by alias and returns their public key, capacity and channel count. This is the routing-and-liquidity layer for any Lightning wallet, node operator, payment or analytics app — who the big routing nodes are and how much capacity the network holds. Live from mempool.space, nothing stored. Distinct from on-chain Bitcoin and fee APIs — this is the Lightning Network layer. 4 endpoints.

## 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/lightning-api/..."
```

## Pricing
- **Free** (Free) — 10,200 calls/Mo, 3 req/s
- **Starter** ($9/Mo) — 124,000 calls/Mo, 8 req/s
- **Pro** ($23/Mo) — 608,000 calls/Mo, 15 req/s
- **Scale** ($55/Mo) — 3,040,000 calls/Mo, 30 req/s

## Endpoints

### Lightning

#### `GET /v1/search` — Find nodes by alias

**Parameters:**
- `q` (query, required, string) — Node alias to search Example: `bitfinex`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/lightning-api/v1/search?q=bitfinex"
```

**Response:**
```json
{
    "data": {
        "count": 3,
        "nodes": [
            {
                "alias": "blocktank-bitfinex-integration",
                "country": null,
                "channels": 1,
                "first_seen": null,
                "public_key": "0269c79a76518d58320044208838dca1705ba6b8e8e4465bc9028d778ab774d291",
                "capacity_btc": 0.0043,
                "capacity_sats": 430367
            },
            {
                "alias": "BITFINEXCH",
                "country": null,
                "channels": null,
                "first_seen": null,
                "public_key": "03ef018c550ac4dedb42788fdffdf859b4bff75bd8505b8c91fc44d05b8b4c5726",
                "capacity_btc": null,
                "capacity_sats": null
            },
            {
                "alias": "LN-Bitfinex",
                "country": null,
                "channels": null,
                "first_seen": null,
                "public_key": "02aa40ca5a360cf9735da325d03932025a9940cb8689c96d0479152ba301259893",
                "capacity_btc": null,
                "capacity_sats": null
            }
        ],
        "query": "bitfinex"
    },
    "meta": {
        "timestamp": "2026-06-09T11:38:51.674Z",
        "request_id": "6b7912da-470e-4178-bcbc-a8cec7159cc8"
    },
    "status": "ok",
    "message": "Search results retrieved successfully",
    "success": true
}
```

#### `GET /v1/stats` — Network statistics

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

**Response:**
```json
{
    "data": {
        "tor_nodes": 8937,
        "node_count": 17434,
        "updated_at": null,
        "channel_count": 40924,
        "clearnet_nodes": 4692,
        "avg_fee_rate_ppm": 830,
        "avg_capacity_sats": 11986349,
        "unannounced_nodes": 2027,
        "avg_base_fee_msats": 882,
        "clearnet_tor_nodes": 1778,
        "total_capacity_btc": 4905.29365,
        "median_fee_rate_ppm": 100,
        "total_capacity_sats": 490529364915,
        "median_capacity_sats": 2100000
    },
    "meta": {
        "timestamp": "2026-06-09T11:38:51.768Z",
        "request_id": "0f67c8ff-cd67-43f1-8a00-4a0014d13701"
    },
    "status": "ok",
    "message": "Stats retrieved successfully",
    "success": true
}
```

#### `GET /v1/top` — Node league table

**Parameters:**
- `by` (query, optional, string) — liquidity | connectivity (default liquidity) Example: `liquidity`
- `limit` (query, optional, string) — How many (default 25, max 100) Example: `25`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/lightning-api/v1/top?by=liquidity&limit=25"
```

**Response:**
```json
{
    "data": {
        "count": 25,
        "nodes": [
            {
                "alias": "bfx-lnd0",
                "country": "Switzerland",
                "channels": 665,
                "first_seen": null,
                "public_key": "033d8656219478701227199cbd6f670335c8d408a92ae88b962c49d4dc0e83e025",
                "capacity_btc": 560.52491,
                "capacity_sats": 56052491080
            },
            {
                "alias": "bfx-lnd1",
                "country": "Switzerland",
                "channels": 616,
                "first_seen": null,
                "public_key": "03cde60a6323f7122d5178255766e38114b4722ede08f7c9e0c5df9b912cc201d6",
                "capacity_btc": 463.11432,
                "capacity_sats": 46311431881
            },
            {
                "alias": "Binance",
                "country": null,
                "channels": 224,
                "first_seen": null,
                "public_key": "03a1f3afd646d77bdaf545cceaf079bab6057eae52c6319b63b5803d0989d6a72f",
                "capacity_btc": 462.95901,
                "capacity_sats": 46295900847
            },
            {
                "alias": "ACINQ",
                "country": "United States",
                "channels": 2025,
                "first_seen": null,
                "public_key": "03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f",
                "capacity_btc": 356.09318,
                "capacity_sats": 35609317862
         
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Spec

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

**Response:**
```json
{
    "data": {
        "source": "mempool.space public Lightning API (live)",
        "service": "lightning-api",
        "endpoints": {
            "GET /v1/top": "Node league table (by=liquidity|connectivity, limit up to 100).",
            "GET /v1/meta": "This document.",
            "GET /v1/stats": "Network statistics: nodes, channels, total capacity (BTC), fees, clearnet/Tor split.",
            "GET /v1/search": "Find nodes by alias (q=bitfinex): public key, capacity, channels."
        },
        "description": "Live Bitcoin Lightning Network data from mempool.space: network statistics (node and channel counts, total capacity in BTC, average and median channel capacity, average fee rate, clearnet/Tor split); the node league table ranked by liquidity or connectivity; and node search by alias with public key, capacity and channel count. Live, no key, nothing stored. Distinct from on-chain Bitcoin and fee APIs — this is the Lightning Network layer.",
        "upstream_status": "ok"
    },
    "meta": {
        "timestamp": "2026-06-09T11:38:52.050Z",
        "request_id": "f0796a83-d325-43ab-8510-78daff6b2f5f"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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