POSTgettxout

Bitcoin Mainnethttps://bitcoin-mainnet.nodit.io/

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.

Request Body
idintegerrequired
jsonrpcstringrequired
methodstringrequired
paramsoneOf[]required

It contains following parameters in order:

  1. txid: The transaction id to look up, as a string. (required)
  2. n: The index of the output to look up, as an integer. (required)
  3. include_mempool: Whether to include the mempool, as a boolean. (optional, default true)
params[0]string

The transaction id to look up.

params[1]integer

The index of the output to look up.

params[2]boolean

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.

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.

예: witness_v0_keyhash

coinbaseboolean

Whether the output is a coinbase output.

X-API-KEY
RequestCU20
cURL
curl -X POST "https://bitcoin-mainnet.nodit.io/" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "gettxout",
  "params": [
    "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
    0,
    true
  ]
}'
Response
Example · 200
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "bestblock": "000000000000000000024bead8df69990852c202db0e0097c1a12ea637d7e96d",
    "confirmations": 100001,
    "value": 0.0125,
    "scriptPubKey": {
      "asm": "0 3123f9ba48c9a80f4e7f7ea6a7d5028a9c0018a2",
      "desc": "addr(bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh)#8rvxaqzk",
      "hex": "00143123f9ba48c9a80f4e7f7ea6a7d5028a9c0018a2",
      "address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
      "type": "witness_v0_keyhash"
    },
    "coinbase": false
  }
}