Skip to main content

kaia_getBlockByNumber

POST

Retrieves block information by block number.

🚧 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]
blockNumberOrTagstringrequired
Use one of block number or block tag to specify the block.
  • Block number: Hexadecimal string (e.g. "0x1")
  • Block tag: Enum string (e.g. "latest", "earliest", "pending")
    • earliest: The oldest available block on the chain.
    • finalized: A recently finalized block that can no longer be changed. Primarily used in proof-of-stake (PoS) blockchains.
    • safe: A recent block considered safe by the network (immune to reorgs).
    • latest: The most recent block on the chain (may be subject to reorgs).
    • pending: The next block to be mined, including pending transactions in the mempool.
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 hash
logsBloomstring
Bloom filter for event log search (2048 bits, hex)
numberstring
Block number (hex)
parentHashstring
Hash of the parent block
proposerstring
Address of the node that proposed this block
receiptsRootstring
Root hash of the transaction receipts trie
rewardstring
Address of the reward beneficiary
sizestring
Block size in bytes (hex)
stateRootstring
Root hash of the state trie
timestampstring
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 block
Array of transaction hashes (includeTransactions=false)
transactionsRootstring
Root hash of the transactions trie
voteDatastring
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": "kaia_getBlockByNumber",
"params": [
"0x1076B5A",
false
]
}'