Bitcoin
Bitcoin
Bitcoin
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
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.| # | Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
| 1 | txid | string | Sim | Transaction id holding the output. |
| 2 | n | number | Sim | Output (vout) index. |
| 3 | include_mempool | boolean | Não | Include the mempool; if true, an output spent in mempool returns null.Padrão: true |
| Tipo | Descrição |
|---|---|
| object | null if spent or not found, else: bestblock, confirmations, value (BTC), scriptPubKey {asm, hex, type, address}, coinbase. |
| Código | Mensagem | Causa |
|---|---|---|
-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.