> ## Documentation Index
> Fetch the complete documentation index at: https://docs.validationcloud.io/llms.txt
> Use this file to discover all available pages before exploring further.

# ledger_data

Retrieves contents of the specified ledger's state tree. You can iterate through several calls with the returned marker to retrieve the entire contents of a single ledger version.

This method will use `40` [Compute Units](/nodeapi/about/billing).

***

## Reference: [Here](https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/ledger-methods/ledger_data)

## **Parameters**

* `ledger_hash` (string, optional) The hash of the ledger version to use.
* `ledger_index` (number or string, optional) The ledger index of the ledger to use, or a shortcut string such as `validated`.
* `binary` (boolean, optional) If `true`, return ledger entries as hexadecimal strings instead of JSON. The default is `false`.
* `limit` (number, optional) Limit the number of ledger entries to retrieve. Cannot be more than 2048 (binary) or 256 (JSON).
* `marker` (marker, optional) Value from a previous paginated response. Resume retrieving data where that response left off.
* `type` (string, optional) Filter results to a specific type of ledger entry, such as `account`, `amm`, `offer`, `state`, `nft_page` or `payment_channel`.

## Returns

* `ledger` (object) The complete ledger header data for this ledger version.
* `ledger_index` (unsigned integer) The ledger index of this ledger version.
* `ledger_hash` (string) Unique identifying hash of this ledger version.
* `state` (array) Array of ledger entries from the ledger's state tree. In JSON mode each has `LedgerEntryType`, `index` and the fields for that entry type; in binary mode each has `data` and `index`.
* `marker` (marker) Server-defined value indicating the response is paginated. Pass this to the next call to resume.

```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
// Result
{
  "result": {
    "ledger_hash": "3D85D73151567309C4E3EC15ECF94A50FB3954DC0C95A73B354CACBA122F278B",
    "ledger_index": 107292934,
    "validated": true,
    "state": [
      {
        "Balance": {
          "currency": "5355524600000000000000000000000000000000",
          "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
          "value": "-38597789.650631"
        },
        "Flags": 2228224,
        "HighLimit": {
          "currency": "5355524600000000000000000000000000000000",
          "issuer": "rGY4h5RBnqkjZF7LdDMvkFH8Hkk2S4VC36",
          "value": "9924523213.253686"
        },
        "HighNode": "0",
        "LedgerEntryType": "RippleState",
        "LowLimit": {
          "currency": "5355524600000000000000000000000000000000",
          "issuer": "r92cuEzpRHWBtq6jGp7Lh76ud63m5bEZcC",
          "value": "0"
        },
        "LowNode": "1",
        "PreviousTxnID": "91315DD2EA29E37337E82D301C290AEA7EDEE2DD6F05CC2F68B84207F4F5567D",
        "PreviousTxnLgrSeq": 95342771,
        "index": "000001C00ADE73DFE88D818FE98D531B180463D51324BE4544EAC23D542EA6CE"
      },
      // ...
    ],
    "ledger": {
      "account_hash": "5A4018168DD91775480EFCFD2258ADA3EDF1256C0F882322FE744CCCB6106EA7",
      "close_flags": 0,
      "close_time": 843914951,
      "close_time_human": "2026-Sep-28 12:49:11.000000000 UTC",
      "close_time_resolution": 10,
      "close_time_iso": "2026-09-28T12:49:11Z",
      "ledger_hash": "3D85D73151567309C4E3EC15ECF94A50FB3954DC0C95A73B354CACBA122F278B",
      "parent_close_time": 843914950,
      "parent_hash": "D7DC7B8CA1BAC687F65F293EDBCC990207D292A428F9A5A2474F36C0BE96697D",
      "total_coins": "99985607278153927",
      "transaction_hash": "7BF158EC33C6F2CF843C40DDFC4A2C6C2A2FD44A3E37DC9B744A8625144EDA1E",
      "ledger_index": "107292934",
      "closed": true
    },
    "marker": "00000203EA7B91B283192593F8847E6641930185B3689530AAE24A64A815FF58",
    "status": "success"
  }
}
```

<CodeGroup>
  ```bash title="mainnet" theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
  curl https://mainnet.xrpl.validationcloud.io/v1/<YOUR_API_KEY_HERE> \
      -X POST \
      -H "Content-Type: application/json" \
      -d '{"method":"ledger_data","params":[{"ledger_index":"validated","limit":2}]}'
  ```
</CodeGroup>

Over WebSocket, send `{"id":1,"command":"ledger_data","ledger_index":"validated","limit":2}` to `wss://mainnet.xrpl.validationcloud.io/v1/<YOUR_API_KEY_HERE>`.

> With a `type` filter the server still scans `limit` entries per call and returns only the matching ones, so a page can come back with an empty `state` array and a `marker`. Keep paging with the marker.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.