Get block by number
Tries to fetch a block given its number. It has an option to include the transactions in the block, which defaults to false. Note that this function will only fetch blocks that are part of the main chain.
getBlockByNumberrpc method
Parameters
blockNumbernumberrequiredincludeBodybooleanrequiredResponse fields
hashstringsizenumberbatchnumberepochnumbernetworkstringversionnumbernumbernumbertimestampnumberparentHashstringseedstringextraDatanumber[]stateHashstringbodyHashstringhistoryHashstringtransactionsany[]typestringequivocationProofsobject[]interlinkstring[]isElectionBlockbooleanjustificationunknownnextBatchInitialPunishedSetnumber[]parentElectionHashstringproducerunknownslotsany[]Interactive playground
Try the method against a public RPC endpoint.