gettransaction - Bitcoin
gettransaction. Retrieves detailed information about a specific Bitcoin transaction associated with the node's wallet, including its status, amount, confirmations, and related metadata.
gettransaction - bitcoin [Value: 30CU]
Provides detailed information about a specific transaction.
Use cases
- Retrieve details of a specific Bitcoin transaction
- Analyze transaction inputs, outputs, and confirmations
- Audit wallet transaction history
Constraints
- Requires a valid transaction ID
- Only supports wallet transactions
- Depends on node sync
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key
Language
Request
Examples
curl --request POST \
--url ' https://bitcoin.drpc.org' \
--header 'Content-Type: application/json' \
--data '{"jsonrpc": "1.0", "id": "curltest", "method": "gettransaction", "params": ["1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"]}'
Response
200
{
"jsonrpc": "1.0",
"id": "curltest",
"result": {
"in_active_chain": true,
"hex": "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d",
"txid": "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d",
"hash": "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d",
"size": 250,
"vsize": 250,
"weight": 1000,
"version": 2,
"locktime": 0,
"vin": [ /* inputs */ ],
"vout": [ /* outputs */ ],
"blockhash": "00000000abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef",
"confirmations": 5,
"blocktime": 1693527600,
"time": 1693527600
}
}
Request params
idinteger
jsonrpcstring
methodstring
object
txidstring
Required. The transaction ID.
include_watchonlyboolean
Optional. Default is true for watch-only wallets, otherwise false. Whether to include watch-only addresses in balance calculation and details.
verboseboolean
Optional. Default is false. Whether to include a decoded field containing the decoded transaction (equivalent to RPC decoderawtransaction).
Response
200
Response params
object
idinteger
jsonrpcstring
resultobject
object
amountnumber
The amount in BTC.
feenumber
The amount of the fee in BTC. This is negative and only available for the 'send' category of transactions.
confirmationsnumber
The number of confirmations for the transaction. Negative confirmations means the transaction conflicted that many blocks ago.
generatedboolean
Only present if the transaction only input is a coinbase one.
trustedboolean
Only present if we consider the transaction to be trusted and safe to spend from.
blockhashstring
The block hash containing the transaction.
blockheightnumber
The block height containing the transaction.
blockindexnumber
The index of the transaction in the block that includes it.
blocktimenumber
The block time expressed in UNIX epoch time.
txidstring
The transaction ID.
walletconflictsarray
Conflicting transaction IDs.
timenumber
The transaction time expressed in UNIX epoch time.
timereceivednumber
The time received expressed in UNIX epoch time.
commentstring
If a comment is associated with the transaction, only present if not empty.
bip125-replaceablestring
Whether this transaction could be replaced due to BIP125 (replace-by-fee); may be unknown for unconfirmed transactions not in the mempool.
detailsarray
An array of detailed information about the transaction.
object
involvesWatchonlyboolean
Only returns true if imported addresses were involved in the transaction.
addressstring
The Bitcoin address involved in the transaction.
categorystring
The transaction category. Possible values: 'send', 'receive', 'generate', 'immature', 'orphan'.
amountnumber
The amount in BTC.
labelstring
A comment for the address/transaction, if any.
voutnumber
The output index.
feenumber
The amount of the fee in BTC. This is negative and only available for the 'send' category of transactions.
abandonedboolean
'true' if the transaction has been abandoned (inputs are respendable). Only available for the 'send' category of transactions.
hexstring
Raw data for the transaction.
decodedobject
Optional, the decoded transaction (only present when `verbose` is passed). Equivalent to the RPC decoderawtransaction method, or the RPC getrawtransaction method when `verbose` is passed.