/v1 - Aptos

This endpoint retrieves the latest information from the Aptos blockchain ledger, such as current chain ID, node role, latest and oldest ledger versions, epoch, block height, and more.
In short, it provides an overview of Aptos and its health status.

Supported Network

  • Mainnet

Parameters

  • None

Request

URL (endpoint)

bashhttps://shared.eu-central-1.getblock.io/

Example (cURL)

bashcurl --location 'https://shared.eu-central-1.getblock.io/<ACCESS_TOKEN>/v1/info'

Response

json{
  "block_height": "58851650",
  "chain_id": 1,
  "epoch": "2796",
  "git_hash": "6568c5ee6a58b4f96c0780d4f66d7e573e61c418",
  "ledger_timestamp": "1685696086534090",
  "ledger_version": "152087593",
  "node_role": "full_node",
  "oldest_block_height": "1101178",
  "oldest_ledger_version": "2287593"
}

Response Definition

ValueData typeDescription
chain_idintegerID of the blockchain
epochstringCurrent epoch number
ledger_versionstringThe latest version of the ledger
oldest_ledger_versionstringThe earliest version of the ledger
ledger_timestampstringTimestamp of the latest ledger version in microseconds
node_rolestringRole of this node in the network
oldest_block_heightstringLowest block height available
block_heightstringCurrent block height
git_hashstringGit hash of the node build

Use Case

The /v1/info endpoint is useful for checking if a node is online and responding.
For example:

  • Developers can verify the latest block or ledger version to ensure the node is up-to-date.
  • Applications can notify users about the health of the blockchain, such as showing a modal alerting them to the current state when they log in to a dApp.

Code Example (Axios)

jsimport axios from 'axios'

let config = {
  method: 'get',
  maxBodyLength: Infinity,
  url: 'https://shared.eu-central-1.getblock.io/<ACCESS_TOKEN>/v1/info',
  headers: {}
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

Replace <ACCESS_TOKEN> with your actual access token from GetBlock.

Error Handling

When using this endpoint, you may encounter:

  • 404 → Incorrect or incomplete access token.
  • 500 → Network issues.

How to fix:

  • Use a stable and strong network connection.
  • Check or re-copy your access token.
  • Verify the URL to ensure it is correct and complete.

Integration

It is recommended to use this endpoint first to check the current status of the blockchain before integrating other endpoints into your application.