https://github.com/Bortlesboat/bitcoin-api
Bitcoin fee intelligence API — stop overpaying fees. 108 endpoints, 725 tests, self-hostable, Apache 2.0. Live at bitcoinsapi.com.
https://github.com/Bortlesboat/bitcoin-api
ai ai-agents bitcoin bitcoin-api bitcoin-core bitcoin-node cryptocurrency docker fastapi fee-estimation llm mcp mcp-server mempool model-context-protocol python rest-api rpc self-hosted
Last synced: 12 days ago
JSON representation
Bitcoin fee intelligence API — stop overpaying fees. 108 endpoints, 725 tests, self-hostable, Apache 2.0. Live at bitcoinsapi.com.
- Host: GitHub
- URL: https://github.com/Bortlesboat/bitcoin-api
- Owner: Bortlesboat
- License: apache-2.0
- Created: 2026-03-05T17:58:40.000Z (about 2 months ago)
- Default Branch: master
- Last Pushed: 2026-04-01T20:37:47.000Z (24 days ago)
- Last Synced: 2026-04-04T13:49:23.114Z (21 days ago)
- Topics: ai, ai-agents, bitcoin, bitcoin-api, bitcoin-core, bitcoin-node, cryptocurrency, docker, fastapi, fee-estimation, llm, mcp, mcp-server, mempool, model-context-protocol, python, rest-api, rpc, self-hosted
- Language: Python
- Homepage: https://bitcoinsapi.com
- Size: 2.92 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
- Roadmap: docs/ROADMAP.md
- Notice: NOTICE
- Agents: AGENTS.md
Awesome Lists containing this project
- awesome-ai-in-finance - Satoshi API - Bitcoin fee intelligence API with 108 endpoints for fee estimates, mempool analysis, block data, and mining stats. Self-hostable, Apache 2.0. (Data Sources / Arbitrage)
README

# Satoshi API
**Stop overpaying Bitcoin fees. Know when to send.**
[](https://github.com/Bortlesboat/bitcoin-api/actions/workflows/ci.yml)
[](https://pypi.org/project/satoshi-api/)
[](https://pypi.org/project/satoshi-api/)
[](https://www.python.org/downloads/)
[](LICENSE)
[](https://bitcoinsapi.com)
[](https://opensats.org)
[Live Playground](https://bitcoinsapi.com/docs) · [Landing Page](https://bitcoinsapi.com) · [PyPI](https://pypi.org/project/satoshi-api/) · [MCP Server](https://github.com/Bortlesboat/bitcoin-mcp) · [Discord Bot](https://github.com/Bortlesboat/satoshi-discord-bot)
---
**725 tests** · **~115 endpoints** · **28 routers** · **Live at [bitcoinsapi.com](https://bitcoinsapi.com)** · **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.
## Install & Run
```bash
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
```bash
curl http://localhost:9332/api/v1/fees/recommended | jq
```
```json
{
"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 | Endpoints | Highlights |
|----------|-----------|------------|
| **Blocks** | 8 | Latest block, by height/hash, stats, txids, header |
| **Transactions** | 7 | Decoded analysis, status, outspends, UTXO lookup, broadcast |
| **Fees** | 7 | Recommendations, landscape ("send now or wait?"), history, mempool-blocks |
| **Mempool** | 5 | Congestion score, fee buckets, recent entries |
| **Mining** | 2 | Hashrate, difficulty, next block template |
| **Network** | 4 | Peers, forks, difficulty, address validation |
| **Streams** | 2 | Real-time blocks & fees via SSE |
...and more (prices, address lookups, exchange comparison). [Full interactive docs at `/docs`](https://bitcoinsapi.com/docs).
## For AI Agents
**[bitcoin-mcp](https://github.com/Bortlesboat/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.
```bash
# Install and point at your Satoshi API instance
pip install bitcoin-mcp
SATOSHI_API_URL=https://bitcoinsapi.com bitcoin-mcp
```
Or connect to a local node directly:
```json
{
"mcpServers": {
"bitcoin": { "command": "bitcoin-mcp" }
}
}
```
## Self-Hosting
```bash
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](docs/self-hosting.md) for full production setup.
## Contributing
Issues and PRs welcome. Run the test suite before submitting:
```bash
pip install -e ".[dev]"
pytest
```
## Roadmap
See [docs/ROADMAP.md](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](https://opensats.org).
## Related Projects
- [bitcoin-mcp](https://github.com/Bortlesboat/bitcoin-mcp) — MCP server with 49 Bitcoin tools for AI agents
- [ChainPulse](https://github.com/Bortlesboat/chainpulse) — AI-powered Bitcoin network intelligence CLI
- [BAIP-1](https://github.com/Bortlesboat/baip-python) — Bitcoin Agent Identity Protocol
## License
Apache 2.0 — see [LICENSE](LICENSE).
---
**[Live API](https://bitcoinsapi.com/docs)** · **[Website](https://bitcoinsapi.com)** · **[PyPI](https://pypi.org/project/satoshi-api/)** · **[MCP Server](https://github.com/Bortlesboat/bitcoin-mcp)** · **[Roadmap](docs/ROADMAP.md)**
Built by a [Bitcoin Core contributor](https://github.com/Bortlesboat). **902 tests** across the ecosystem.