gettxout - Bitcoin

gettxout. Retrieves details of a specific unspent transaction output (UTXO) identified by its transaction ID and output index, including its value, script, and confirmation status.

gettxout - bitcoin [Value: 30CU]
Fetches details of an unspent transaction output.
Use cases

Use cases

  • Retrieve details of an unspent transaction output
  • Analyze UTXO value and script details
  • Audit specific outputs for transactions
Constraints

Constraints

  • Requires valid transaction ID and output index
  • Only for unspent outputs
  • Depends on node sync
Get started
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
curl  https://bitcoin.drpc.org \
    -X POST \
    -H "Content-Type: application/json" \
    --data '{"method": "gettxout", "params": ["txid", 1]}'
Copy
Response
200
{
    "jsonrpc": "2.0",
    "id": "curltest",
    "result": {
        "bestblock": "0000000000000000000abcdefabcdefabcdefabcdefabcdefabcdefabcdef",
        "confirmations": 5,
        "value": 0.1,
        "scriptPubKey": {
            "asm": "OP_DUP OP_HASH160 abcdefabcdefabcdefabcdefabcdefabcdef OP_EQUALVERIFY OP_CHECKSIG",
            "hex": "76a914abcdefabcdefabcdefabcdefabcdef88ac",
            "type": "pubkeyhash",
            "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
        }
    }
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersobject
object
txidstring
Required. The transaction ID.
nnumeric
Required. The output index (vout number).
include_mempoolboolean
Optional. Default is true. Whether to include the mempool.

Response

200

Response params

object
idinteger
jsonrpcstring
resultobject
object
bestblockstring
The block hash at the tip of the chain.
confirmationsnumber
The number of confirmations received for the transaction.
valuenumber
The transaction value in BTC.
scriptPubKeyobject
A JSON object containing information about the PubKey script.
object
asmstring
The script public key in the form of string.
hexstring
The hexadecimal representation of the transaction.
reqSigsnumber
Number of required signatures.
typestring
The type of script, e.g., pubkeyhash, multisig.
addressesarray
A JSON array of Bitcoin addresses.
object
coinbaseboolean
It is true if the transaction output belongs to a coinbase transaction, otherwise it's false for all other transactions.