Bitcoin
Bitcoin
Bitcoin
Free tier covers personal projects. Pay-as-you-go scales without a card.
gettxout looks up a single unspent transaction output — a UTXO — in Bitcoin's UTXO set, the collection of spendable coins that the chain tracks instead of account balances. Given a transaction id and an output index, it returns the output's value (in BTC), its scriptPubKey, the number of confirmations, and whether it came from a coinbase; if that output has already been spent or never existed, it returns null. This is the core read for confirming a coin is still live before you spend it. Send the txid and vout index to https://bitcoin.therpc.io/YOUR_API_KEY.
value and scriptPubKey to drive coin selection and fee planning.include_mempool true to catch outputs already spent by an unconfirmed mempool transaction — those return null.| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 1 | txid | string | Yes | Transaction id holding the output. |
| 2 | n | number | Yes | Output (vout) index. |
| 3 | include_mempool | boolean | No | Include the mempool; if true, an output spent in mempool returns null.Default: true |
| Type | Description |
|---|---|
| object | null if spent or not found, else: bestblock, confirmations, value (BTC), scriptPubKey {asm, hex, type, address}, coinbase. |
| Code | Message | Cause |
|---|---|---|
-8 | Invalid parameter | A parameter is out of range or the wrong shape — check verbosity levels, conf_target bounds, and required fields. |
getrawtransaction instead.value field here is denominated in BTC, unlike getblockstats, which returns amounts in satoshis — do not mix the two scales.