eth_getBlockByNumber RPC Method
Returns information about a specific block by its number or tag.
Parameters
1. blockNumber or Tag (string, required)
The block number as a hex string (e.g., "0x1b4") or one of the following tags:
"latest"β most recent block"earliest"β the genesis block"pending"β pending block
2. Transaction details flag (boolean, required)
true: returns full transaction objectsfalse: returns only transaction hashes
Default: false
Example Parameters
[
"0x1029C88",
true
]Returns
Returns a Block object or null if no block was found.
Block Object Fields
numberβ Block number (hex ornullif pending)hashβ Block hash (32 bytes)parentHashβ Parent block hash (32 bytes)nonceβ Proof-of-work nonce (8 bytes,nullif pending)difficultyβ Block difficulty (hex)totalDifficultyβ Total difficulty up to this block (hex)logsBloomβ Bloom filter for logs (nullif pending)sha3Unclesβ SHA3 hash of uncles dataextraDataβ Extra data included in block (hex)timestampβ Unix timestamp of the block (hex)sizeβ Block size in bytes (hex)minerβ Miner address (20 bytes)transactionsRootβ Root of the transaction triestateRootβ Root of the state triereceiptsRootβ Root of the receipts triegasUsedβ Total gas used in the block (hex)gasLimitβ Max gas allowed in the block (hex)transactionsβ Array of transaction objects or hashesunclesβ Array of uncle block hashesmixHashβ 256-bit hash used in PoW (hex)baseFeePerGasβ Base fee per gas (hex, optional)
Request
POST Endpoint
POST https://base-mainnet.chainnodes.org/YOUR-API-KEYReplace YOUR-API-KEY with your actual key from the CHAINNODES Dashboard (opens in a new tab).
Example Request (HTTPS)
curl https://base-mainnet.chainnodes.org/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"method":"eth_getBlockByNumber",
"params": ["0x1029C88", false],
"id":1
}'Example Request (WebSocket)
wscat -c wss://base-mainnet.chainnodes.org/YOUR-API-KEY \
-w 1 \
-x '{
"jsonrpc":"2.0",
"method":"eth_getBlockByNumber",
"params": ["0x1029C88", false],
"id":1
}'Example Response (truncated)
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"number": "0x1029c88",
"hash": "0xc52962...",
"parentHash": "0x38c03b...",
"nonce": "0x0000000000000000",
"difficulty": "0x0",
"totalDifficulty": "0xc70d81...",
"size": "0x28abc",
"extraData": "0x62656176...",
"gasLimit": "0x1c9c380",
"gasUsed": "0xdf19ac",
"timestamp": "0x642709eb",
"miner": "0x95222290dd...",
"stateRoot": "0x30fcd7...",
"transactionsRoot": "0x6f7b72...",
"receiptsRoot": "0xf29158...",
"logsBloom": "0x48...",
"transactions": [
"0xb19f38ce6f75...",
"0xdb933288ef26...",
...
],
"uncles": [],
"baseFeePerGas": "0x6f664d776",
"mixHash": "0x33ca51..."
}
}π¬ Need help? Ask blockchain developers in Chainnodes Telegram Chat (opens in a new tab)
Need RPC API keys?
Get 12.5M archival requests for free today.