# Bitcoin Network Data: Fees, Hashrate, Mining Pools and Blocks (`scrapemint/bitcoin-network-data`) Actor

Keyless Bitcoin network state as clean rows: recommended fee rates and what a typical transaction costs, mempool backlog, the countdown to the next difficulty adjustment, network hashrate, mining pool share of blocks, and recent blocks with fees, reward and miner.

- **URL**: https://apify.com/scrapemint/bitcoin-network-data.md
- **Developed by:** [Ken M](https://apify.com/scrapemint) (community)
- **Categories:** Business, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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 Network Data: Fees, Hashrate, Mining Pools and Blocks

The operational state of the Bitcoin network as clean rows. **What a transaction has to pay to confirm**, how backed up the mempool is, how much hashing power is pointed at the chain, **when difficulty next adjusts**, who is actually mining the blocks, and what each recent block earned.

No API key, no login, no browser.

### Modes

- **Network** - one row per metric group: recommended fee rates and what a typical transaction costs, mempool backlog in transactions and in blocks, the difficulty countdown with the estimated change, current hashrate, and what the last 144 blocks paid miners.
- **Pools** - one row per mining pool over a window: blocks found, share of the network, estimated hashrate, empty blocks.
- **Blocks** - one row per recent block: miner, transaction count, fees collected, reward, subsidy, median fee rate.
- **Hashrate** - a daily hashrate series with **the difficulty actually in force on each day** resolved against it.

### Example output

```json
{
  "mode": "network",
  "metricGroup": "difficulty",
  "progressThroughEpochPercent": 24.554,
  "remainingBlocks": 1521,
  "nextRetargetHeight": 961632,
  "estimatedRetargetDate": "2026-08-09T14:41:16.001Z",
  "estimatedDaysToRetarget": 11.05,
  "estimatedDifficultyChangePercent": -4.251,
  "previousRetargetChangePercent": -0.738,
  "averageBlockTimeMinutes": 10.49,
  "miningFasterThanTarget": false
}
```

### Who this is for

- **Wallets, exchanges and payment processors** deciding what fee to attach to a withdrawal. Getting it wrong costs either cash or stuck transactions.
- **Miners and mining analysts** watching hashrate, the difficulty countdown and the fee share of block rewards.
- **Traders and researchers** tracking congestion, pool concentration and what proportion of miner income now comes from fees rather than the subsidy.

### Things worth knowing

- **An unrecognised window silently returns all time figures.** Ask the source for pool stats over "99z" and it does not error, it answers with every block since 2009. This actor refuses anything outside the valid list, falls back to a sensible window and tells you in a free note row, so "last week" never quietly becomes "since inception".
- **The two time formats.** Block timestamps and retarget history are in seconds, while the difficulty estimate, its remaining time and the average block time are in milliseconds. Reading one as the other puts the next retarget in 1970. Every field here is converted explicitly.
- **Hashrate is published in hashes per second**, a number around 8.7e20. Every figure in the output is exahashes per second. The fallback source reports **gigahashes** per second, a factor of a billion away, and is converted before use rather than passed through.
- **The hashrate and difficulty series are not parallel arrays.** Hashrate is daily; difficulty only changes every 2016 blocks, roughly fortnightly, and uses a different key name for its timestamp. Zipping them by index attaches an unrelated difficulty to each day. Each day here resolves the last adjustment at or before it, so a day whose retarget happened at 22:51 that evening correctly still shows the previous difficulty.
- **"Unknown" is not a mining pool.** It is every block whose coinbase could not be attributed, and it is flagged `isUnattributed` so it does not sit in a pool ranking pretending to be a competitor.
- **Amounts arrive in satoshis**, sometimes as strings. Everything in the output is BTC.
- **mempool.space is a community run project**, not a commercial feed, so its availability guarantee is weaker. Hashrate and difficulty fall back to blockchain.info when it is unreachable, and the row says `fallbackUsed: true` when that happens. The other metric groups return a free note rather than a gap.
- Fee data earns its keep when the network is busy. On a quiet day every tier reads 1 satoshi per virtual byte and the row says `feesAreAtFloor: true`. This is built to be scheduled, not sampled once.

### Pricing

**$0.004 per row.** The first 2 rows of every run are free, and note rows (an invalid window, a metric group the source did not return) are never charged.

A full network snapshot is 5 rows, or **$0.02**. A week of mining pool share is around 20 rows. Three months of daily hashrate history is about 90 rows, or **$0.36**.

### Related actors

- **Crypto Order Book Depth** - liquidity and slippage across exchanges.
- **Crypto Market Data Scraper** - prices across venues.
- **Crypto New Coin Listings Tracker** - listing events.

### How to run it via API

```bash
curl -X POST "https://api.apify.com/v2/acts/scrapemint~bitcoin-network-data/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode":"network"}'
```

Data from mempool.space, with blockchain.info as a fallback for core numbers.

# Actor input Schema

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

network = current fees, mempool backlog, difficulty countdown, hashrate and recent block rewards. pools = who is mining the blocks. blocks = recent blocks with fees and miner. hashrate = a daily hashrate series with the difficulty in force.

## `timespan` (type: `string`):

Pools and hashrate modes. Pools accept 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y. Hashrate accepts the same except 24h. An unrecognised window is refused here, because the source answers one with all time figures instead of an error.

## `blockCount` (type: `integer`):

Blocks mode. How many recent blocks to return, newest first. Served 15 at a time.

## `maxRows` (type: `integer`):

Cap on rows returned. Controls total cost.

## Actor input object example

```json
{
  "mode": "network",
  "timespan": "1w",
  "blockCount": 15,
  "maxRows": 200
}
```

# 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 = {
    "timespan": "1w"
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapemint/bitcoin-network-data").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 = { "timespan": "1w" }

# Run the Actor and wait for it to finish
run = client.actor("scrapemint/bitcoin-network-data").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 '{
  "timespan": "1w"
}' |
apify call scrapemint/bitcoin-network-data --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=scrapemint/bitcoin-network-data",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/xkZdp3CmDYxQ5nlmO/builds/3h1B21fXCUAjz0CHW/openapi.json
