# Bitcoin Blockchain Explorer Scraper - Blocks, TXs & Addresses (`ninhothedev/bitcoin-explorer-scraper`) Actor

$1/1K 🔥 Bitcoin explorer scraper! Blocks, transactions & address balances with full inputs and outputs. No key. JSON, CSV, Excel or API in seconds. Power on-chain analytics ⚡

- **URL**: https://apify.com/ninhothedev/bitcoin-explorer-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 $1.00 / 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 Blockchain Explorer Scraper - Blocks, Transactions & Address Histories

Scrape the **Bitcoin blockchain** straight from Blockstream's public Esplora API - **no API key, no wallet, no node required**. Pull recent **blocks** from the chain tip, full **transaction** detail with every input and output, and **address** balances with recent transaction history.

Every satoshi amount is returned **twice**: once as an exact integer in satoshis and once as a BTC float. You never have to guess which unit a column is in.

### What you get

| Mode | What it returns |
| --- | --- |
| `blocks` | Recent blocks walking down from the chain tip (or from any `startHeight`): height, block hash, timestamp, tx count, size, weight, difficulty, nonce, merkle root, previous block hash, median time, version. |
| `transactions` | Full detail for any txid: fee in sats **and** BTC, fee rate in sat/vB, vsize, input and output counts, total input and output value, coinbase flag, plus the actual input and output **addresses**. |
| `addresses` | Confirmed balance (funded minus spent), funded/spent totals and TXO counts, lifetime transaction count, unconfirmed mempool balance, and the most recent transaction ids. |

Optionally append a row of live **fee estimates** in sat/vB, keyed by target confirmation blocks.

### Satoshis and BTC - both, always, clearly labelled

The Esplora API reports every `value`, `*_txo_sum` and `fee` field as an **integer number of satoshis** (1 BTC = 100,000,000 sats). Mixing those up with BTC is the single most common and most expensive bug in on-chain tooling.

This actor therefore emits both units side by side with explicit suffixes:

- `fee_sats` = `70500` and `fee_btc` = `0.000705`
- `balance_sats` = `5732254893` and `balance_btc` = `57.32254893`
- `total_input_sats` / `total_input_btc`, `total_output_sats` / `total_output_btc`, `funded_sats` / `funded_btc`, `spent_sats` / `spent_btc`

BTC values are computed with exact decimal arithmetic, so you get `57.32254893`, never `57.322548930000004`.

### How it differs from the other Bitcoin actors

This is **not** a duplicate of the other chain scrapers in this catalog - the data source and the shape of the data are different:

- **[blockchair-scraper](https://apify.com/ninhothedev/blockchair-scraper)** - multi-chain aggregate **statistics** from Blockchair (network-level dashboards across many blockchains).
- **[mempool-space-scraper](https://apify.com/ninhothedev/mempool-space-scraper)** - **mempool.space**, focused on the *unconfirmed* mempool, fee market and congestion.
- **This actor** - **Blockstream Esplora**, focused on the *confirmed* chain: individual blocks, individual transactions with their complete `vin`/`vout` structure, and **address histories** with per-address balances. If you need to know who paid whom, in which transaction, in which block, this is the one.

Run all three together for a complete picture: network stats, live fee pressure, and settled on-chain detail.

### Use cases

- **On-chain analytics** - build block-by-block datasets, fee-rate time series and transaction-volume metrics without running a full node.
- **Wallet monitoring** - watch a set of addresses for balance changes, incoming deposits and pending mempool activity.
- **Compliance & forensics** - trace funds by walking input and output addresses across transactions for AML, audit or investigation work.
- **Block explorers** - power your own explorer UI, dashboard or Telegram/Slack bot with clean, normalised JSON.

### Input

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `mode` | select | `blocks` | `blocks`, `transactions` or `addresses`. |
| `startHeight` | integer | chain tip | `blocks` mode only - height to start from, walking downwards. |
| `txids` | array | `[]` | `transactions` mode only - list of txids. |
| `addresses` | array | genesis address | `addresses` mode only - list of Bitcoin addresses (legacy, P2SH, bech32, taproot). |
| `includeFeeEstimates` | boolean | `false` | Append one row with current sat/vB fee estimates. |
| `maxItems` | integer | `100` | Hard cap on rows per run (max 2000). |

#### Example: last 50 blocks

```json
{ "mode": "blocks", "maxItems": 50, "includeFeeEstimates": true }
```

#### Example: Satoshi's genesis address

```json
{ "mode": "addresses", "addresses": ["1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"] }
```

### Output samples

**Block**

```json
{
  "type": "block",
  "height": 960004,
  "block_hash": "000000000000000000017aedb62d18a964ee5bc8b94fb87efca6df9d6f99431a",
  "timestamp": "2026-07-28T17:48:57Z",
  "tx_count": 4469,
  "size_bytes": 1596085,
  "weight": 3992818,
  "difficulty": 126231507121868.19,
  "merkle_root": "7c391ac9792638d3596d033b24e5c15d9f2d339a77dbdc770cb1b8caf2a8057a",
  "previous_block_hash": "0000000000000000000083e9eb459b89b6070a6d28dd719547602ce594c9d8a5",
  "source": "blockstream"
}
```

**Transaction**

```json
{
  "type": "transaction",
  "txid": "f0dc7628940a5a9e9c8b7e8e11fd0cc5c0e7e36230d92e74aa00bda4f0141f34",
  "block_height": 960004,
  "is_confirmed": true,
  "vsize": 141,
  "fee_sats": 70500,
  "fee_btc": 0.000705,
  "fee_rate_sat_vb": 501.78,
  "input_count": 1,
  "output_count": 2,
  "total_input_sats": 60399490,
  "total_output_sats": 60328990,
  "total_output_btc": 0.6032899,
  "is_coinbase": false,
  "input_addresses": ["bc1qy9cy3q0lrky4zq7u40d402twv5r65gsl28ljq2"],
  "output_addresses": ["bc1q0qs5guxk6s5zgv7dpu4y03dey252gjae248ugs", "bc1qy9cy3q0lrky4zq7u40d402twv5r65gsl28ljq2"]
}
```

**Address**

```json
{
  "type": "address",
  "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
  "tx_count": 64262,
  "funded_sats": 5732254893,
  "spent_sats": 0,
  "balance_sats": 5732254893,
  "balance_btc": 57.32254893,
  "mempool_tx_count": 0,
  "recent_txids": ["..."]
}
```

### Notes on the data

- **Coinbase transactions** have no spendable inputs, so `total_input_sats` is deliberately `null` rather than a misleading `0`. Use `is_coinbase` to detect them.
- `vsize` is `weight / 4` rounded, and `fee_rate_sat_vb` is computed from the exact `weight / 4` value.
- Address `recent_txids` returns the newest 25 transaction ids; `input_addresses` and `output_addresses` are capped at 20 each so a whale transaction cannot bloat a row.
- Timestamps are ISO-8601 UTC; the raw Unix seconds are kept in `timestamp_unix` for blocks.
- Requests are paced at ~0.3s. Blockstream's public API needs no key and imposes no hard rate limit at this pace.

### Pricing

Roughly **$1 per 1,000 items** on Apify's pay-per-result model. A 100-block run costs about 10 cents. No Blockstream account, no API key, no proxy required.

### Related actors

- [Blockchair Scraper](https://apify.com/ninhothedev/blockchair-scraper) - multi-chain blockchain statistics
- [Mempool.space Scraper](https://apify.com/ninhothedev/mempool-space-scraper) - mempool, fees and congestion
- [Binance Futures Scraper](https://apify.com/ninhothedev/binance-futures-scraper) - perpetual futures market data
- [DefiLlama Scraper](https://apify.com/ninhothedev/defillama-scraper) - DeFi TVL and protocol data

### Disclaimer

Data comes from Blockstream's public Esplora API. The Bitcoin blockchain is public data. This actor is not affiliated with Blockstream. Nothing here is financial advice.

# Actor input Schema

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

What to scrape. 'blocks' walks recent blocks down from the chain tip (or from startHeight), 'transactions' fetches full detail for the txids you list, 'addresses' fetches balances and recent transaction ids for the addresses you list.

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

Only used in 'blocks' mode. The block height to start from, walking downwards (newest first). Leave empty to start at the current chain tip.

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

Only used in 'transactions' mode. A list of 64-character Bitcoin transaction ids (txids) to fetch in full, including every input, output and the fee.

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

Only used in 'addresses' mode. A list of Bitcoin addresses (legacy, P2SH, bech32 or taproot) to look up. The default is Satoshi's genesis-block address.

## `includeFeeEstimates` (type: `boolean`):

Append one extra row with the current mempool fee estimates in sat/vB, keyed by the number of target confirmation blocks (1, 2, 3, 6, 144, ...).

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

Hard cap on how many rows this run may produce (blocks, transactions or addresses depending on the mode). Keeps runs cheap and predictable.

## Actor input object example

```json
{
  "mode": "blocks",
  "txids": [],
  "addresses": [
    "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
  ],
  "includeFeeEstimates": false,
  "maxItems": 100
}
```

# 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 = {
    "txids": [],
    "addresses": [
        "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ninhothedev/bitcoin-explorer-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 = {
    "txids": [],
    "addresses": ["1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"],
}

# Run the Actor and wait for it to finish
run = client.actor("ninhothedev/bitcoin-explorer-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 '{
  "txids": [],
  "addresses": [
    "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
  ]
}' |
apify call ninhothedev/bitcoin-explorer-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

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