Skip to main content

getblockheader RPC Method

Returns the header of the block given it's hash.

Updated on
Feb 04, 2026

Parameters

blockhash
string
REQUIRED

The hash of the block

verbose
boolean

Default true. When true returns JSON object, when false returns hex-encoded data

Returns

(for verbose = true):
object

Response when verbose is true (the default). The JSON-RPC body includes result (block header object), error, and id.

result
object

The block header object

hash
string

The hash of the block

confirmations
integer

The number of confirmations, or -1 if the block is not on the main chain

height
integer

The block height or index

version
integer

The block version

versionHex
string

The block version formatted in hexadecimal

merkleroot
string

The merkle root

time
integer

The block time expressed in UNIX epoch time

mediantime
integer

The median block time expressed in UNIX epoch time

nonce
integer

The nonce

bits
string

The value of the nBits field in the block header

difficulty
integer

The estimated amount of work done to find this block relative to the estimated amount of work done to find block 0

chainwork
string

Expected number of hashes required to produce the current chain

nTx
integer

The number of transactions in the block

previousblockhash
string

The hash of the previous block (if available)

nextblockhash
string

The hash of the next block (if available)

error
object | null

JSON-RPC error object when the request failed, or null on success

id
integer

The JSON-RPC request identifier

(for verbose = false):
object

Response when verbose is false. The JSON-RPC body includes result (hex-encoded serialized block header), error, and id.

result
string

A hex-encoded string of the serialized block header

error
object | null

JSON-RPC error object when the request failed, or null on success

id
integer

The JSON-RPC request identifier

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