curl --request POST \
--url https://monad-testnet.core.chainstack.com/9c5b265f20b3ea5df4f54f70eb74b800/ \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_getBlockByNumber",
"params": [
"latest",
false
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}curl --request POST \
--url https://monad-testnet.core.chainstack.com/9c5b265f20b3ea5df4f54f70eb74b800/ \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_getBlockByNumber",
"params": [
"latest",
false
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}quantity or tag — the integer of a block number encoded as hexadecimal, or the string latest, earliest, or pending.boolean — if true, returns the full transaction objects; if false, returns only the hashes of the transactions.result — the block object, or null when no block was found:
number — the block numberhash — the block hashparentHash — hash of the parent blocknonce — hash of the proof-of-worksha3Uncles — SHA3 of the uncles datalogsBloom — the bloom filter for the logstransactionsRoot — the root of the transaction triestateRoot — the root of the final state triereceiptsRoot — the root of the receipts trieminer — the address of the beneficiarydifficulty — integer of the difficultytotalDifficulty — total difficulty of the chain until this blockextraData — extra data fieldsize — size of this block in bytesgasLimit — maximum gas allowed in this blockgasUsed — total gas used by all transactionstimestamp — the unix timestamp for when the block was collatedtransactions — array of transaction objects or hashesuncles — array of uncle hasheseth_getBlockByNumber code examplesconst { ethers } = require("ethers");
const provider = new ethers.JsonRpcProvider("CHAINSTACK_NODE_URL");
async function getBlock() {
const block = await provider.getBlock("latest");
console.log(block);
}
getBlock();
eth_getBlockByNumber is retrieving block data for analysis, such as examining transaction volume, gas usage patterns, or timestamps for specific blocks.Was this page helpful?