teckel Ethereum icon

teckel Ethereum

Query the Ethereum blockchain via the teckel platform

Get Block by Number

AI-generated

Summary

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

Links

Discussion