Get blocks by version
GET
This endpoint allows you to query transactions and block information for a specific block.Transactions are limited by the default maximum transaction count. If not all transactions are returned, you must query the remaining transactions separately using the get transactions API. A 410 status code is returned if the block has been pruned.
Path Parameters
chainstringrequired
Parameter specifying the target chain to query.networkstringrequired
Parameter specifying the network of the target chain.versionintegerrequired
The ledger version of the transaction to query for block information.Query Parameters
with_transactionsboolean
If set to true, all transactions within the block are included.If not provided, transactions are not returned.Responses
block_heightstringrequired
Represents a 64-bit unsigned integer as a string.Expressed as a string for compatibility with languages such as JavaScript that do not natively support u64 values in JSON.block_hashstringrequired
A field representing the unique hash identifier of the block.block_timestampstringrequired
A field representing when the block was created.Provided as a UNIX timestamp in microseconds, used to track block creation order and timing.The block timestamp is used to guarantee transaction ordering and measure block creation intervals.first_versionstringrequired
A field representing the version number of the first processed transaction among those included in the block.In Aptos, each transaction has a unique version number indicating the overall execution order.first_version and last_version allow you to determine the version range of transactions within the block.last_versionstringrequired
A field representing the version number of the last processed transaction among those included in the block.Together with first_version, defines the version range of transactions within the block, enabling sequential lookup of all transactions in the block.transactionsarray
A list of all transactions included in the block.codestringrequired
Code identifying the cause of the failed request.messagestringrequired
Detailed message including the name and value of the invalid parameter.{"code": "ERROR_CODE","message": "Bad Request"}
cURL
curl -X GET 'https://aptos-mainnet.nodit.io/v1/blocks/by_version/{version}' \-H 'Content-Type: application/json' \-H 'X-API-KEY: nodit-demo'