For the complete documentation index, see llms.txt. This page is also available as Markdown.
eth_getBlockByNumber - Ethereum
Example code for the eth_getBlockByNumber JSON RPC method. Сomplete guide on how to use eth_getBlockByNumber JSON RPC in GetBlock Web3 documentation.
This method returns block data given a block number or tag. The block reference can be a hex-encoded number or one of the tags latest, earliest, pending, finalized (post-Merge finalized block), or safe (justified block). This is the most common block-lookup method — used by every block explorer, indexer, and chain-observation tool.
Parameters
Parameter
Type
Required
Description
blockParameter
string
Yes
Block number in hex, or latest, earliest, pending, finalized, safe
fullTransactionObjects
boolean
Yes
If true, returns full transaction objects; if false, returns just transaction hashes