Node is syncing (--% complete). Fee data may be inaccurate. View status

Why Trading Bots Need Fee Intelligence

Every withdrawal, rebalance, and UTXO consolidation your bot executes has a transaction fee attached to it. Bots that time their transactions around fee conditions save 20-60% on fees. Over hundreds of transactions per month, that adds up to real money — money that goes straight to your bottom line instead of to miners.

Most trading bots use hardcoded fee rates or wallet defaults. They send at 15 sat/vB when 3 sat/vB would have confirmed within the hour. They broadcast during peak congestion when waiting 30 minutes would have cut costs in half. They leave money on the table because they have no visibility into the fee environment.

Satoshi API gives your bot the same fee awareness that experienced Bitcoin users have — except automated, real-time, and available via a single API call. One endpoint tells your bot whether to send now or wait. Another tells it exactly what the transaction will cost before it broadcasts. Your bot makes better decisions, and you keep more of your profits.

Key Endpoints for Bots

Five endpoints that cover the full bot decision loop — timing, cost estimation, mempool awareness, pricing, and real-time updates.

GET /api/v1/fees/landscape

The send-or-wait decision engine. Returns a recommendation based on current fee spread, congestion level, and mempool conditions. This is the core loop for bot transaction timing — call it before every withdrawal or rebalance.

{ "data": { "recommendation": "Fees are low. Good time to send.", "congestion": "low", "spread": 5.2, "urgency_premium_pct": 42.1, "optimal_tier": "medium", "suggested_fee_rate": 3.1, "potential_savings_percent": 46.8 } }
GET /api/v1/fees/estimate-tx

Transaction cost calculator. Pass your input and output counts to get the estimated virtual size and total fee in satoshis at current rates. Use this to calculate exact costs before broadcasting, so your bot can decide if a consolidation or withdrawal is worth executing at current fee levels.

{ "data": { "inputs": 2, "outputs": 2, "estimated_vsize": 226, "fee_estimates": { "high": { "sat_per_vb": 14.5, "total_sats": 3277 }, "medium": { "sat_per_vb": 8.2, "total_sats": 1853 }, "low": { "sat_per_vb": 3.1, "total_sats": 701 } } } }
GET /api/v1/mempool/info

Raw mempool state — transaction count, total size in bytes, memory usage, and minimum relay fee. Your bot can use this to gauge network congestion independently and build custom timing logic on top of the raw data.

{ "data": { "size": 14832, "bytes": 8291456, "usage": 52428800, "mempoolminfee": 0.00001000, "minrelaytxfee": 0.00001000 } }
GET /api/v1/prices/btc

Current BTC/USD price from multiple providers (Binance, CoinGecko, Coinbase, Kraken fallback chain). Essential for P&L calculations, position sizing, and converting fee costs from satoshis to dollar amounts for reporting.

{ "data": { "price_usd": 84250.00, "source": "binance", "timestamp": "2026-03-17T12:00:00Z" } }
WS /api/v1/ws

Real-time fee updates via WebSocket. Subscribe to fee changes without polling — your bot gets pushed new data as soon as conditions change. Eliminates the latency and overhead of repeated HTTP requests for high-frequency strategies.

{ "type": "fee_update", "data": { "high": 12.5, "medium": 6.8, "low": 2.1, "congestion": "low" } }

Bot Integration Example

Here is a minimal Python bot loop that checks fee conditions every 5 minutes and only executes withdrawals when the API recommends sending. This pattern saves 20-60% on fees compared to bots that send at fixed rates regardless of network conditions.

import requests, time

API = "https://bitcoinsapi.com/api/v1"
HEADERS = {"X-API-Key": "your-key"}

while True:
    landscape = requests.get(
        f"{API}/fees/landscape", headers=HEADERS
    ).json()["data"]

    if landscape["recommendation"] == "send":
        # Execute pending withdrawals at optimal fee
        fee_rate = landscape["suggested_fee_rate"]
        execute_withdrawal(fee_rate)
    else:
        # Wait — fees are high
        print(f"Waiting. Save {landscape['potential_savings_percent']}%")

    time.sleep(300)  # Check every 5 minutes

The bot checks /fees/landscape on each iteration. When the recommendation is "send", it executes pending withdrawals at the suggested fee rate. When fees are high, it waits and logs the potential savings. Over a month of automated withdrawals, this simple pattern compounds into significant fee savings.

For lower latency, replace the polling loop with a WebSocket connection to /api/v1/ws and react to fee changes in real time.

For AI-Powered Bots

If your trading bot uses an AI agent (Claude, GPT, or any LLM), the bitcoin-mcp package lets your agent query fees, mempool state, and price data through natural language — no manual API calls needed.

# Install the MCP server
pip install bitcoin-mcp

Once installed, your AI trading agent can have conversations like this:

User: Should I execute the pending 0.5 BTC withdrawal right now?

Agent: Let me check current fee conditions.

  Mempool has 8,200 transactions (low congestion).
  Current fee landscape: "send" recommendation.
  Suggested fee rate: 3.1 sat/vB.
  A 2-input, 2-output withdrawal would cost ~701 sats ($0.59).

  Recommendation: Execute now. Fees are near the daily low.
  Waiting would save less than 5% — not worth the delay risk.

User: Do it.

Agent: Withdrawal executed at 3.1 sat/vB. TX broadcast successfully.

The MCP server connects to Satoshi API automatically — zero configuration required. It falls back to the hosted API when no local node is available, so your agent works out of the box. See the AI agents guide for full setup details.

Rate Limits for Bots

Choose the tier that matches your bot's polling frequency and transaction volume.

Tier Requests/Day Price Best For
Anonymous 144 Free Testing and prototyping
Free 10,000 $0/mo Low-frequency bots (5-min polling)
Pro 100,000 $19/mo Production bots, multiple strategies
Enterprise Custom Contact us High-frequency trading, institutional

A bot polling every 5 minutes uses ~288 requests/day. The Free tier (10,000/day) supports bots polling every 9 seconds. Pro tier handles sub-second polling or multiple concurrent bot instances. Self-hosting removes all rate limits entirely.

Why Not Build Your Own?

You could query your Bitcoin Core node directly via RPC. But to build a production-ready fee intelligence layer for your bot, you would need to implement:

Satoshi API does all of this out of the box. Self-host it on your own node for free (unlimited requests, full privacy, zero vendor lock-in), or use the hosted version at bitcoinsapi.com and start optimizing fees in under a minute.

Frequently Asked Questions

What API do Bitcoin trading bots use for fee data?

Bitcoin trading bots typically use fee estimation APIs to time transactions optimally. Satoshi API provides a /fees/landscape endpoint that returns a send-or-wait recommendation based on current mempool conditions, congestion level, and fee spread. Bots can poll this endpoint or subscribe via WebSocket to decide when to execute withdrawals, rebalances, and consolidations at the lowest possible fee rate.

How can a trading bot minimize Bitcoin transaction fees?

A trading bot minimizes fees by checking the fee landscape before every transaction. When the API reports low congestion and a "send" recommendation, the bot executes pending transactions. When fees are high, it queues them for later. Over hundreds of transactions per month, this timing strategy saves 20-60% on total fee spend. The /fees/estimate-tx endpoint also helps by calculating exact costs for a given transaction shape before broadcasting.

What rate limits does Satoshi API have for bots?

Satoshi API offers four tiers: Anonymous (144 requests/day, no key needed), Free (10,000 requests/day), Pro (100,000 requests/day at $19/month), and Enterprise (custom limits). The Free tier supports bots polling every 9 seconds. Pro handles sub-second polling or multiple concurrent strategies. You can also self-host for unlimited requests with zero rate limits.

Can I self-host the API for my trading bot?

Yes. Satoshi API is open source and installable via pip install satoshi-api. Point it at your own Bitcoin Core node and you get unlimited requests with zero rate limits, full privacy (no third party sees your fee queries), and the lowest possible latency. Self-hosting is ideal for high-frequency trading bots and institutional setups where every millisecond and every data leak matters.

Stop overpaying on bot transactions.

Every withdrawal your bot sends at a suboptimal fee rate is money lost. Start optimizing today — the Free tier costs nothing and takes 30 seconds to set up.

Get Free API Key View Pricing