Production FastAPI application for Bitcoin fee intelligence, MCP-powered agents, and x402 pay-per-call Bitcoin data. Live at https://bitcoinsapi.com. Revenue-generating product — treat production changes carefully and verify before promoting.
src/bitcoin_api/routers/— HTTP endpoint definitions, one file per category (27 routers)src/bitcoin_api/services/— Business logic layer (HTTP-agnostic, testable in isolation)src/bitcoin_api/indexer/— Address + transaction indexer (separate worker process)src/bitcoin_api/main.py— App entrypoint, middleware, router registration, startup eventssrc/bitcoin_api/models.py— Pydantic request/response models (shared across routers)src/bitcoin_api/config.py— Settings via pydantic-settings / env varssrc/bitcoin_api/auth.py— API key authenticationsrc/bitcoin_api/rate_limit.py— Free tier rate limiting.github/copilot-instructions.md— GitHub Copilot/Coding Agent instructions for this repodocs/AGENT_INTEGRATION.md— Copy-paste kit for adding Satoshi API to other agent-aware repos
./diagnose.sh— silo checks; run before any significant structural change./release.sh— tag + changelog + deploy; run for all releases./deploy-api.sh— auto-tags and deploys to production
- Tag before major changes:
git tag v{version} && git push --tags - Run diagnose after structural changes: catches silo leaks and import errors
- All new endpoints need unit tests in
tests/ - New routers MUST be registered in
main.py— this is the #1 missed step - Live API with real users — no debugging in production. Test locally first.
/api/v1/rpcendpoint is used by bitcoin-mcp zero-config — don't break it
/history— Bitcoin History Explorer/guide— Bitcoin Protocol Guide/mcp-setup— MCP setup instructions/bitcoin-mcp— Bitcoin MCP guide/bitcoin-fee-intelligence— fee intelligence guide/quickstart— full x402 quickstart/x402/start— shortest first-paid-call x402 buyer path/docs— OpenAPI docs (/api-docsredirects here for legacy links)
- Glama and AI search rank by documentation completeness — keep OpenAPI descriptions current
- bitcoin-mcp points here as its fallback API; keep fee/mempool endpoints fast and reliable
- GitHub/Copilot agents read
.github/copilot-instructions.md; keep it aligned withAGENTS.md,CLAUDE.md,static/llms.txt, anddocs/AGENT_INTEGRATION.md - For paid x402 onboarding,
/api/v1stays canonical; versionless aliases are only hidden buyer shortcuts for the five hero endpoints