Skip to main content

gettxout

Overview

The 'gettxout' RPC method allows you to retrieve details about an unspent transaction output in the Bitcoin network

Request

wget --no-check-certificate --quiet \
--method POST \
--timeout=0 \
--header 'Content-Type: application/json' \
--header 'accept: application/json' \
--header 'X-CoinAPI-Key: 73034021-THIS-IS-SAMPLE-KEY' \
--body-data '{"jsonrpc":"2.0","id":1,"method":"gettxout","params": [ ]}' \
'https://bitcoin-mainnet.node.coinapi.io'

Request Parameters

txid

  • Type: string
  • Required: Yes
  • Description: The identifier for the transaction you are querying.

n

  • Type: numeric
  • Required: Yes
  • Description: The output number (vout) of the transaction.

include_mempool

  • Type: boolean
  • Default: true
  • Description: Specifies whether to include the mempool in the query.

Response

bestblock

  • Description: The hash of the block at the tip of the blockchain.

confirmations

  • Description: The number of confirmations received for the transaction.

value

  • Description: The value of the transaction, denominated in BTC.

scriptPubKey

  • Description: A JSON object containing details about the public key script associated with the transaction.

asm

  • Description: The script public key, represented as a string.

hex

  • Description: The hexadecimal representation of the transaction.

reqSigs

  • Description: The number of signatures required to validate the transaction.

type

  • Description: The type of script used in the transaction, such as pubkeyhash or multisig.

addresses

  • Description: A JSON array containing the Bitcoin addresses involved in the transaction.

str

  • Description: A string representation of a Bitcoin address associated with the transaction.

coinbase

  • Description: A boolean value indicating whether the transaction output is part of a coinbase transaction. Returns true for coinbase transactions and false for all others.