[Block] eth_getHeaderByHash
Returns information about a header by hash.
Please check Caution-Header before using this API.
JSONRPC: eth_getHeaderByHash
Request
- application/json
Body
method stringrequired
Default value: eth_getHeaderByHash
Method name
id int64required
Default value: 1
Request ID, Random or Auto incrementation
jsonrpc stringrequired
Default value: 2.0
JSON-RPC Version (2.0)
params 32-byte DATA[]required
Hash of a block.
Responses
- 200
Object - A header object, or null when no header was found. Otherwise, it returns an error.
- application/json
- Schema
- Example (from schema)
Schema
jsonrpc stringrequired
Default value: 2.0
id int64required
error
object
result
object
{
"jsonrpc": "2.0",
"id": 0,
"error": {
"code": -32700,
"message": "Parse error",
"data": "string"
},
"result": {
"baseFeePerGas": "0x5d21dba00",
"difficulty": "0x1",
"extraData": "0xd8820505846b6c617988676f312e31312e328664617277696e00000000000000f89ed594e733cb4d279da696f30d470f8c04decb54fcb0d2b841f1f600d136f93a5a2d9c12a7a9f6d7ba80a047c3910a2bbc01e38bcce25e48ed2004d21f134df5efaf1f8cbb9a26e1548e57628ab258c935490c11a7cd65324701f843b841444b3efc40071b6eec2c4d2630b483710b8fc7a601432431b0161f489102d1ca02f2ef93153d0be3843aa563d34cee1716163f58711843442aedd94a56303c0400",
"gasLimit": "0xe8d4a50fff",
"gasUsed": "0x0",
"governanceData": "0x",
"hash": "0xb8deae63002d2b6aa33247c8ef545383ee0fd2282ac9b49dbbb74114389ddb5c",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0x0000000000000000000000000000000000000000",
"mixHash": "0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365",
"nonce": "0x0000000000000000",
"number": "0x1",
"parentHash": "0x73255a60e9491b5715f9bfcb7fa1143296810f629836d4cefbd1921d9173d63d",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"reward": "0x0000000000000000000000000000000000000000",
"size": "0x2d7",
"stateRoot": "0xedb87f4b0f905a655c80d1768eb22b1eff2405098c4748b8364c869611e02a2b",
"timestamp": "0x5c99cbd8",
"totalDifficulty": "0x2",
"transactions": [],
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"uncles": []
}
}
- curl
- python
- nodejs
- java
- CURL
curl -L -X POST 'http://localhost:8551/eth/block/getHeaderByHash' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--data-raw '{
"method": "eth_getHeaderByHash",
"id": 1,
"jsonrpc": "2.0",
"params": [
"0x1b4"
]
}'
ResponseClear