getblockheader
Returns a block header by hash. This method uses 80 credits from your daily balance.
Parameters
blockhash: (string) [required] - Hex-encoded block hash.verbose: (boolean) [optional] -truereturns a header object.falsereturns the serialized 80-byte header as a hex-encoded string. The default istrue.
Returns
result: (string or object) - The hex-encoded header when verbose is false. Otherwise, a header object:
hash: (string) - Block hash.confirmations: (integer) - Number of confirmations, or-1if the block isn't on the main chain.height: (integer) - Block height.version: (integer) - Block version.versionHex: (string) - Block version, as a hex string.merkleroot: (string) - Merkle root of the block's transactions.time: (integer) - Block timestamp, in Unix epoch seconds.mediantime: (integer) - Median timestamp of the previous 11 blocks, in Unix epoch seconds.nonce: (integer) - Proof-of-work nonce.bits: (string) - Compact encoding of the proof-of-work target.target: (string) - Proof-of-work target, as a hex string.difficulty: (number) - Proof-of-work difficulty.chainwork: (string) - Expected number of hashes required to produce the chain up to this block, as a hex string.nTx: (integer) - Number of transactions in the block.previousblockhash: (string) [optional] - Hash of the previous block. Absent for the genesis block.nextblockhash: (string) [optional] - Hash of the next block. Absent for the chain tip.
Request
- curl
curl https://bitcoin-mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getblockheader", "params": ["00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048", true]}'