# Get ledger info

If the duration\_secs param is provided, this endpoint will return a 200 if the following condition is true:

`server_latest_ledger_info_timestamp >= server_current_time_timestamp - duration_secs`

#### **Path Parameters:**

None

#### Query Parameters：

None

#### **Response Header:**

**X-APTOS-BLOCK-HEIGHT** integer&#x20;

Current block height of the chain

**X-APTOS-CHAIN-ID** integer&#x20;

Chain ID of the current chain

**X-APTOS-EPOCH** integer&#x20;

Current epoch of the chain

**X-APTOS-LEDGER-OLDEST-VERSION** integer&#x20;

Oldest non-pruned ledger version of the chain

**X-APTOS-LEDGER-TIMESTAMPUSEC** integer&#x20;

Current timestamp of the chain

**X-APTOS-LEDGER-VERSION** integer&#x20;

Current ledger version of the chain

**X-APTOS-OLDEST-BLOCK-HEIGHT** integer&#x20;

Oldest non-pruned block height of the chain

#### **Response Body:**

The struct holding all data returned to the client by the index endpoint (i.e., GET "/"). Only for responding in JSON

**chain\_id** integer&#x20;

Chain ID of the current chain

**epoch** string\<uint64>

A string containing a 64-bit unsigned integer.

**ledger\_version** string\<uint64>

A string containing a 64-bit unsigned integer.

**oldest\_ledger\_version** string\<uint64>

A string containing a 64-bit unsigned integer.

**ledger\_timestamp** string\<uint64>

A string containing a 64-bit unsigned integer.

**node\_role** string&#x20;

Allowed values: validator full\_node

**oldest\_block\_height** string\<uint64>

A string containing a 64-bit unsigned integer.

**block\_height** string\<uint64>

A string containing a 64-bit unsigned integer.

**git\_hash** string<br>

#### Example:

{% code overflow="wrap" %}

```json
// Request
curl -X GET -H 'Content-Type: application/json' https://movement.blockpi.network/rpc/v1/your_api_key/v1/

// Result
{
    "chain_id": 126,
    "epoch": "1",
    "ledger_version": "9",
    "oldest_ledger_version": "0",
    "ledger_timestamp": "1732636319660843",
    "node_role": "validator",
    "oldest_block_height": "0",
    "block_height": "3",
    "git_hash": "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41"
}
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.blockpi.io/build/api-reference/movement/get-ledger-info.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
