getBlock -SDK
Returns the block from the network based on the provided block number or hash.
Don’t have an API key?
Start using this method in your app today. Get started for free
Description
Returns the block from the network based on the provided block number or hash. Transactions on the block are represented as an array of transaction hashes. To get the full transaction details on the block, use getBlockWithTransactions instead.
Parameters
Response
Block
response object parameters
Example Request and Response
Prerequisite: You will need to install the Alchemy SDK before making requests with it.
The commands for installing it using npm or yarn are given below:
Request
Here is an example of how to make a getBlock
request using the Alchemy SDK:
getblock.js
Response
shell
Related Methods
Here are the methods related to getBlock
:
- getBlockWithTransactions: Returns the block from the network based on the provided block number or hash. Includes full transactions from the block.