getBlock
method returns complete information about a block for a given slot height.
Block & slot confusionYou need to provide the slot number in the getBlock method. For a detailed explanation with examples, see Understanding the difference between blocks and slots on Solana.
Get you own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.
Parameters
block
— the height of the slot to retrieve information for.commitment
—confirmed
orfinalized
.processed
is not supported.transactionDetails
— level of transaction details.maxSupportedTransactionVersion
— for transaction versioningrewards
— block rewards that go to validators.
Response
blockHeight
— the actual block number produced in the slot.blockTime
— Unix timestamp of the block. Also note that this is the timestamp agreed upon by the cluster validators. Most of the time, it doesn’t matter that much but still important to know.blockhash
— the hash of the block.parentSlot
— the slot of the block’s parent.previousBlockhash
— the hash of the block’s parent.rewards
— an array of reward objects that were awarded when the block was processed.transactions
— an array of transaction objects that were processed in the block.
Use case
A practical use case forgetBlock
is to retrieve detailed information about a specific block. This can be useful for block explorers, wallets, or other applications that need to display or make use of this information.Body
application/json