klay_getBlockByHash
POST
Retrieves block information by block hash.
🚧 Is the response taking a long time? Response time may increase when requesting transactions!
When requesting all information for a specific block, response time may increase if the block contains many transactions.
For faster responses, request only the block header without transactions (include transactions=false).
param[0]
blockHashstringrequired
Block hash is a unique identifier for a block. Block hash is expressed as a 64-digit hexadecimal string.param[1]
includeTransactionsbooleanrequired
Whether to include transactions. Set to true to return results with transactions.Responses
blockScorestring
Former difficulty field (hex)extraDatastring
Arbitrary extra data added by the proposer (hex)gasUsedstring
Total gas used by all transactions in this block (hex)governanceDatastring
RLP-encoded governance configuration data (hex)hashstring
Block hashlogsBloomstring
Bloom filter for event log search (2048 bits, hex)numberstring
Block number (hex)parentHashstring
Hash of the parent blockproposerstring
Address of the node that proposed this blockreceiptsRootstring
Root hash of the transaction receipts trierewardstring
Address of the reward beneficiarysizestring
Block size in bytes (hex)stateRootstring
Root hash of the state trietimestampstring
Block creation time (Unix timestamp, hex)timestampFoSstring
Fractional seconds of block creation time (1/100 second, hex)totalBlockScorestring
Cumulative blockScore from genesis to this block (hex)transactionsoneOf
Transactions in this blocktransactionsRootstring
Root hash of the transactions trievoteDatastring
RLP-encoded governance vote data (hex)codestringrequired
Code identifying the cause of the failed request.messagestringrequired
Detailed message including the name and value of the invalid parameter.{"code": "ERROR_CODE","message": "Unauthorized"}
cURL
curl -X POST 'https://kaia-mainnet.nodit.io' \-H 'Content-Type: application/json' \-H 'X-API-KEY: nodit-demo' \-d '{"jsonrpc": "2.0","id": 1,"method": "klay_getBlockByHash","params": ["0x59f63e3840e0f4a1659074c1a4021e881a268a52d31958688da1d66bfbf6d2ca",false]}'