Skip to main content

gettxout

POST

Returns details about the unspent transaction output (UTXO) with the given transaction id and output index.null is returned when the output has already been spent.
param[0]
txidstringrequired
The transaction id to look up.
param[1]
nintegerrequired
The index of the output to look up.
param[2]
includeMempoolbooleanrequired
Whether to include the mempool.When true, an output that is spent in the mempool is not returned.
Responses
bestblockstring
The hash of the block at the tip of the chain.
confirmationsinteger
The number of confirmations of the transaction containing the output.
valuenumber
The value of the output, denominated in BTC.
The output script (scriptPubKey) that defines the conditions for spending the output.
asmstring
Disassembly of the script.
descstring
Inferred descriptor for the script.
hexstring
The raw script bytes, hex-encoded.
addressstring
The Bitcoin address for the script. Returned only when a well-defined address exists.
typestring
The output type.
  • nonstandard: A script that does not match any standard type.
  • anchor: A Pay-to-Anchor (P2A) output.
  • pubkey: An output locked directly by a public key (P2PK).
  • pubkeyhash: An output locked by a public key hash (P2PKH).
  • scripthash: An output locked by a script hash (P2SH).
  • multisig: An output that requires multiple signatures.
  • nulldata: An output that only records data via OP_RETURN.
  • witness_v0_keyhash: A SegWit v0 public key hash output (P2WPKH).
  • witness_v0_scripthash: A SegWit v0 script hash output (P2WSH).
  • witness_v1_taproot: A Taproot output (P2TR).
  • witness_unknown: An output with an unknown witness version.
coinbaseboolean
Whether the output is a coinbase output.
codestringrequired
Code identifying the cause of the failed request.
messagestringrequired
Detailed message including the name and value of the invalid parameter.
{
"code": "ERROR_CODE",
"message": "Unauthorized"
}
cURL
curl -X POST 'https://bitcoin-mainnet.nodit.io' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: nodit-demo' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "gettxout",
"params": [
"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
0,
true
]
}'