eth_getBlockByHash
Returns information about a block by hash.

Parameters

Params - a string array containing (required):
  • DATA(hex string, required), 32 Bytes - hash of a block.
  • Boolean(boolean, required) - if true it returns the full transaction objects, if false only the hashes of the transactions.

Returns

Object - A block object, or null when no block was found:
  • number(hex string). QUANTITY - the block number. null when its pending block.
  • hash(hex string). DATA, 32 Bytes - hash of the block. null when its pending block.
  • parentHash(hex string). DATA, 32 Bytes - hash of the parent block.
  • nonce(hex string). DATA, 8 Bytes - hash of the generated proof-of-work. null when its pending block.
  • sha3Uncles(hex string). DATA, 32 Bytes - SHA3 of the uncles data in the block.
  • logsBloom(hex string). DATA, 256 Bytes - the bloom filter for the logs of the block. null when its pending block.
  • transactionsRoot(hex string). DATA, 32 Bytes - the root of the transaction trie of the block.
  • stateRoot(hex string). DATA, 32 Bytes - the root of the final state trie of the block.
  • receiptsRoot(hex string). DATA, 32 Bytes - the root of the receipts trie of the block.
  • miner(hex string). DATA, 20 Bytes - the address of the beneficiary to whom the mining rewards were given.
  • difficulty(hex string). QUANTITY - integer of the difficulty for this block.
  • totalDifficulty(hex string). QUANTITY - integer of the total difficulty of the chain until this block.
  • extraData(hex string). DATA - the “extra data” field of this block.
  • size(hex string). QUANTITY - integer the size of this block in bytes.
  • gasLimit(hex string). QUANTITY - the maximum gas allowed in this block.
  • gasUsed(hex string). QUANTITY - the total used gas by all transactions in this block.
  • timestamp(hex string). QUANTITY - the unix timestamp for when the block was collated.
  • transactions(array of object). Array - array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter.
  • uncles(array of hex string). Array - array of uncle hashes.

Example

Request

1
curl https://api.blockvision.org/v1/<api key> \
2
-X POST \
3
-H "Content-Type: application/json" \
4
-d '{
5
"jsonrpc": "2.0",
6
"method": "eth_getBlockByHash",
7
"params": [
8
"0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae",
9
false
10
],
11
"id": 1
12
}'
Copied!

Result

1
{
2
"jsonrpc": "2.0",
3
"id": 1,
4
"result": {
5
"difficulty": "0x4ea3f27bc",
6
"extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32",
7
"gasLimit": "0x1388",
8
"gasUsed": "0x0",
9
"hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae",
10
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
11
"miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171",
12
"mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843",
13
"nonce": "0x689056015818adbe",
14
"number": "0x1b4",
15
"parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54",
16
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
17
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
18
"size": "0x220",
19
"stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d",
20
"timestamp": "0x55ba467c",
21
"totalDifficulty": "0x78ed983323d",
22
"transactions": [],
23
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
24
"uncles": []
25
}
26
}
Copied!