# Bitcoin Mempool Scraper (mempool.space) (`ninhothedev/mempool-space-scraper`) Actor

$0.5/1K 🔥 Bitcoin mempool scraper! Live sat/vB fee estimates, mempool size, recent blocks & BTC price. No key. JSON, CSV, Excel or API in seconds. Time transactions & build wallet apps ⚡

- **URL**: https://apify.com/ninhothedev/mempool-space-scraper.md
- **Developed by:** [ninhothedev](https://apify.com/ninhothedev) (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 $0.99 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Bitcoin Mempool Scraper (mempool.space)

**Live Bitcoin fee estimates, mempool congestion, BTC price and recent blocks — no API key, no login, no proxy.**

This Actor pulls real-time on-chain data from the public [mempool.space](https://mempool.space) API and turns it into clean, flat rows you can export as JSON, CSV, Excel or feed straight into your app via the Apify API. It is the fastest way to answer the two questions every Bitcoin builder has: *"What fee should I pay right now?"* and *"What just happened on-chain?"*

***

### What you get

#### Mode `fees` — one summary row

A single, wide row with everything you need to price a transaction:

| Field | Meaning |
| --- | --- |
| `fastest_fee` | sat/vB for next-block confirmation |
| `half_hour_fee` | sat/vB for ~30 min confirmation |
| `hour_fee` | sat/vB for ~1 h confirmation |
| `economy_fee` | sat/vB low-priority rate |
| `minimum_fee` | current mempool minimum relay fee |
| `mempool_tx_count` | unconfirmed transactions waiting |
| `mempool_vsize` | total mempool virtual size (vB) |
| `mempool_total_fee` | total fees sitting in the mempool (sats) |
| `price_usd` / `price_eur` | BTC spot price |
| `difficulty_progress_pct` | progress through the current retarget period |
| `difficulty_change_pct` | projected difficulty change |
| `remaining_blocks` | blocks left until the next retarget |
| `source`, `scraped_at` | provenance + ISO-8601 UTC timestamp |

#### Mode `blocks` — one row per block

| Field | Meaning |
| --- | --- |
| `height` | block height |
| `block_id` | block hash |
| `timestamp` | mined-at, normalised to ISO-8601 UTC |
| `tx_count` | transactions in the block |
| `size` / `weight` | raw size (bytes) and weight units |
| `median_fee` | median fee rate in the block (sat/vB) |
| `reward` | total block reward incl. fees (sats) |
| `pool` | mining pool name (F2Pool, Foundry USA, AntPool, …) |

***

### Input

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `mode` | select (`fees` | `blocks`) | `fees` | What to scrape |
| `maxItems` | integer (1–500) | `50` | Max rows; only relevant in `blocks` mode |

```json
{
  "mode": "blocks",
  "maxItems": 100
}
```

### Sample output

```json
{
  "type": "summary",
  "fastest_fee": 2,
  "half_hour_fee": 1,
  "hour_fee": 1,
  "economy_fee": 1,
  "minimum_fee": 1,
  "mempool_tx_count": 89311,
  "mempool_vsize": 43669432,
  "mempool_total_fee": 10174874,
  "price_usd": 63138,
  "price_eur": 55506,
  "difficulty_progress_pct": 14.43,
  "difficulty_change_pct": -4.58,
  "remaining_blocks": 1725,
  "source": "mempool.space",
  "scraped_at": "2026-07-28T01:45:07+00:00"
}
```

```json
{
  "type": "block",
  "height": 959907,
  "block_id": "000000000000000000022c1b91e29e784e85d7942b424ae0dcd246b36cf19600",
  "timestamp": "2026-07-28T01:39:51+00:00",
  "tx_count": 3676,
  "size": 1707989,
  "weight": 3997688,
  "median_fee": 2.0033,
  "reward": 314445022,
  "pool": "F2Pool",
  "source": "mempool.space",
  "scraped_at": "2026-07-28T01:45:07+00:00"
}
```

***

### Use cases

- **BTC fee estimation** — stop guessing sat/vB. Schedule the Actor every few minutes and always quote a fee that actually confirms.
- **Wallet apps** — power a "Slow / Normal / Fast" fee selector with live network data instead of a hard-coded table.
- **On-chain analytics** — track mempool backlog, block fullness, mining-pool market share and difficulty drift over time.
- **Trading bots** — combine BTC spot price with mempool congestion as a market-stress signal, or time on-chain settlement for cheap fee windows.

Other things people build with it: fee-alert Telegram bots, exchange withdrawal-fee calculators, mining-pool dashboards, Bitcoin ETF/treasury reporting, and academic congestion research.

***

### Why this Actor

- **No API key, ever.** mempool.space's public API is open. Nothing to sign up for, nothing to rotate, nothing to leak.
- **No proxy required.** Runs on the free Apify datacenter tier — keeps your cost at the compute floor.
- **Two modes, one clean schema.** Flat rows with `snake_case` fields — no nested `extras` object to unwrap.
- **Fully null-tolerant.** If a single upstream endpoint hiccups, the Actor logs a warning and still returns everything else instead of failing the run.
- **Real ISO-8601 timestamps.** UNIX seconds and milliseconds are both normalised to UTC ISO strings, so spreadsheets and BI tools just work.
- **Fast.** All four `fees`-mode endpoints are fetched concurrently; a run finishes in a couple of seconds.

### Pricing

Roughly **$0.50 per 1,000 results**. A `fees` run produces exactly one row, so continuous fee monitoring costs fractions of a cent per check. A 500-block history pull is well under a cent.

### Scheduling tips

- `mode: fees` every 5–10 minutes → a rolling fee + price + congestion time series.
- `mode: blocks`, `maxItems: 20` every hour → a complete block/mining-pool log with natural de-duplication on `height`.

### How it works

The Actor calls the documented public endpoints `/v1/fees/recommended`, `/mempool`, `/v1/prices`, `/v1/difficulty-adjustment` and `/v1/blocks`. Only public, non-personal blockchain data is collected — no accounts, no wallets, no personal information. Block history is paginated backwards from the chain tip with a polite delay between pages.

### Related Actors by the same author

- [Blockchain Info Scraper](https://apify.com/ninhothedev/blockchain-info-scraper) — addresses, transactions and wallet balances
- [CoinGecko Crypto Scraper](https://apify.com/ninhothedev/coingecko-crypto-scraper) — market caps, prices and rankings for thousands of coins
- [DexScreener Scraper](https://apify.com/ninhothedev/dexscreener-scraper) — DEX pairs, liquidity and on-chain token prices
- [OKX Scraper](https://apify.com/ninhothedev/okx-scraper) — centralised exchange tickers and order-book data

***

*Keywords: bitcoin fee estimator API, mempool.space scraper, BTC transaction fee sat/vB, bitcoin mempool size API, bitcoin block explorer data, mining pool statistics, bitcoin difficulty adjustment, on-chain analytics, crypto data API without key.*

# Actor input Schema

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

What to scrape. "fees" returns a single summary row with recommended fee estimates (sat/vB), mempool backlog, BTC price and difficulty-adjustment progress. "blocks" returns one row per recently mined block including height, mining pool, reward and median fee.

## `maxItems` (type: `integer`):

Maximum number of dataset rows to produce. Only relevant for the "blocks" mode (the "fees" mode always yields exactly one summary row). Values above 500 are capped at 500.

## Actor input object example

```json
{
  "mode": "fees",
  "maxItems": 50
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("ninhothedev/mempool-space-scraper").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 = {}

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

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

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

```

## CLI example

```bash
echo '{}' |
apify call ninhothedev/mempool-space-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=ninhothedev/mempool-space-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/tblvQwn1z2QM5etxW/builds/F6AAbjgRLtgukgmXw/openapi.json
