API ReferenceBlocks APIGet block by versionVersion: 2.2Get block by versionMainnetTestnetGEThttps://mainnet-aptos-api.moralis.io/blocks/by_version/:versionGet block by specific ledger version.PATH PARAMSversionnumberrequiredLedger version to lookup block information for.QUERY PARAMSwith_transactionsbooleanIf set to true, include all transactions in the blockfalsetrueResponses200 Returns block by versionobjectAPI KEYTest Live APINode.jsPythoncURLGoPHPimport Moralis from 'moralis';try { await Moralis.start({ apiKey: "YOUR_API_KEY" }); const response = await Moralis.AptosApi.blocks.getBlockByVersion({ "network": "mainnet" }); console.log(response);} catch (e) { console.error(e);}from moralis import aptos_apiapi_key = "YOUR_API_KEY"params = { "network": "mainnet"}result = aptos_api.blocks.get_block_by_version( api_key=api_key, params=params,)print(result)curl --request GET \ --url 'https://mainnet-aptos-api.moralis.io/blocks/by_version/%3Aversion' \ --header 'accept: application/json' \ --header 'X-API-Key: YOUR_API_KEY' package mainimport ( "fmt" "net/http" "io/ioutil")func main() { url := "https://mainnet-aptos-api.moralis.io/blocks/by_version/%3Aversion" req, _ := http.NewRequest("GET", url, payload) req.Header.Add("Accept", "application/json") req.Header.Add("X-API-Key", "YOUR_API_KEY") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body))}<?php// Dependencies to install:// $ composer require guzzlehttp/guzzlerequire_once('vendor/autoload.php');$client = new \GuzzleHttp\Client();$response = $client->request('GET', 'https://mainnet-aptos-api.moralis.io/blocks/by_version/%3Aversion', [ 'headers' => [ 'Accept' => 'application/json', 'X-API-Key' => 'YOUR_API_KEY', ],]);echo $response->getBody();Response Example200 Returns block by version{ "block_height": "32425224034", "block_hash": "32425224034", "block_timestamp": "32425224034", "first_version": "32425224034", "last_version": "32425224034", "transactions": [ { "hash": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1", "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "", "function": "", "type_arguments": [ "" ], "arguments": [ "" ] }, "signature": { "type": "", "signature": "", "public_key": "" } } ]}