Query the chain · Broadcast API
Bitcoin broadcast transaction API to push raw transactions
A Bitcoin broadcast transaction API takes a transaction you already signed, relays the raw hex to the network, and returns its txid. POST /v1/tx/broadcast does that in one call and never sees a private key.
REST API · SQL · dashboards · address history from genesis
BTC
Balance trail
informational on-chain data · not financial advice
The request body is {"hex": "<signed raw transaction>"}. An accepted transaction comes back as HTTP 201 with the txid, the status "in mempool" and a link to GET /v1/tx/{txid}, so the next call your code makes is the confirmation check. A transaction the network turns down comes back as HTTP 422 with the code rejected_by_network and a field called network_said that carries the node's own reason, word for word. A relay that cannot be reached comes back as HTTP 503 with index_unavailable. Those three outcomes are kept apart on purpose, because the most expensive broadcast bug is treating one of them as another.
Here is why that matters, measured on 25 September 2026. We took a transaction that had already confirmed, 311ca5e1759b6a2a9d512210729b63445d784962b3f4d3825d03a0d8ff6ee920 in block 968,537, and posted its raw hex again to three public broadcast endpoints with the chain tip at 968,542. mempool.space and Blockstream Esplora both answered HTTP 400 with Bitcoin Core's RPC error -27, "Transaction outputs already in utxo set". BlockCypher answered HTTP 400 with "Transaction with hash ... already exists". Then we posted 80 bytes of zeros, which is not a transaction at all. mempool.space and Esplora answered HTTP 400 with RPC error -22, "TX decode failed". BlockCypher answered HTTP 400 with "insufficient priority and fee for relay", which describes a fee problem the payload does not have.
So on all three services, a payment that already succeeded and a payload that was never a transaction return the same status code. Retry logic that reads only the status sees "failed" in both cases. The dangerous version rebuilds the payment with fresh inputs and sends it again, and a customer is paid twice. The safe rule is short: on any rejection, look up the txid you computed before broadcasting. If it is already in a block or in the mempool, the payment went through and the rejection is noise. If it is not, read the node's reason and fix that.
This API gives you both halves in one place. The broadcast answer carries the node's reason verbatim, and GET /v1/tx/{txid} on the same key tells you whether the transaction is in the mempool or which block confirmed it. Obvious mistakes are answered before the network is called at all: a body that is not hex, an odd number of characters, fewer than 60 bytes, or more than 200 kB returns HTTP 400 invalid_hex instantly. A broadcast costs one API credit, and the Developer plan at $49 a month includes 500,000.
Two honest limits. We relay each transaction through one Bitcoin Core backed node rather than fanning it out to dozens of peers, so if you need maximum propagation for a low-fee transaction, also submit it to a second service; broadcasting the same valid transaction twice is harmless. And signing stays entirely on your side: this endpoint never builds, signs, holds or stores a key.
History from genesis queryable in seconds
On-chain data not financial advice
Why it works
What you get with Broadcast API
Keys never leave your side
Sign with your own wallet library or HSM, then POST the finished hex. The endpoint relays bytes and returns a txid. It does not build transactions, choose inputs, sign, or store anything that could spend a coin, which keeps it out of your custody review.
A refusal you can act on
When the network turns a transaction down you get HTTP 422 and the node's own reason in network_said, so your code can branch on "already in utxo set", "min relay fee not met" or "bad-txns-inputs-missingorspent" instead of on a bare 400 that means five different things.
Broadcast and confirm on one key
The response links straight to GET /v1/tx/{txid}. The same account reads mempool state for the fee you pay, the transaction record once it confirms, and SQL over your full payout history for reconciliation, so broadcast, confirmation and month-end all come from one source.
Side by side
What each broadcast endpoint answered, same payloads, same minute
Read on 25 September 2026 with the chain tip at block 968,542. The rebroadcast test re-sent transaction 311ca5e1...e920, confirmed five blocks earlier in block 968,537. The undecodable test sent 80 bytes of zeros. Latency is the range across our reads.
| Endpoint | Re-sending a confirmed transaction | Sending 80 bytes of zeros | Can status alone tell them apart? | Latency on our reads |
|---|---|---|---|---|
| BitcoinDatabase POST /v1/tx/broadcast | 422 rejected_by_network, node reason verbatim in network_said | 422 rejected_by_network with the node decode error; non-hex or under 60 bytes gets 400 invalid_hex before the network is called | Yes for relay failure (503) versus refusal (422); pair any refusal with GET /v1/tx/{txid} | One relay hop, not benchmarked in this reading |
| mempool.space POST /api/tx | 400, RPC -27 "Transaction outputs already in utxo set" | 400, RPC -22 "TX decode failed" | No, both are 400 | 0.08 to 0.15 s |
| Blockstream Esplora POST /api/tx | 400, RPC -27, same text | 400, RPC -22, same text | No, both are 400 | 0.57 to 1.2 s |
| BlockCypher POST /v1/btc/main/txs/push | 400, "Transaction with hash ... already exists" | 400, "insufficient priority and fee for relay" | No, both are 400, and the second message names the wrong problem | 0.15 to 0.22 s |
What it handles
The indexed Bitcoin chain, queryable your way
Look up an address, a transaction, a UTXO, the rich list or an on-chain metric, by REST API, SQL or dashboard. The same authoritative data, reconciled block-by-block against the canonical chain, without running a node.
- Push a signed raw transaction and get its txid
- Read the node's exact rejection reason
- Tell a relay outage apart from a refused transaction
- Check confirmation status of the txid you broadcast
- Reconcile every payout you sent in SQL
GET /v1/address/{addr}
query result
{
"address": "bc1qxy2k…l0wdv8",
"balance_btc": 68432.10,
"balance_usd": 4612165420,
"tx_count": 1284,
"unspent_outputs": 37,
"first_seen": "2014-02-09"
}
Why BitcoinDatabase
One platform, queryable three ways
Not a raw node to sync, not an indexer to build, and not five vendors to stitch together. The fully-indexed Bitcoin blockchain, available as a REST API, as SQL, and as dashboards, on one authoritative dataset.
REST API
Typed JSON for addresses, transactions, balances, UTXOs and metrics. Drop it into apps, wallets, explorers and agents with curl, Python or any HTTP client.
SQL access
Run SQL directly against the indexed Bitcoin dataset for ad-hoc analysis, cohorts and exports, the same data the API and dashboards read from.
Compliance-first
Informational on-chain data and analytics only. Entity labels and flow tracing are framed as tooling to support a regulated team's own review, not accusations.
Good questions
Questions about Broadcast API
Explore more
More ways to query Bitcoin with BitcoinDatabase
Bitcoin fee estimation API
Quote Bitcoin fee rates from live mempool state, then audit what your withdrawals actually paid.
Learn moreBitcoin UTXO data
The full UTXO set: ages, values, script types and age distribution.
Learn moreDormant Bitcoin wallet and address API
Find addresses whose coins have not moved in years, by last spend rather than last touch.
Learn moreBitcoin address types
Script type on every input and output: legacy, P2SH, native SegWit and Taproot, counted and valued.
Learn moreBitcoin transaction decoder
Decode a raw Bitcoin transaction hex into readable JSON: inputs, outputs, scripts and addresses.
Learn moreBitcoin Supply Metrics API
Query supply in profit and loss, HODL waves and exchange supply from the indexed chain.
Learn moreStop running a node. Just query Bitcoin.
Run your first query now and get on-chain data back by REST API, SQL or dashboard, with address history back to the genesis block over REST. Informational on-chain data only, not financial advice.
History from genesis over REST · SQL · dashboards · addresses, transactions, UTXOs, metrics