# Bitcoin Scraper — Fees, Mempool, Blocks, Address Balance (`yadroo/bitcoin-mempool`) Actor

Bitcoin on-chain data for agents: recommended fees, mempool size and congestion, latest blocks, block height, hashrate and difficulty, address balance and transactions, transaction status. Powered by mempool.space. No API key.

- **URL**: https://apify.com/yadroo/bitcoin-mempool.md
- **Developed by:** [Samat Makatov](https://apify.com/yadroo) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.40 / 1,000 result items

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

Live Bitcoin data from the public mempool.space API in clean JSON: recommended fees and congestion, mempool projections,
address balances with transaction history, payment confirmation status (with RBF detection), blocks with pool and fee
stats, mining pool shares, hashrate and difficulty, Lightning Network stats and BTC price (current and historical).
Mainnet, testnet4, testnet3 and signet. No API key, no proxy, no browser.

### Use cases

- **Payment confirmation** — check whether a customer's BTC payment is confirmed, how many confirmations it has, or was replaced (RBF).
- **Fee optimisation** — run before a batch payout to pick `halfHourFee` / `economyFee`; alert when `congestion` is `high`.
- **Treasury / cold wallet monitoring** — daily balances plus everything received or sent since yesterday (`sinceDate`).
- **Accounting & audit** — per-address incoming/outgoing flows for a period, with fees and counterparties.
- **Mining & market research** — pool market share, hashrate trend, difficulty retargets, block fee share.
- **Lightning due diligence** — look up a node by alias or pubkey: capacity, channels, location, age.

### Input

| Field | Type | Default | Allowed values / notes |
|---|---|---|---|
| `mode` | string | `overview` | `overview`, `fees`, `mempool`, `blocks`, `block`, `address`, `tx`, `mining`, `lightning`, `price` (see Reference) |
| `network` | string | `mainnet` | `mainnet`, `testnet4`, `testnet` (legacy testnet3), `signet` — the platform refuses any other value before the run starts |
| `addresses` | string\[] | — (prefill: an example address) | mode=address: `bc1q…`, `bc1p…`, `1…`, `3…` (mainnet); `tb1…`, `m…`, `n…`, `2…` (test networks). Invalid ones are skipped and listed in `SUMMARY.errors` (not charged) |
| `txLimit` | integer | `25` | 0–200 transactions per address, newest first (0 = balance only). With dates, only transactions inside the dates count |
| `sinceDate` / `untilDate` | string | — | `YYYY-MM-DD` or ISO 8601, UTC. A date-only `untilDate` keeps that whole day. Filters address transactions and `blocks`; paging stops at `sinceDate`; `blocks` starts at the block mined at `untilDate` (today or later: at the tip) |
| `includeMempoolTxs` | boolean | `true` | Include unconfirmed address transactions |
| `includeUtxos` | boolean | `false` | Attach unspent outputs (mempool.space refuses addresses with > 500 UTXOs) |
| `txids` | string\[] | `[]` | mode=tx: 64-hex transaction ids |
| `includeRbf` | boolean | `true` | mode=tx: `replacedBy` / `replaces` |
| `blocks` | string\[] | `[]` | mode=block: heights and/or block hashes |
| `blocksLimit` | integer | `15` | mode=blocks: 1–150 (~144 blocks per day) |
| `startHeight` | integer | — | mode=blocks: walk back from this height instead of the tip |
| `includeBlockTxids` / `blockTxidsLimit` | boolean / integer | `false` / `25` | mode=block: attach tx ids (1–5000) |
| `projectedBlocks` | integer | `3` | overview/fees/mempool: upcoming mempool blocks to include (1–8) |
| `recentTxLimit` | integer | `10` | mode=mempool: newest unconfirmed txs (0–50) |
| `includeReplacements` | boolean | `false` | mode=mempool: latest RBF replacements (up to 25) |
| `interval` | string | `1w` | mode=mining: `24h`, `3d`, `1w`, `1m`, `3m`, `6m`, `1y`, `2y`, `3y`, `all` |
| `poolsLimit` | integer | `20` | mode=mining: 1–100 pools |
| `lightningRanking` | string | `capacity` | mode=lightning: `capacity`, `connectivity`, `age` |
| `lightningLimit` | integer | `20` | mode=lightning: top nodes (0–100); also caps alias search results |
| `lightningQueries` | string\[] | `[]` | mode=lightning: node aliases (`ACINQ`) or 66-hex public keys |
| `currency` | string | `USD` | mode=price: `USD`, `EUR`, `GBP`, `CAD`, `CHF`, `AUD`, `JPY` |
| `dates` | string\[] | `[]` | mode=price: `YYYY-MM-DD` dates for historical prices |
| `fields` | string\[] | `[]` | Keep only these top-level fields, in this order (`kind`, `id`, `network`, `found`, `sourceUrl`, `fetchedAt` are always kept and come first unless listed). Letter case is forgiven; names the mode never outputs are ignored with a note; a list with none of the mode's fields is refused; a row with none of them is not saved (not charged) |
| `requestDelayMs` | integer | `100` | Minimum gap (0–5000 ms) between request starts; one lane per run, at most 2 requests at a time; a 429 doubles it (≥ 1 s) |

### Reference

#### Modes

| Mode | Items | What you get |
|---|---|---|
| `overview` | 1 | Fees + congestion, mempool size & fee histogram, projected blocks, difficulty epoch, hashrate, price in 7 currencies, last 10 blocks |
| `fees` | 1 | Compact fee snapshot (fastest / 30 min / 1 h / economy / minimum), next-block fees, difficulty epoch, USD price |
| `mempool` | 1 | Mempool size, fee histogram buckets, projected blocks, newest unconfirmed txs, optional RBF replacements |
| `blocks` | N | Latest (or from `startHeight`) blocks: pool, tx count, fullness, median fee, fees, reward |
| `block` | 1 per block | One block by height/hash, optional tx ids |
| `address` | 1 per address | Balance, received/spent, tx & UTXO counts, unconfirmed balance, recent txs with direction/amount/fee/counterparties, window totals |
| `tx` | 1 per txid | Status (`unconfirmed` / `confirmed` / `final` ≥ 6 conf), confirmations, fee & fee rate, inputs/outputs, RBF |
| `mining` | 1 | Pool ranking with shares, hashrate series and change, difficulty adjustments, last-144-block reward & fee share |
| `lightning` | 1 + 1 per matched node | Network stats (nodes, channels, capacity, fee rates), top nodes; node lookups (`kind: lightning_node`) |
| `price` | 1 + 1 per date | Current BTC price (all 7 currencies) and historical daily prices with exchange rates |

#### Congestion levels (`congestion`)

Derived from `fastestFee` (sat/vB); conventional thresholds, not an official metric: `low` ≤ 5, `moderate` ≤ 30, `high` ≤ 100, `extreme` > 100.

#### Networks

| Value | Explorer | Notes |
|---|---|---|
| `mainnet` | https://mempool.space | All modes |
| `testnet4` | https://mempool.space/testnet4 | No prices / Lightning |
| `testnet` | https://mempool.space/testnet | Legacy testnet3 |
| `signet` | https://mempool.space/signet | No prices / Lightning |

### Examples

**1. Is the customer's payment confirmed?**

```json
{ "mode": "tx", "txids": ["f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16"], "includeRbf": true }
```

**2. Treasury monitor: balance and movements since yesterday**

```json
{ "mode": "address", "addresses": ["bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh"], "txLimit": 100, "sinceDate": "2026-09-12", "includeMempoolTxs": true }
```

**3. Fee check before a batch payout (compact)**

```json
{ "mode": "fees", "projectedBlocks": 2, "fields": ["fastestFee", "halfHourFee", "hourFee", "economyFee", "congestion", "nextBlockMedianFee"] }
```

**4. Mining pool market share over the last month**

```json
{ "mode": "mining", "interval": "1m", "poolsLimit": 10 }
```

**5. A full day of blocks for fee research**

```json
{ "mode": "blocks", "blocksLimit": 144 }
```

**6. Historical BTC/EUR prices for accounting**

```json
{ "mode": "price", "currency": "EUR", "dates": ["2025-01-01", "2026-06-01"] }
```

### Output

`mode: "address"` (trimmed real example):

```json
{
  "network": "mainnet", "kind": "address", "id": "address:mainnet:bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
  "address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh", "found": true, "addressType": "p2wpkh",
  "balanceBtc": 3.89219867, "balanceSats": 389219867, "receivedBtc": 16.76225706, "spentBtc": 12.87005839,
  "txCount": 1134, "utxoCount": 743, "unconfirmedBalanceBtc": 0, "unconfirmedTxCount": 0,
  "isActive": true, "lastTxAt": "2026-09-12T22:18:36.000Z",
  "windowReceivedBtc": 0.20127066, "windowSentBtc": 0, "windowTxCount": 30, "windowComplete": true,
  "recentTxs": [{ "txid": "…", "confirmed": true, "blockHeight": 966700, "confirmations": 93, "time": "2026-09-12T22:18:36.000Z", "direction": "in", "amountBtc": 0.00001, "netBtc": 0.00001, "feeSats": 141, "feeRateSatVb": 1, "counterparties": ["bc1q…"], "url": "https://mempool.space/tx/…" }],
  "recentTxsPartial": false, "warnings": [],
  "sourceUrl": "https://mempool.space/address/bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh", "fetchedAt": "2026-09-13T08:13:18.578Z"
}
```

`mode: "overview"` (trimmed real example): `{ "kind": "overview", "blockHeight": 966792, "fastestFee": 2, "halfHourFee": 1, "hourFee": 1, "economyFee": 1, "congestion": "low", "mempoolTxCount": 80379, "mempoolBlocksToClear": 39.71, "hashrateEh": 949.94, "difficultyChangePct": 4.73, "estimatedRetargetAt": "2026-09-19T05:39:50.512Z", "priceUsd": 77106, "minutesSinceLastBlock": 20.6, "latestBlocks": [ … ] }`

| Field | Modes | Description |
|---|---|---|
| `kind`, `id`, `network`, `found` | all | Item type, stable id (e.g. `tx:mainnet:<txid>`), network, lookup result (`found: true` on every item — inputs that were not found or failed are not items, see Limits) |
| `fastestFee`, `halfHourFee`, `hourFee`, `economyFee`, `minimumFee`, `congestion` | overview, fees, mempool | Recommended fees in sat/vB |
| `projectedBlocks[]`, `nextBlockMedianFee`, `nextBlockMinFee` | overview, fees, mempool | Upcoming blocks built from the mempool |
| `mempoolTxCount`, `mempoolVsize`, `mempoolBlocksToClear`, `feeHistogram[]` | overview, mempool | Mempool backlog |
| `difficultyProgressPct`, `difficultyChangePct`, `nextRetargetHeight`, `estimatedRetargetAt`, `avgBlockTimeSec` | overview, fees, mining | Difficulty epoch |
| `hashrateEh`, `pools[]`, `hashrateSeries[]`, `difficultyAdjustments[]`, `last144Blocks` | overview, mining | Mining data (EH/s) |
| `balanceBtc`, `receivedBtc`, `spentBtc`, `txCount`, `utxoCount`, `lastTxAt`, `recentTxs[]`, `utxos[]` | address | Balance and flows. `lastTxAt` = the address's newest transaction (`"unconfirmed"` while in the mempool) |
| `windowReceivedBtc`, `windowSentBtc`, `windowTxCount`, `windowComplete` | address (with dates) | Totals over the confirmed transactions listed inside the dates. `windowComplete: true` = every transaction of the window is listed, so the totals are exact; `false` = `txLimit`, the ~1,000-transaction paging cap or the run's time cut the list (the row's `warnings` say which) |
| `recentTxsPartial` | address | `true` when `recentTxs` does not hold every transaction of the window (without dates: of the address) |
| `status`, `confirmations`, `feeSats`, `feeRateSatVb`, `inputs[]`, `outputs[]`, `replacedBy`, `replaces[]` | tx | Transaction status. `confirmations` is `null` (and `status` never `final`) if the chain tip could not be read |
| `height`, `hash`, `timestamp`, `pool`, `txCount`, `fullnessPct`, `medianFee`, `totalFeesBtc`, `rewardBtc`, `subsidyBtc` | blocks, block | Block data |
| `nodeCount`, `channelCount`, `totalCapacityBtc`, `topNodes[]`, `publicKey`, `alias`, `capacityBtc` | lightning | Lightning data |
| `price`, `prices`, `exchangeRates`, `isHistorical` | price | BTC price |
| `warnings[]`, `sourceUrl`, `fetchedAt` | all | Failed sub-requests or limits of this row, explorer link, fetch time |

Every field has a title, description and example in the dataset schema. Dataset views: **Overview** (all modes), **Addresses**, **Transactions**, **Blocks**, **Mining** (`mining`: hashrate, difficulty, pool shares) and **Mining pools** (one row per pool with share % and block count). The run's `SUMMARY` record (linked in the run output) lists rows delivered, inputs not found / failed with the reason, inputs not processed and notes.

### Use it from code / agents

```bash
curl -X POST "https://api.apify.com/v2/acts/yadroo~bitcoin-mempool/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"mode":"tx","txids":["f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16"]}'
```

```js
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('yadroo/bitcoin-mempool').call({ mode: 'fees' });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

```python
from apify_client import ApifyClient
client = ApifyClient(token)
run = client.actor("yadroo/bitcoin-mempool").call(run_input={"mode": "address", "addresses": ["bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh"], "sinceDate": "2026-09-01"})
items = client.dataset(run["defaultDatasetId"]).list_items().items
```

MCP: add `https://mcp.apify.com` to your MCP client (Claude, Cursor, …) and call the `yadroo/bitcoin-mempool` tool with the same JSON.

### Pricing

Pay per event: **$0.001 per run start + $0.002 per dataset item**. Store discounts on the item price: Bronze −10 %, Silver −20 %, Gold and above −30 %; the start event is the same on every plan; platform usage is included. Snapshot modes (`overview`, `fees`, `mempool`, `mining`) return one item → $0.003 per run; an hourly fee check costs about $0.07 per day. `address` and `tx` return one item per input (checking 50 payments = $0.101). `blocks` returns one item per block (a full day of 144 blocks = $0.289). Invalid inputs, unknown txids/addresses/blocks and failed lookups are not dataset items and cost nothing. Your "Maximum cost per run" is respected: the run stops before the first item it would not cover and ends with `Stopped at your spending limit: N rows delivered`.

### Limits & FAQ

- **Source & rate limits** — the public mempool.space API is rate-limited per IP (limits are not published; clients that keep exceeding them get banned). All requests of a run go through one lane: starts at least `requestDelayMs` apart, at most 2 at a time. HTTP 429/5xx are retried with backoff and `Retry-After` is respected; after a 429 the gap doubles (at least 1 s) for the rest of the run and the status says so. Address histories take one request per 25 transactions (the first page holds up to 50); a `tx` lookup takes 2 requests (1 without `includeRbf`), so 1,000 txids take several minutes.
- **Freshness** — live: fees and mempool update every few seconds, blocks as they are mined. Lightning statistics are published roughly daily (`statsDate`).
- **Big addresses** — exchange-type addresses with thousands of transactions: use `sinceDate` to stop paging early. With `untilDate`, newer transactions are skipped while paging (they do not use up `txLimit`), but at most about 1,000 confirmed transactions (40 history pages) are read per address: a window further back reports `windowComplete: false` with a warning. UTXO lists over 500 entries are refused by the API (recorded in `warnings`).
- **Blocks by date** — with a past `untilDate`, `blocks` asks mempool.space for the block mined at that time and walks back from there (a few requests, whatever the date); `untilDate` of today or later simply starts at the tip. If that lookup fails, a run with `startHeight` walks back from `startHeight` (and says so in the status); without `startHeight` the run fails with a message.
- **Run timeout** — rows are saved as they are ready. A run that nears its timeout stops starting new lookups, keeps what it saved and ends `Stopped before the run timeout: N rows saved` (inputs not reached are counted in `SUMMARY.notProcessed`; in `blocks` mode, the blocks of `blocksLimit` not reached — the same after a stop at the spending limit). Raise the timeout or split long lists.
- **Errors** — `mode`, `network`, `interval`, `lightningRanking` and `currency` are lists: the platform refuses any other value before the run starts. A missing input list, a bad date or `fields` with no field of the mode fails the run at once with a message naming the input. When mempool.space does not answer a snapshot mode at all, the run fails with a status that says so. Per-input problems never stop the run and are never charged: inputs that were not found (unknown txid, block, node alias, no price for a date) are listed in the `SUMMARY` record under `notFound`, invalid inputs and failed lookups under `errors` (with the reason), with `notFoundCount` / `errorCount` and a short status message (`3 item(s) saved · 1 not found (see SUMMARY)`). The run fails only if every input failed. Failed sub-requests of a found item are listed in its `warnings`.
- **Not financial advice** — congestion levels are heuristics; prices come from the mempool.space price index.
- **Roadmap** — xpub/descriptor balances, fee-rate alerts relative to a threshold.

***

Made by **Yadroo**. Siblings: [wallet-intel](https://apify.com/yadroo/wallet-intel) · [dexscreener-tokens](https://apify.com/yadroo/dexscreener-tokens) · [coingecko-markets](https://apify.com/yadroo/coingecko-markets) · [crypto-sentiment](https://apify.com/yadroo/crypto-sentiment) · [ens-resolver](https://apify.com/yadroo/ens-resolver)

# Actor input Schema

## `mode` (type: `string`):

`overview` = one item: fees, congestion, mempool size, next-block projections, difficulty epoch, hashrate, price, last 10 blocks. `fees` = compact fee item for payment routing / alerts. `mempool` = mempool composition + newest txs + RBF replacements. `blocks` = one item per recent block (or from `startHeight`). `block` = specific blocks by height or hash. `address` = balance, history and net flows per address. `tx` = status, confirmations, fee rate, inputs/outputs, RBF info per txid. `mining` = pool market share, hashrate, difficulty. `lightning` = network stats + top nodes (+ node search). `price` = BTC price now and on given dates.

## `network` (type: `string`):

Bitcoin network. Lightning stats and prices exist only on mainnet.

## `addresses` (type: `array`):

Bitcoin addresses: bc1q… (segwit), bc1p… (taproot), 1… (legacy), 3… (P2SH); tb1…/m…/n…/2… on test networks. Invalid or failed addresses are not saved and not charged: they are listed in the run's SUMMARY record under `errors`.

## `txLimit` (type: `integer`):

How many transactions to list per address, newest first (0 = only balances). With dates, only transactions inside the dates count toward it. Pages of 25 are read until the limit, `sinceDate` or the end of the history is reached.

## `sinceDate` (type: `string`):

Keep only transactions / blocks on or after this date (YYYY-MM-DD = from 00:00 UTC, or ISO 8601). Paging stops at the first older transaction or block, which keeps runs short. Applies to address and blocks modes.

## `untilDate` (type: `string`):

Keep only transactions / blocks on or before this date (YYYY-MM-DD = the whole day, UTC; or ISO 8601). Blocks mode starts at the block mined at that time (today or a later date: at the chain tip). Address mode skips newer transactions while paging, reading about 1,000 confirmed transactions per address at most to reach the window (`windowComplete: false` beyond that).

## `includeMempoolTxs` (type: `boolean`):

Include the address's unconfirmed (mempool) transactions in `recentTxs` (they have `confirmed:false`, `confirmations:0`).

## `includeUtxos` (type: `boolean`):

Attach the unspent outputs list (`utxos`, up to 500). mempool.space refuses addresses with more than 500 UTXOs — a warning is recorded in that case.

## `txids` (type: `array`):

64-hex transaction ids. Each yields: confirmed/unconfirmed, confirmations, `status` (unconfirmed / confirmed / final ≥ 6 conf), fee, fee rate, vsize, inputs and outputs with addresses and amounts, RBF replacement info.

## `includeRbf` (type: `boolean`):

Look up whether the transaction replaced or was replaced by another (Replace-By-Fee) → `replacedBy`, `replaces`.

## `blocks` (type: `array`):

Block heights (e.g. "900000") and/or block hashes for mode=block.

## `blocksLimit` (type: `integer`):

How many blocks to return in mode=blocks (15 per page; ~144 blocks = one day).

## `startHeight` (type: `integer`):

Walk backwards starting at this height instead of the chain tip.

## `includeBlockTxids` (type: `boolean`):

Attach the block's transaction ids (`txids`, first `blockTxidsLimit`) and the total count.

## `blockTxidsLimit` (type: `integer`):

Upper bound for `txids` in mode=block.

## `projectedBlocks` (type: `integer`):

How many upcoming mempool blocks to include in `projectedBlocks` (each with tx count, median fee, fee range) — overview, fees and mempool modes.

## `recentTxLimit` (type: `integer`):

mode=mempool: how many of the newest unconfirmed transactions to list (txid, fee rate, value).

## `includeReplacements` (type: `boolean`):

mode=mempool: include the latest fee-bump replacements seen in the mempool (`replacements`).

## `interval` (type: `string`):

Time window for pool ranking, hashrate series and difficulty-adjustment history.

## `poolsLimit` (type: `integer`):

How many mining pools to include in `pools` (ranked by blocks found in the interval).

## `lightningRanking` (type: `string`):

Which top-node list to attach to the stats item.

## `lightningLimit` (type: `integer`):

How many nodes to include in `topNodes` (0 = stats only). Also caps alias-search results per query.

## `lightningQueries` (type: `array`):

Node aliases to search (e.g. "ACINQ", "Kraken") or 66-hex node public keys for full node details. One `lightning_node` item per match.

## `currency` (type: `string`):

Fiat currency for `price`. Current prices for all seven currencies are always included in `prices`.

## `dates` (type: `array`):

Dates (YYYY-MM-DD) for historical BTC prices — one item per date (daily granularity, mempool.space price index).

## `fields` (type: `array`):

Keep only these top-level fields in each item, in this order (kind, id, network, found, sourceUrl, fetchedAt are always kept and come first unless you list them). Letter case is forgiven; names this mode never outputs are ignored with a note in the status, and a list with none of the mode's fields is refused. A row that has none of the listed fields is not saved (not charged). Empty = full item. Example: \["fastestFee","congestion","mempoolTxCount"].

## `requestDelayMs` (type: `integer`):

Minimum gap between the starts of two mempool.space requests; all requests of the run share one lane, at most 2 at a time. After an HTTP 429 the gap doubles (at least 1 s) for the rest of the run and Retry-After is respected. Raise it for long lists.

## Actor input object example

```json
{
  "mode": "overview",
  "network": "mainnet",
  "addresses": [
    "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh"
  ],
  "txLimit": 25,
  "includeMempoolTxs": true,
  "includeUtxos": false,
  "txids": [],
  "includeRbf": true,
  "blocks": [],
  "blocksLimit": 15,
  "includeBlockTxids": false,
  "blockTxidsLimit": 25,
  "projectedBlocks": 3,
  "recentTxLimit": 10,
  "includeReplacements": false,
  "interval": "1w",
  "poolsLimit": 20,
  "lightningRanking": "capacity",
  "lightningLimit": 20,
  "lightningQueries": [],
  "currency": "USD",
  "dates": [],
  "fields": [],
  "requestDelayMs": 100
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset items: one row per snapshot, block, address, transaction, Lightning node or price date.

## `summary` (type: `string`):

SUMMARY record: rows delivered, inputs not found or failed (with the reason), inputs not processed, notes and why the run stopped.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "addresses": [
        "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh"
    ],
    "txids": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("yadroo/bitcoin-mempool").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "addresses": ["bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh"],
    "txids": [],
}

# Run the Actor and wait for it to finish
run = client.actor("yadroo/bitcoin-mempool").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "addresses": [
    "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh"
  ],
  "txids": []
}' |
apify call yadroo/bitcoin-mempool --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,yadroo/bitcoin-mempool"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/bhMCnGe64PRSWPMpx/builds/1oxw3Df3FCAIcfVF3/openapi.json
