# GET /v1/xrpl/orderbook

CLOB order book for a currency pair with unfunded offers removed.

## Purpose

Returns asks (best price first) and bids as levels `{gets, pays, price}`. Funded amounts are used when the ledger reports them and zero-amount levels are dropped. Price is `pays` per `gets` in human units (XRP, not drops).

## When to use

To read executable liquidity for a pair on the XRPL central limit order book (CLOB).

## When not to use

Not for AMM liquidity (use the amm page) and not for a cost estimate (use the slippage page).

## Parameters

| Name | In | Required | Description | Constraints | Example |
|---|---|---|---|---|---|
| `base` | query | yes | Base currency of the pair. | `XRP` or `CODE.issuer`. `XRP` takes no issuer; any other code needs one. The code is 3 letters or digits (A-Z, 0-9) or 40 hexadecimal digits and is upper-cased; the issuer is a valid classic XRPL address (r..., checksum verified) | `XRP` |
| `quote` | query | yes | Quote currency of the pair. | `XRP` or `CODE.issuer`. `XRP` takes no issuer; any other code needs one. The code is 3 letters or digits (A-Z, 0-9) or 40 hexadecimal digits and is upper-cased; the issuer is a valid classic XRPL address (r..., checksum verified) | `USD.rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh` |
| `depth` | query | no | Order book levels per side. | Positive integer, rounded up to 10, 50, 100 or 200 and capped at 200 (so 11 becomes 50 and 500 becomes 200); default 10 | `10` |

## Request example

```sh
curl -s "https://api.criptonlabs.com/v1/xrpl/orderbook?base=XRP&quote=USD.rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh&depth=10"
```

## Response example (200)

```json
{
  "base": "XRP",
  "quote": "USD.rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
  "depth": 10,
  "asks": [
    {
      "gets": "1500",
      "pays": "3150",
      "price": "2.1"
    }
  ],
  "bids": [
    {
      "gets": "1000",
      "pays": "2090",
      "price": "2.09"
    }
  ],
  "meta": {
    "ledger_index": 100234566,
    "as_of": "2026-10-06T12:00:03.000Z",
    "age_seconds": 2,
    "cache": "hit",
    "stale": false
  }
}
```

## Errors

- 400 [invalid-parameters](https://api.criptonlabs.com/errors/invalid-parameters.md)
- 400 [bad-request](https://api.criptonlabs.com/errors/bad-request.md)
- 429 [rate-limited](https://api.criptonlabs.com/errors/rate-limited.md)
- 503 [upstream-unavailable](https://api.criptonlabs.com/errors/upstream-unavailable.md)

## Caching

Fresh for 4 seconds; on upstream failure the last good value is served for up to 30 seconds (`meta.stale` is `true`), then the service answers 503. See the [freshness guide](https://api.criptonlabs.com/docs/guides/freshness.md).

## Rate limit

Tier `expensive`. See the [rate-limits guide](https://api.criptonlabs.com/docs/guides/rate-limits.md).

## MCP tool

The MCP tool `xrpl_orderbook` returns the same data. See the [MCP quickstart](https://api.criptonlabs.com/docs/guides/mcp-quickstart.md).
