Skip to main content

getrawtransaction RPC Method

Returns the raw transaction data.

Updated on
Oct 4, 2023

getrawtransaction RPC Method

Parameters

txid
string
REQUIRED
The transaction id
verbose
integer
(default: 0) A numeric parameter that can take one of the following values: '0' for hex-encoded data, '1' for JSON object and '2' for JSON object with fee and prevout
blockhash
string
The block in which to look for the transaction

Returns

if verbose is not set or set to false
str
The serialized, hex-encoded data for 'txid'
if verbose is set to true
in_active_chain
Whether specified block is in the active chain or not (only present with explicit 'blockhash' argument)
hex
The serialized, hex-encoded data for 'txid'
txid
The transaction id
hash
The transaction hash (differs from txid for witness transactions)
size
The transaction size
vsize
The virtual transaction size (differs from the size for witness transactions)
weight
The transaction's weight (between vsize*4 - 3 and vsize*4)
version
The block version
locktime
The transaction locktime
vin
A JSON array. Each element in the array serves as a transaction's input vector (vin).
txid
The transaction id
vout
The output number
scriptSig
The script's signature
asm
The script's public key in the form of a string
hex
The hex-encoded witness data
sequence
The sequence number of the script
txinwitness
An array of JSON objects
hex
The hex-encoded witness data
vout
A JSON array containing tx information
value
The value in BTC
n
The output index
scriptPubKey
A JSON object containing information about the PubKey script
asm
The script public key in the form of string
hex
The hex of the script's public key in string format
desc
The inferred descriptor for the output
type
The type of script, e.g. pubkeyhash, multisig
address
The Bitcoin address
str
The bitcoin address
blockhash
The block hash
confirmations
The number of confirmed transaction in the block
blocktime
The block time expressed in UNIX epoch time
time
Same as 'blocktime'
Request
1
curl https://docs-demo.btc.quiknode.pro/ \
2
-X POST \
3
-H "Content-Type: application/json" \
4
--data '{"method": "getrawtransaction", "params": ["10b54fd708ab2e5703979b4ba27ca0339882abc2062e77fbe51e625203a49642", 0]}'
5
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free