Actions22
- Call Contract
- Estimate Gas
- Get Balance
- Get Block
- Get Block By Hash
- Get Block Number
- Get Block Transaction Count By Hash
- Get Block Transaction Count By Number
- Get Code
- Get Gas Price
- Get Logs
- Get Storage At
- Get Transaction
- Get Transaction By Block Hash And Index
- Get Transaction By Block Number And Index
- Get Transaction Count
- Get Transaction Receipt
- Get Uncle By Block Hash And Index
- Get Uncle By Block Number And Index
- Get Uncle Count By Block Hash
- Get Uncle Count By Block Number
- Send Raw Transaction
Get Block
AI-generatedOverview
This node operation retrieves detailed information about a specific blockchain block using the Infura API. It supports fetching a block by its number or hash and can optionally include full transaction details within the block. This is useful for blockchain analysis, monitoring block data, or integrating blockchain data into applications.
Use Case Examples
- Retrieve the latest block details with basic transaction hashes.
- Fetch a specific block by its number and include full transaction details for in-depth analysis.
Properties
| Name | Meaning |
|---|---|
| Block Number | The block number to retrieve, specified as a hexadecimal string or tags like 'latest', 'earliest', or 'pending'. Used to identify the block by number. |
| Block Hash | The hash of the block to retrieve. Used to identify the block by its unique hash value. |
| Include Full Transactions | Boolean flag indicating whether to include full transaction details in the block data. If false, only transaction hashes are included. |
Output
JSON
blockNumberDecimal- Block number in decimal format.timestampDate- Block timestamp as an ISO date string.gasLimitDecimal- Gas limit of the block in decimal.gasUsedDecimal- Gas used in the block in decimal.sizeDecimal- Size of the block in decimal.transactions- List of transactions or transaction hashes included in the block.
Dependencies
- Infura API key credential with project ID and optional project secret for authentication.
Troubleshooting
- Ensure the block number or hash is correctly formatted (hexadecimal or valid tags).
- If 'Include Full Transactions' is true, the response may be large and slow; consider setting it to false for faster responses.
- Common errors include invalid credentials, network issues, or invalid parameters. Verify API credentials and parameter values.
Links
- Infura eth_getBlockByNumber API - Official documentation for retrieving block details by number using Infura.
- Infura eth_getBlockByHash API - Official documentation for retrieving block details by hash using Infura.