Actions20
- Block Number
- Chain ID
- Gas Price
- Get Balance
- Get Block by Hash
- Get Block by Number
- Get Block Tx Count by Hash
- Get Block Tx Count by Number
- Get Code
- Get My Balance
- Get Transaction by Block Hash and Index
- Get Transaction by Block Number and Index
- Get Transaction by Hash
- Get Transaction Count
- Get Transaction Receipt
- Get Uncle Count by Block Hash
- Get Uncle Count by Block Number
- Help
- Peer Count
- Syncing
Get Block by Number
AI-generatedSummary
Retrieves block information from the Ethereum blockchain by specifying a block number, hash, or special identifier (latest, earliest, pending, safe, finalized).
Inputs
- network — Target network: 'mainnet' (default) or 'sepolia'.
- block — Block number (integer) or special identifier: 'latest', 'earliest', 'pending', 'safe', or 'finalized'. Default is 'latest'.
- is_full — Boolean flag to return full transaction objects (true) or only transaction hashes (false). Default is false.
Output shape
A list of items, each containing a JSON object representing the requested block data.
The shape of the transaction array inside the block object depends on the 'is_full' parameter. If true, items include full transaction objects; if false, only transaction hashes are returned.
Examples
Example 1: Get the most recent block with only transaction hashes
Operation: Get Block by Number, Network: mainnet, Block: latest, Full Block: false
Example 2: Retrieve a specific block with full transaction details
Operation: Get Block by Number, Network: mainnet, Block: 12345678, Full Block: true
Example 3: Query the current pending block
Operation: Get Block by Number, Network: mainnet, Block: pending, Full Block: false