XMR
POST
GET
Last updated on January 1, 1970
3 min read
Method get_block_header_by_hash undefined ()
connect with JSON-RPC protocol
get_block_header_by_hash
Block header information can be retrieved using either a block's hash or height. This method includes a block's hash as an input parameter to retrieve basic information about the block.
Parameters
hash
- string
The block's sha256 hash.
Request
curl --location --request POST 'https://xmr.getblock.io/mainnet/json_rpc' \
--header 'x-api-key: YOUR-API-KEY' \
--header 'Content-Type: application/json' \
--data-raw '{"jsonrpc": "2.0",
"method": "get_block_header_by_hash",
"params": {"hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6"},
"id": "getblock.io"}'
Response
{
"id": "getblock.io",
"jsonrpc": "2.0",
"result": {
"block_header": {
"block_size": 210,
"block_weight": 210,
"cumulative_difficulty": 754734824984346,
"cumulative_difficulty_top64": 0,
"depth": 1482236,
"difficulty": 815625611,
"difficulty_top64": 0,
"hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6",
"height": 912345,
"long_term_weight": 210,
"major_version": 1,
"miner_tx_hash": "c7da3965f25c19b8eb7dd8db48dcd4e7c885e2491db77e289f0609bf8e08ec30",
"minor_version": 2,
"nonce": 1646,
"num_txes": 0,
"orphan_status": false,
"pow_hash": "",
"prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78",
"reward": 7388968946286,
"timestamp": 1452793716,
"wide_cumulative_difficulty": "0x2ae6d65248f1a",
"wide_difficulty": "0x309d758b"
},
"credits": 0,
"status": "OK",
"top_hash": "",
"untrusted": false
}
}
Start Building with GetBlock RPCs for Free
Previous
{ "overview": "Overview", "guides": "Guides", "get-started": "Get Started", "rpc-service": "Nodes Methods", "getblock-explorer": "Explorer API", "getblock-tracker": "Tracker API", "nodes-endpoints": "Nodes Endpoints" }
Next
{ "overview": "Overview", "guides": "Guides", "get-started": "Get Started", "rpc-service": "Nodes Methods", "getblock-explorer": "Explorer API", "getblock-tracker": "Tracker API", "nodes-endpoints": "Nodes Endpoints" }