REST API for your Bitcoin node

One pip install. Analyzed data, not raw RPC dumps. Open source, self-hosted, zero vendor lock-in.

$ pip install satoshi-api
$ bitcoin-api
INFO  Satoshi API running at http://localhost:9332
INFO  Interactive docs at http://localhost:9332/docs

$ curl https://bitcoinsapi.com/api/v1/fees/recommended | jq .data
Live from bitcoinsapi.com — click to try it
Loading live fee data...
Built by a Bitcoin Core contributor 19 endpoints < 50ms response time Open source (MIT) 99.9% uptime monitored by UptimeRobot

What is Satoshi API?

A thin REST layer between your Bitcoin Core node and your applications.

Bitcoin Core's JSON-RPC is powerful but awkward. Raw responses, no caching, no rate limiting, no input validation. Satoshi API wraps it in a clean REST interface with typed responses, smart caching, and analyzed data. Instead of calling estimatesmartfee five times and doing math, you get a single endpoint with human-readable recommendations in sat/vB.

It's part of a three-layer stack for Bitcoin developers:

bitcoin-mcp
AI agent interface (Claude, GPT)
Satoshi API
REST API (this project)
bitcoinlib-rpc
Typed Python RPC client
Bitcoin Core
Your full node

Why not just use RPC directly?

Everything Bitcoin Core is missing as an API server.

Analyzed Data

Fee recommendations in sat/vB. Mempool congestion scores. Block weight utilization percentages. Not raw hex and BTC/kVB.

Smart Caching

Reorg-aware TTL caching. Deep blocks cached 1 hour. Tip blocks cached 30 seconds. Fees refresh every 10 seconds. Zero stale data risk.

Rate Limiting

Four tiers with sliding-window per-minute and daily limits. Expose your API safely without worrying about abuse.

API Key Auth

Optional API keys via X-API-Key header. SHA256 hashed storage. Tiered access control. Anonymous read access for public use.

Input Validation

Txids validated as 64-hex before hitting RPC. Block heights checked for bounds. RPC errors mapped to proper HTTP status codes (404, 400, 502).

Standard Envelope

Every response: { data, meta }. Every error: { error: { status, title, detail } }. Request IDs on everything. No guessing.

AI-Agent Ready

Pair with bitcoin-mcp to give Claude or GPT direct access to your node via MCP tool calls.

Self-Hosted

Your node, your data, your API. No third party sees your queries. No vendor lock-in. No surprise pricing changes. MIT licensed.

Production Ready

59 tests. Docker support. Cloudflare Tunnel deployment. Structured access logging. Graceful shutdown. Tested under load.

Who is this for?

Anyone who runs a Bitcoin node and wants to build on top of it.

Node Operators

You run a node already. You want to check fees, monitor the mempool, or build a dashboard. pip install, point at your node, done.

curl localhost:9332/api/v1/mempool
# Congestion level, fee buckets,
# next-block minimum fee

Wallet & App Developers

Building a wallet, payment processor, or Bitcoin app? Get fee estimates, broadcast transactions, look up UTXOs. All validated and typed.

curl -X POST /api/v1/broadcast \
  -H "X-API-Key: sk_..." \
  -d '{"hex": "0200000001..."}'
# Returns txid on success

AI Agent Builders

Give your AI assistant real-time Bitcoin data. "What are current fees?" "Analyze the latest block." Your node answers directly via MCP.

# claude desktop config
"bitcoin": {
  "command": "bitcoin-mcp",
  "args": ["--api-url",
    "http://localhost:9332"]
}

Data & Analytics

Pull block stats, mining data, and fee trends into your analytics pipeline. JSON responses, consistent format, easy to ingest.

curl localhost:9332/api/v1/mining
# Difficulty, hashrate, next
# retarget height, blocks until

Privacy-Focused Users

Third-party APIs correlate your address lookups with your IP. Self-hosted = zero data leakage. Query your own node, keep your privacy.

Educators & Researchers

Teaching Bitcoin internals? The interactive docs at /docs let students explore blocks, transactions, and the mempool with live data.

19 Endpoints

Blocks, transactions, fees, mempool, mining, network, status.

MethodEndpointDescription
GET/healthNode reachability check
GET/statusFull node status (sync, peers, disk)
GET/blocks/latestLatest block analysis
GET/blocks/{height_or_hash}Block by height or hash
GET/blocks/{height}/statsDetailed block statistics
GET/tx/{txid}Transaction analysis (fees, SegWit, Taproot)
GET/tx/{txid}/rawRaw decoded transaction
GET/utxo/{txid}/{vout}UTXO lookup (spent/unspent)
POST/decodeDecode raw transaction hex
POST/broadcastBroadcast signed transaction
GET/feesFee estimates (all targets)
GET/fees/recommendedHuman-readable fee recommendation
GET/fees/{target}Fee for specific confirmation target
GET/mempoolMempool analysis (congestion, fee buckets)
GET/mempool/infoRaw mempool info
GET/mempool/tx/{txid}Single mempool entry
GET/miningMining stats (difficulty, hashrate, retarget)
GET/mining/nextblockNext block template analysis
GET/networkNetwork info (connections, relay fee)
GET/network/forksChain tips and fork detection

All endpoints prefixed with /api/v1. Interactive docs at /docs (Swagger UI) and /redoc.

Quick Start

Three lines from node to API.

Option 1: pip install

# Install
pip install satoshi-api

# Configure (point at your node)
export BITCOIN_RPC_USER=your_user
export BITCOIN_RPC_PASSWORD=your_password

# Run
satoshi-api
# API at http://localhost:9332
# Docs at http://localhost:9332/docs

Option 2: Docker

# Create env file
echo "BITCOIN_RPC_USER=your_user" > .env
echo "BITCOIN_RPC_PASSWORD=your_password" >> .env

# Run
docker compose up -d

Option 3: Create API Keys (optional)

# Generate a key for your app
python scripts/create_api_key.py --tier pro --label "my-wallet"
# Key: sk_abc123... (save this, it won't be shown again)

# Use it
curl -H "X-API-Key: sk_abc123..." localhost:9332/api/v1/mempool

Prerequisites

Pricing

Self-host for free, or use our hosted API at bitcoinsapi.com.

Hosted — Free

$0/mo
  • No node required — use ours
  • 1,000 requests/day
  • 30 requests/min
  • All GET endpoints
  • No API key needed
Try it Now

Hosted — Builder

$9/mo
  • 10,000 requests/day
  • 100 requests/min
  • POST access (decode, broadcast)
  • API key + email support
Coming Soon

Hosted — Pro

$29/mo
  • 100,000 requests/day
  • 500 requests/min
  • Priority support
  • Usage dashboard
Coming Soon

Enterprise needs? Get in touch for custom limits, SLAs, and dedicated instances.

How it compares

You have options. Here's why Satoshi API exists.

FeatureSatoshi APIRaw RPCHosted APIs
Setup time3 linesAlready thereSign up + API key
Self-hostedYesYesNo
PrivacyYour node, your dataYour nodeThey see your queries
Analyzed dataFee recs, congestion, analysisRaw values onlyVaries
CachingReorg-aware TTLNoneVaries
Rate limitingBuilt-in, tieredNoneYes (their limits)
Input validationBefore RPC callNoneYes
Cost at scale$0 (self-host)$0$50-500+/mo
AI agent supportMCP readyNoNo
Vendor lock-inNone (MIT)NoneYes

Your node already has the data. Give it a voice.

pip install satoshi-api and start building.