Moralis icon

Moralis

Interact with Moralis Web3 APIs for blockchain data, NFTs, tokens, and DeFi

Block → Get Block

AI-generated

Overview

This node interacts with the Moralis Web3 API to retrieve detailed information about a specific blockchain block. It supports querying a block by its number or the keyword "latest" across multiple supported blockchains such as Ethereum, Arbitrum, Avalanche, and others. This is useful for blockchain developers, analysts, or enthusiasts who need to fetch block data for monitoring, analysis, or integration into decentralized applications.

Use Case Examples

  1. Fetch details of block number 123456 on the Ethereum blockchain.
  2. Retrieve the latest block information on the Polygon blockchain.

Properties

Name Meaning
Chain The blockchain network to query, e.g., Ethereum, Polygon, BSC, etc.
Block Number The block number to retrieve information for, or the keyword "latest" to get the most recent block.
Additional Fields Optional parameters to customize the request such as limit, cursor for pagination, whether to include metadata, and the number format (decimal or hex).

Output

JSON

  • json - The JSON response containing block information from the Moralis API, including block details, operation type, resource type, blockchain chain, and a timestamp of the query.

Dependencies

  • Moralis Web3 API with an API key credential

Troubleshooting

  • Common issues include invalid or missing API key, incorrect block number format, or unsupported chain selection.
  • Errors may occur if the block number does not exist or if the API rate limit is exceeded.
  • Ensure the block number is valid and the chain parameter matches a supported blockchain.

Links

Discussion