Command Palette

Search for a command to run...

UnylyUnyly
Browse all

Bitcoin Api

FreeNot checked

Bitcoin fee intelligence API — 108 endpoints, 751 non-e2e tests, self-hostable, Apache 2.0. Hosted demo paused for infrastructure review.

GitHubEmbed

About

Bitcoin fee intelligence API — 108 endpoints, 751 non-e2e tests, self-hostable, Apache 2.0. Hosted demo paused for infrastructure review.

README

Satoshi API

Satoshi API

Stop overpaying Bitcoin fees. Know when to send.

CI PyPI Downloads Python 3.10+ License Hosted demo paused OpenSats

Self-Hosting · PyPI · MCP Server · Discord Bot


Self-hostable · MCP-ready · x402-capable · Apache 2.0


Bad fee timing burns sats on every Bitcoin transaction. Satoshi API tells you when to send, what to pay, and whether to wait — combining multiple estimatesmartfee targets with real-time mempool state. Instead of just "4 sat/vB", you get "Fees are low. Good time to send." One pip install, self-hostable, open source.

[!IMPORTANT] The project-operated bitcoinsapi.com demo and x402 facilitator are intentionally paused during an infrastructure review. The open-source package remains available for self-hosting; do not rely on the hosted URLs until this notice is removed.

Install & Run

pip install satoshi-api
export BITCOIN_RPC_USER=your_user BITCOIN_RPC_PASSWORD=your_password
satoshi-api
# API:  http://localhost:9332
# Docs: http://localhost:9332/docs

Example

curl http://localhost:9332/api/v1/fees/recommended | jq
{
  "data": {
    "recommendation": "Fees are low. Good time to send.",
    "estimates": { "high": 4, "medium": 2, "low": 1 }
  },
  "meta": { "timestamp": "...", "node_height": 939462, "chain": "main" }
}

Core Endpoints

Category Example paths Highlights
Fees /api/v1/fees/recommended, /api/v1/fees/plan Recommendations, landscape ("send now or wait?"), history, mempool-blocks
Transactions /api/v1/tx/{txid}, /api/v1/broadcast Decoded analysis, status, outspends, UTXO lookup, broadcast
Mempool /api/v1/mempool, /api/v1/mempool/recent Congestion score, fee buckets, recent entries
Blocks /api/v1/blocks/latest, /api/v1/blocks/{height_or_hash} Latest block, by height/hash, stats, txids, header
Mining /api/v1/mining, /api/v1/mining/nextblock Hashrate, difficulty, next block template
Network /api/v1/network, /api/v1/network/difficulty Peers, forks, difficulty, address validation
Streams /api/v1/stream/blocks, /api/v1/stream/fees Real-time blocks & fees via SSE

...and more (prices, address lookups, exchange comparison). A self-hosted instance serves its interactive docs at /docs.

For AI Agents

bitcoin-mcp — the first Bitcoin MCP server on the official Anthropic MCP Registry — lets AI agents check fees, verify payments, and monitor addresses without human babysitting. Saves developer time: no custom Bitcoin plumbing needed.

# Install and point at your Satoshi API instance
pip install bitcoin-mcp
SATOSHI_API_URL=http://127.0.0.1:9332 bitcoin-mcp

Or connect to a local node directly:

{
  "mcpServers": {
    "bitcoin": { "command": "bitcoin-mcp" }
  }
}

For repo-native agent instructions, use docs/AGENT_INTEGRATION.md. It includes copy-paste snippets for AGENTS.md, CLAUDE.md, .github/copilot-instructions.md, Cursor/Windsurf rules, MCP config, and x402 paid calls.

When the hosted service resumes, keyless premium calls start at https://bitcoinsapi.com/x402/start. The paid flow is: discover /.well-known/x402, request a paid /api/v1 endpoint, read PAYMENT-REQUIRED, then retry with PAYMENT-SIGNATURE.

Self-Hosting

pip install satoshi-api
satoshi-api  # runs on :9332

# Expose publicly (free HTTPS + DDoS protection)
cloudflared tunnel --url http://localhost:9332

See self-hosting guide for full production setup.

Research Export

For offline fee-forecasting work, the repo now includes a local JSONL export path with documented observation features and 1-6 block clearing-fee outcomes.

$env:PYTHONPATH='src'
python scripts/export_fee_forecast_benchmark.py data/fee-forecast-benchmark.jsonl --hours 168 --interval-minutes 10

The export joins local fee_history observations to the next 1-6 confirmed blocks from the research tables in data/bitcoin_api.db. After migration 012_add_research_tables.sql, the background fee collector seeds the current tip, captures missed heights and reorg replacements in block_confirmations, and logs fee estimates every cycle, so a normal local API run can build this export without extra manual seeding. Very recent observations without six future block outcomes are skipped automatically.

Contributing

Issues and PRs welcome. Run the test suite before submitting:

pip install -e ".[dev]"
pytest

Roadmap

See docs/ROADMAP.md for the 12-month development plan — indexer expansion, multi-network support, fee prediction, SDKs, and more.

Support This Project

Satoshi API is free, open-source Bitcoin infrastructure. If you find it useful, consider supporting development through OpenSats.

Related Projects

  • bitcoin-mcp — MCP server with 49 Bitcoin tools for AI agents
  • ChainPulse — AI-powered Bitcoin network intelligence CLI
  • BAIP-1 — Bitcoin Agent Identity Protocol

License

Apache 2.0 — see LICENSE.


Self-Hosting · PyPI · MCP Server · Roadmap

Built by a Bitcoin Core contributor. Run python -m pytest --collect-only -q for the current test inventory.

from github.com/Bortlesboat/bitcoin-api

Installing Bitcoin Api

This server has no published package — it is built from source. Open the repository and follow its README.

▸ github.com/Bortlesboat/bitcoin-api

FAQ

Is Bitcoin Api MCP free?

Yes, Bitcoin Api MCP is free — one-click install via Unyly at no cost.

Does Bitcoin Api need an API key?

No, Bitcoin Api runs without API keys or environment variables.

Is Bitcoin Api hosted or self-hosted?

Self-hosted: the server runs locally on your machine via the install command above.

How do I install Bitcoin Api in Claude Desktop, Claude Code or Cursor?

Open Bitcoin Api on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.

Related MCPs

Compare Bitcoin Api with

Not sure what to pick?

Find your stack in 60 seconds

Author?

Embed badge for your README

Browse similar

All development MCPs