Skip to main content

gettransaction

Overview

The 'gettransaction' method allows you to retrieve detailed information about a specific transaction on the Bitcoin network. This method returns a JSON object containing various details about the transaction, including the amount, fee, confirmations, and more.

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":"gettransaction","params": [ ]}' \
'https://bitcoin-mainnet.node.coinapi.io'

Request Parameters

  • transaction_id (string): The ID of the transaction you want to retrieve information about.
  • verbose (boolean): Optional. If set to true, the method will return a decoded version of the transaction, similar to the output of the decoderawtransaction or getrawtransaction method when verbose is passed.

Response

{
"amount": "n",
"fee": "n",
"confirmations": "n",
"blockhash": "hex",
"blockheight": "n",
"blockindex": "n",
"blocktime": "xxx",
"txid": "hex",
"walletconflicts": ["hex"],
"time": "xxx",
"timereceived": "xxx",
"details": [
{
"address": "str",
"category": "str",
"amount": "n",
"vout": "n",
"fee": "n",
"abandoned": "true|false"
}
],
"hex": "hex",
"decoded": {
// Decoded transaction details (only present when `verbose` is passed)
}
}