Skip to main content

getrawtransaction RPC Method

Returns the raw transaction data.

Updated on
Feb 03, 2026

Parameters

txid
string
REQUIRED

The transaction id

verbose
boolean

default=false. If false, returns the serialized, hex-encoded data for 'txid'; if true, returns a JSON object. Bitcoin Core also accepts a numeric verbosity in this position: 0 for hex-encoded data, 1 for a JSON object, and 2 for a JSON object with fee and prevout information

blockhash
string

The block in which to look for the transaction

Returns

result
string | object

Hex-encoded transaction when verbose is false, or a transaction JSON object when verbose is true

txid
string

The transaction id

hash
string

The transaction hash (differs from txid for witness transactions)

version
integer

The block version

size
integer

The transaction size

vsize
integer

The virtual transaction size (differs from the size for witness transactions)

weight
integer

The transaction's weight (between vsize4 - 3 and vsize4)

locktime
integer

The transaction locktime

vin
array

A JSON array. Each element in the array serves as a transaction's input vector (vin).

txid
string

(Optional) The transaction id of the output being spent (omitted for coinbase inputs)

vout
integer

(Optional) The output number being spent (omitted for coinbase inputs)

scriptSig
object

(Optional) The input's script signature (omitted for coinbase inputs)

asm
string

The script signature in assembly form

hex
string

The hex-encoded script signature

coinbase
string

(Optional) Coinbase data hex (only present on coinbase inputs)

txinwitness
array

(Optional) Hex-encoded witness stack items (SegWit inputs)

prevout
object

(Optional) Spent output details (verbose level 2, or getblock verbosity 3)

generated
boolean

Whether the spent output was coinbase

height
integer

Height of the block containing the spent output

value
number

Value of the spent output in BTC

scriptPubKey
object

scriptPubKey of the spent output

asm
string

The script public key in the form of string

desc
string

The inferred descriptor for the output

hex
string

The hex of the script's public key in string format

address
string

The Bitcoin address

type
string

The type of script, e.g. pubkeyhash, multisig

sequence
integer

The script sequence number

vout
array

A JSON array containing tx information

value
number

The value in BTC

n
integer

The output index

scriptPubKey
object

A JSON object containing information about the PubKey script

asm
string

The script public key in the form of string

desc
string

The inferred descriptor for the output

hex
string

The hex of the script's public key in string format

address
string

The Bitcoin address

type
string

The type of script, e.g. pubkeyhash, multisig

fee
number

(Optional) Transaction fee in BTC (verbose level 2 only)

hex
string

The serialized, hex-encoded data for 'txid'

blockhash
string

The block hash

confirmations
integer

The number of confirmed transaction in the block

time
integer

Same as 'blocktime'

blocktime
integer

The block time expressed in UNIX epoch time

in_active_chain
boolean

(Optional) Whether specified block is in the active chain or not (only present with explicit 'blockhash' argument)

error
object | null

(Optional) JSON-RPC error when the request failed; omitted or null on success

code
integer

Error code

message
string

Error message

Request
Response
1
{
2
"jsonrpc": "2.0",
3
"result": "01000000000101e17e03d21d051aa2bd9d336c3ac0693cfa92ce71592ceec521b1c48019ff77a101000000171600146d76e574b5f4825fe740ba6c41aaf1b319dfb80cffffffff02819a010000000000160014422002d927a1cae901eac668444cce8dd0ae60d529b31b0b0000000017a914f5b48d1130dc3d366d1eabf6783a552d1c8e08f4870247304402206701306a4750908fd48dead54331a3c7b4dce04ec10bfc6dd32049e2cff061a5022013c9d66827fabbeaadeb30b41c09aca2daddf4628cd00e3b993b1c86a12ff5190121034bcb9be1daf6ce1193774d15f863768b621bc95a363f1da5810129e961a2317400000000",
4
"id": 1
5
}
1
{
2
"jsonrpc": "2.0",
3
"result": "01000000000101e17e03d21d051aa2bd9d336c3ac0693cfa92ce71592ceec521b1c48019ff77a101000000171600146d76e574b5f4825fe740ba6c41aaf1b319dfb80cffffffff02819a010000000000160014422002d927a1cae901eac668444cce8dd0ae60d529b31b0b0000000017a914f5b48d1130dc3d366d1eabf6783a552d1c8e08f4870247304402206701306a4750908fd48dead54331a3c7b4dce04ec10bfc6dd32049e2cff061a5022013c9d66827fabbeaadeb30b41c09aca2daddf4628cd00e3b993b1c86a12ff5190121034bcb9be1daf6ce1193774d15f863768b621bc95a363f1da5810129e961a2317400000000",
4
"id": 1
5
}
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free