HomeGuidesAPI ReferenceChangelog
GuidesAPI ReferenceCommunityDiscordBlogFAQBug BountyAnnouncementsChange Log
API Reference

eth_getBlockByHash

Returns information about a block by hash.

Parameters

IndexData TypeDescription
1DATA, 32 Byteshash of a block
2BooleanIf 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. The block includes items as below.

Item NameData TypeDescription
numberQUANTITYblock number
hashDATA, 32 Byteshash of the block
parentHashDATA, 32 Byteshash of the parent block
nonceQUANTITYunused
sha3UnclesDATA, 32 BytesSHA3 of the uncles data in the block
logsBloomDATA, 256 Bytesthe bloom filter for the logs of the block.
transactionsRootDATA, 32 Bytesthe root of the transaction trie of the block
stateRootDATA, 32 Bytesthe root of the final state trie of the block
receiptsRootDATA, 32 Bytesthe root of the receipts trie of the block
minerDATA, 20 Bytesthe address of the beneficiary to whom the mining rewards were given
difficultyQUANTITYinteger of the difficulty for this block
totalDifficultyQUANTITYinteger of the total difficulty of the chain until this block
extraDataDATAthe “extra data” field of this block
sizeQUANTITYinteger the size of this block in bytes
gasLimitQUANTITYthe maximum gas allowed in this block
gasUsedQUANTITYthe total used gas by all transactions in this block
timestampQUANTITYthe unix timestamp for when the block was created, the unit is second.
transactionsArrayArray of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter.
unclesArrayArray of uncle hashes

Example

curl -X POST 'https://api.shasta.trongrid.io/jsonrpc' --data '{
	"jsonrpc": "2.0",
	"method": "eth_getBlockByHash",
	"params": ["0x0000000000f9cc56243898cbe88685678855e07f51c5af91322c225ce3693868", false],
	"id": 1
}'

Result

{"jsonrpc":"2.0","id":1,"result":null}