POSTbook_offers

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

Returns the list of offers in the order book between two currencies. It lets you check the exchange rate and the funding status of each offer.

Request Body
methodstringrequired
taker_getsobjectrequired

Specifies an asset by currency code and issuer. No amount is included.

currencystring

The currency code. Pass XRP for XRP.

issuerstring

The address of the account that issued the token. Required for anything other than XRP.

taker_paysobjectrequired

Specifies an asset by currency code and issuer. No amount is included.

currencystring

The currency code. Pass XRP for XRP.

issuerstring

The address of the account that issued the token. Required for anything other than XRP.

takerstring

The account address used as the perspective for the order book. When specified, the unfunded offers from that account are also included in the results.

limitinteger

The number of offers to return.

domainstring

The domain ledger entry ID of the Permissioned DEX. It can be used only when the PermissionedDEX amendment is enabled.

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
Accountstring

The address of the account that created the offer.

TakerGetsoneOf

Represents an amount. XRP is expressed as a string in drops; tokens are expressed as an object.

XRP Amountstring
Token Amountobject
currencystring

The currency code. Either a 3-character code or a 40-character hex string.

issuerstring

The address of the account that issued the token.

valuestring

The amount expressed as a string.

TakerPaysoneOf

Represents an amount. XRP is expressed as a string in drops; tokens are expressed as an object.

XRP Amountstring
Token Amountobject
currencystring

The currency code. Either a 3-character code or a 40-character hex string.

issuerstring

The address of the account that issued the token.

valuestring

The amount expressed as a string.

BookDirectorystring

The ID of the order book directory this offer belongs to.

Flagsinteger

A bit-map of flags enabled for the offer.

Sequenceinteger

The sequence number of the transaction that created the offer.

indexstring

The ID that identifies this offer ledger entry.

qualitystring

The exchange rate of the offer, calculated as taker_pays divided by taker_gets.

owner_fundsstring

The tradeable balance held by the offer's creator. It is returned only for the highest-ranked offer among the offers from the same account.

taker_gets_fundedoneOf

Represents an amount. XRP is expressed as a string in drops; tokens are expressed as an object.

XRP Amountstring
Token Amountobject
currencystring

The currency code. Either a 3-character code or a 40-character hex string.

issuerstring

The address of the account that issued the token.

valuestring

The amount expressed as a string.

taker_pays_fundedoneOf

Represents an amount. XRP is expressed as a string in drops; tokens are expressed as an object.

XRP Amountstring
Token Amountobject
currencystring

The currency code. Either a 3-character code or a 40-character hex string.

issuerstring

The address of the account that issued the token.

valuestring

The amount expressed as a string.

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
RequestCU50
cURL
curl -X POST "https://xrpl-mainnet.nodit.io/" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
  "method": "book_offers",
  "params": [
    {
      "taker_gets": {
        "currency": "XRP"
      },
      "taker_pays": {
        "currency": "USD",
        "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"
      },
      "limit": 10
    }
  ]
}'
Response
Example · 200
{
  "result": {
    "ledger_current_index": 98765433,
    "offers": [
      {
        "Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
        "BookDirectory": "8C0E1B3D5F7A9C0E2D4F6B8A0C1E3D5F7A9B0C2E4D6F8A0B4E1F3A5C7E9B0D2F",
        "Flags": 0,
        "Sequence": 40,
        "TakerGets": "1000000",
        "TakerPays": {
          "currency": "USD",
          "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
          "value": "0.015"
        },
        "index": "9D0F2A4C6E8B0D1F3A5C7E9B0D2F4A6C8E0B1D3F5A7C9E0B2D4F6A8C0E1B3D5F",
        "owner_funds": "5000000",
        "quality": "0.000000015"
      }
    ],
    "validated": false
  }
}