Skip to main content

getblockheader RPC Method

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

Updated on
Feb 03, 2026

Parameters

blockhash
string
REQUIRED

The hash of the block

verbose
boolean

default=true. It's true for a JSON object and false for the hex-encoded data

Returns

result
string | object

Hex-encoded header when verbose is false, or a header JSON object when verbose is true (default)

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

target
string

The current proof-of-work target

difficulty
number

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

(Optional) The hash of the previous block (if available)

nextblockhash
string

(Optional) The hash of the next block (if available)

error
object | null

(Optional) Present when the call fails (no result). Omitted or null on success.

code
integer

Bitcoin Core JSON-RPC error code (e.g. -8 for invalid parameter)

message
string

Human-readable error (e.g. hash length validation)

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