Skip to main content

getblockheader RPC Method

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

Updated on
Oct 4, 2023

getblockheader RPC Method

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

(for verbose = true):
hash
The hash of the block
confirmations
The number of confirmations, or -1 if the block is not on the main chain
height
The block height or index
version
The block version
versionHex
The block version formatted in hexadecimal
merkleroot
The merkle root
time
The block time expressed in UNIX epoch time
mediantime
The median block time expressed in UNIX epoch time
nonce
The nonce
bits
The value of the nBits field in the block header
difficulty
The estimated amount of work done to find this block relative to the estimated amount of work done to find block 0
chainwork
Expected number of hashes required to produce the current chain
nTx
The number of transactions in the block
previousblockhash
The hash of the previous block (if available)
nextblockhash
The hash of the next block (if available)
error
The error message, if any
(for verbose = false):
result
A string that is serialized, hex-encoded data for block hash
error
The error message, if any
Request
1
curl https://docs-demo.btc.quiknode.pro/ \
2
-X POST \
3
-H "Content-Type: application/json" \
4
--data '{"method": "getblockheader", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"]}'
5
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free