POSTledger_data

XRP Ledger Mainnethttps://xrpl-mainnet.nodit.io/

Returns the contents of the ledger state tree. Calling it repeatedly with marker lets you iterate through an entire ledger version.

Request Body
methodstringrequired
ledger_hashstring

The hash of the ledger version to use. Pass a 32-byte hex string.

ledger_indexinteger

Specifies the ledger version to use. Pass a ledger index as an integer, or use one of the shortcut strings below.

  • validated: Uses the most recent ledger version validated by the network.
  • closed: Uses the most recent ledger version the server has closed. It may not be validated.
  • current: Uses the in-progress ledger version the server is currently building.

The ledger index of the version to use.

binaryboolean

Whether to return ledger entries as hex strings.

limitinteger

The number of ledger entries to return. Up to 2048 entries are returned when binary is true, and up to 256 when it is false.

markerobject

A value that marks a pagination position. Pass the marker value from a previous response to retrieve the next page. Its format depends on the server implementation, so use it verbatim without interpreting its contents.

typestring

The ledger entry type to return. (e.g.) account, state, offer

Responses
account_hashstring

The hash of the entire account state information.

close_flagsinteger

A bit-map of the flags applied when the ledger closed.

close_timeinteger

The time the ledger closed, in seconds since the Ripple Epoch.

close_time_humanstring

The time the ledger closed, as a human-readable UTC string.

close_time_isostring

The time the ledger closed, in ISO 8601 format.

close_time_resolutioninteger

The rounding interval applied to ledger close times, in seconds.

closedboolean

Whether the ledger version is closed.

ledger_hashstring

The unique hash that identifies the ledger version.

ledger_indexstring

The ledger index.

parent_close_timeinteger

The time the previous ledger closed, in seconds since the Ripple Epoch.

parent_hashstring

The hash of the previous ledger version.

total_coinsstring

The total amount of XRP in the network, in drops.

transaction_hashstring

The hash of all transactions included in this ledger version.

transactionsobject[]

The list of transactions included in the ledger. Returned when transactions is set to true in the request.

datastring

The entry, hex-encoded. Returned when binary is true.

LedgerEntryTypestring

The type of the ledger entry. Returned when binary is false.

indexstring

The ID that identifies the ledger entry.

markerobject

A value that marks a pagination position. Pass the marker value from a previous response to retrieve the next page. Its format depends on the server implementation, so use it verbatim without interpreting its contents.

ledger_hashstring

The hash of the ledger version used. Returned when a validated ledger version was queried.

ledger_indexinteger

The ledger index of the version used. Returned when a validated ledger version was queried.

ledger_current_indexinteger

The ledger index of the in-progress ledger. Returned when the current ledger was queried.

validatedboolean

Whether the response was derived from a validated ledger version.

X-API-KEY
RequestCU60
cURL
curl -X POST "https://xrpl-mainnet.nodit.io/" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
  "method": "ledger_data",
  "params": [
    {
      "ledger_index": "validated",
      "binary": false,
      "limit": 5
    }
  ]
}'
Response
Example · 200
{
  "result": {
    "ledger_hash": "17ACB57A0F73B5160713E81FE72B2AC9F6064541004E272BD09F257D57C30C02",
    "ledger_index": 98765432,
    "state": [
      {
        "LedgerEntryType": "AccountRoot",
        "Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
        "Balance": "9977",
        "Flags": 0,
        "OwnerCount": 0,
        "PreviousTxnID": "4E6A8C0D2F4B6A8C0E1D3F5A7B9C0E2D4F6A8B0C2E4D6F8A0B1C3D5E7F9A0B2C",
        "PreviousTxnLgrSeq": 98765000,
        "Sequence": 42,
        "index": "5F7A9C0E2D4F6B8A0C1E3D5F7A9B0C2E4D6F8A0B1C3E5D7F9A0B2C4E6D8F0A1B"
      }
    ],
    "marker": "5F7A9C0E2D4F6B8A0C1E3D5F7A9B0C2E4D6F8A0B1C3E5D7F9A0B2C4E6D8F0A1B",
    "validated": true
  }
}