POSTgetblockheader

Bitcoin Mainnethttps://bitcoin-mainnet.nodit.io/

Returns the header of the block with the given block hash. Set verbose to false to return the serialized header as a hex-encoded string.

Request Body
idintegerrequired
jsonrpcstringrequired
methodstringrequired
paramsoneOf[]required

It contains following parameters in order:

  1. blockhash: The hash of the block to look up, as a string. (required)
  2. verbose: The response format, as a boolean. (optional, default true)
    • true: Returns a JSON object.
    • false: Returns the serialized header as a hex-encoded string.
params[0]string

The hash of the block to look up.

params[1]boolean

Whether to return a JSON object. When false, a hex-encoded string is returned.

Responses
hashstring

The block hash, identical to the value provided in the request.

confirmationsinteger

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

heightinteger

The block height.

versioninteger

The block version.

versionHexstring

The block version in hexadecimal.

merklerootstring

The merkle root of the transactions in the block.

timeinteger

The block time expressed in UNIX epoch time.

mediantimeinteger

The median time of the preceding 11 blocks, expressed in UNIX epoch time.

nonceinteger

The nonce used for proof of work.

bitsstring

nBits, the compact representation of the block difficulty target.

targetstring

The difficulty target, in hexadecimal.

difficultynumber

The difficulty of the block.

chainworkstring

The expected number of hashes required to produce the current chain, in hexadecimal.

nTxinteger

The number of transactions in the block.

previousblockhashstring

The hash of the previous block.

nextblockhashstring

The hash of the next block.

X-API-KEY
RequestCU20
cURL
curl -X POST "https://bitcoin-mainnet.nodit.io/" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "getblockheader",
  "params": [
    "000000000000000000024bead8df69990852c202db0e0097c1a12ea637d7e96d",
    true
  ]
}'
Response
Example · 200
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "hash": "000000000000000000024bead8df69990852c202db0e0097c1a12ea637d7e96d",
    "confirmations": 100001,
    "height": 820000,
    "version": 671088640,
    "versionHex": "28000000",
    "merkleroot": "1a8b0e3d5f9c2b7a4e6d8f1c3b5a7968574635241302f1e0d9c8b7a695847362",
    "time": 1701388800,
    "mediantime": 1701386400,
    "nonce": 3216549870,
    "bits": "17038a4f",
    "target": "000000000000000000038a4f0000000000000000000000000000000000000000",
    "difficulty": 67957790298897.88,
    "chainwork": "00000000000000000000000000000000000000005f6bb1e6d0d1a3d5f6a5b8c1",
    "nTx": 3421,
    "previousblockhash": "00000000000000000002a7c4de1f5f9b5a3f8e2d7c6b5a4938271605f4e3d2c1",
    "nextblockhash": "0000000000000000000341b9c2d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d0"
  }
}