POSTbook_changes

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

Reports information about changes to the order books compared with the previous ledger version. It lets you check the traded volume and the open, high, low and close rates for each currency pair.

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.

Responses
currency_astring

The first currency identifier. XRP uses XRP_drops; tokens use the issuer/currency format.

currency_bstring

The second currency identifier. Only tokens are specified.

volume_astring

The total traded volume of the first currency.

volume_bstring

The total traded volume of the second currency.

highstring

The highest exchange rate recorded in this ledger version.

lowstring

The lowest exchange rate recorded in this ledger version.

openstring

The exchange rate before the ledger was processed.

closestring

The exchange rate after the ledger was processed.

ledger_hashstring

The hash of the ledger version used.

ledger_indexinteger

The ledger index of the version used.

ledger_timeinteger

The official close time of the ledger, in seconds since the Ripple Epoch.

typestring

The response type. Always returns bookChanges.

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": "book_changes",
  "params": [
    {
      "ledger_index": "validated"
    }
  ]
}'
Response
Example · 200
{
  "result": {
    "changes": [
      {
        "close": "0.000000015",
        "currency_a": "XRP_drops",
        "currency_b": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q/USD",
        "high": "0.000000016",
        "low": "0.000000014",
        "open": "0.000000015",
        "volume_a": "12000000",
        "volume_b": "0.18"
      }
    ],
    "ledger_hash": "17ACB57A0F73B5160713E81FE72B2AC9F6064541004E272BD09F257D57C30C02",
    "ledger_index": 98765432,
    "ledger_time": 810900000,
    "type": "bookChanges",
    "validated": true
  }
}