# Mat Web & Data Toolkit – Lightning Network Stats

> Mat Web & Data Toolkit – Lightning Network Stats is a paid API for AI agents from automatom.matt-d59.workers.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-18).

Fetches current Lightning Network statistics including node count, channel count, capacity, and fee data from mempool.space.

## Facts

- Endpoint: GET https://automatom.matt-d59.workers.dev/lightning?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-18
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/mat-web-data-toolkit-lightning-network-stats-bdd5143c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_r-5cXOxsQvo3p_Gx-kPfL

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 mat-web-data-toolkit-lightning-network-stats-bdd5143c
```

Example prompt: What are the current Lightning Network stats — total capacity in BTC, number of nodes and channels, and average fee rate?

## When to prefer this

Use this endpoint when you need a quick, real-time snapshot of aggregate Lightning Network statistics (node count, channel count, capacity, fee rates) without needing to query mempool.space directly. Prefer this over general web-scraping endpoints when you specifically need structured Lightning Network metrics.

## Known failure modes

- mempool.space upstream unavailable — returns error or stale data
- Invalid unit parameter — may return unexpected format
- Rate limiting or payment failure — 402 payment required if USDC payment not processed
- Network timeout if mempool.space is slow to respond

## How this service works

Fetches a public web page and returns its title, meta description, outbound links and readable plain text as JSON.

## Output

Returns a JSON object with timestamp, unit (btc or sats), number of nodes, channels, Tor nodes, clearnet nodes, average fee rate in ppm, average base fee in msat, average and median channel capacity in sats, total network capacity in BTC and sats, and median fee rate in ppm, sourced from mempool.space.

## 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": {
      "unit": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "time": "2026-08-30T00:00:00.000Z",
  "unit": "btc",
  "nodes": 16230,
  "source": "mempool.space",
  "channels": 32518,
  "tor_nodes": 7983,
  "clearnet_nodes": 4598,
  "avg_fee_rate_ppm": 823,
  "avg_base_fee_msat": 904,
  "avg_capacity_sats": 11543596,
  "total_capacity_btc": 3753.74668018,
  "median_fee_rate_ppm": 100,
  "total_capacity_sats": 375374668018,
  "median_capacity_sats": 2010000
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/mat-web-data-toolkit-lightning-network-stats-bdd5143c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from automatom.matt-d59.workers.dev](https://www.zero.xyz/host/automatom.matt-d59.workers.dev/llms.txt)
