Skip to main content

eth_getBlockByHash

Retrieve complete block information by its hash on the Polygon network. This method returns detailed block data including transactions, block metadata, and all associated properties.

Parameters​

ParameterTypeRequiredDescription
blockHashstringYesThe hash of the block to retrieve (32-byte hex string with 0x prefix)
fullTransactionObjectsbooleanYesIf true, returns full transaction objects; if false, returns only transaction hashes

Returns​

Returns a block object with the following fields:

FieldTypeDescription
numberstringBlock number (hex-encoded)
hashstringBlock hash (32 bytes)
parentHashstringHash of the parent block (32 bytes)
noncestringProof-of-work nonce (8 bytes)
sha3UnclesstringSHA3 hash of the uncles data in the block
logsBloomstringBloom filter for block logs (256 bytes)
transactionsRootstringRoot of the transaction trie (32 bytes)
stateRootstringRoot of the final state trie (32 bytes)
receiptsRootstringRoot of the receipts trie (32 bytes)
minerstringAddress of the block miner
difficultystringDifficulty level for this block
totalDifficultystringTotal difficulty of the chain until this block
extraDatastringExtra data field of this block
sizestringSize of this block in bytes
gasLimitstringMaximum gas allowed in this block
gasUsedstringTotal gas used by all transactions in this block
timestampstringUnix timestamp for when the block was collated
transactionsarrayArray of transaction objects or hashes (depending on fullTransactionObjects parameter)
unclesarrayArray of uncle hashes
baseFeePerGasstringBase fee per gas (EIP-1559, if applicable)
mixHashstring256-bit hash for proof-of-work verification

Implementation Example​

curl -X POST https://api-polygon-mainnet-full.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getBlockByHash",
"params": [
"0x4b3c1d7e6bf4b78c8c9e2f1a3d5e7f9b2c4a6d8e0f2a4c6e8d0b2f4a6c8e0d2f",
true
],
"id": 1
}'

Response Example​

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"number": "0x1b4",
"hash": "0x4b3c1d7e6bf4b78c8c9e2f1a3d5e7f9b2c4a6d8e0f2a4c6e8d0b2f4a6c8e0d2f",
"parentHash": "0xa1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456",
"nonce": "0x0000000000000042",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"stateRoot": "0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"miner": "0x0000000000000000000000000000000000000000",
"difficulty": "0x400000000",
"totalDifficulty": "0x400000000",
"extraData": "0x",
"size": "0x220",
"gasLimit": "0x1c9c380",
"gasUsed": "0x0",
"timestamp": "0x54e34e8e",
"transactions": [],
"uncles": [],
"baseFeePerGas": "0x7",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
}

Use Cases​

  • Block Verification: Verify specific block details and integrity on Polygon
  • Transaction Analysis: Analyze all transactions within a specific block
  • Blockchain Analytics: Track block-level metrics and network activity
  • DApp Development: Integrate block data into Polygon-based applications
  • Network Monitoring: Monitor Polygon network performance and block propagation

Need help? Contact our support team or check the Polygon documentation.