If you are building a trading dashboard, a portfolio tracker or a price alert for XRP Ledger tokens, you need candle data. The xrpl.to API serves OHLC candles for every token on the ledger — over 20,000 — without an API key.

This guide fetches candle data with curl, then builds a live chart in the browser with Lightweight Charts.

1. Find the token identifier

Every token on the XRP Ledger has an MD5 identifier. Find it through the search endpoint:

Request

curl -X POST https://api.xrpl.to/v1/search \ -H "Content-Type: application/json" \ -d '{"search": "XDX"}' 

The response includes md5 for each matching token. Use that in the OHLC endpoint.

2. Fetch candle data

Request

curl "https://api.xrpl.to/v1/ohlc/20bb6167c0c9809d91d0bba2e1e888cd?interval=1h&limit=5" 

Response

{ "success": true, "format": "ohlc", "interval": "1h", "vs_currency": "XRP", "ohlc": [ [1796425200000, 4.685e-05, 4.857e-05, 4.031e-05, 4.736e-05, 1056.04], [1796428800000, 4.736e-05, 4.793e-05, 4.624e-05, 4.781e-05, 44.08] ] } 

Each candle: [timestamp_ms, open, high, low, close, volume]. Prices are in XRP by default.

Available intervals

Interval Value
5 min 5m
15 min 15m
1 hour 1h
4 hours 4h
1 day 1d
1 week 1w

Parameters

  • limit — number of candles (default 100, max 1000)
  • from / to — Unix timestamps in seconds to get a date range
  • vs_currency — XRP (default) or USD

3. Build a live chart

Create an index.html:

<!DOCTYPE html> <html> <head> <title>XRPL Token Chart</title> <script src="https://unpkg.com/lightweight-charts/dist/lightweight-charts.standalone.production.js"></script> </head> <body> <div id="chart" style="width:800px;height:400px"></div> <script> const MD5 = '20bb6167c0c9809d91d0bba2e1e888cd'; // XDX const chart = LightweightCharts.createChart(document.getElementById('chart'), { width: 800, height: 400, layout: { background: { color: '#000' }, textColor: '#fff' }, grid: { vertLines: { color: '#222' }, horzLines: { color: '#222' } }, }); const series = chart.addCandlestickSeries({ upColor: '#10b981', downColor: '#ef4444', borderUpColor: '#10b981', borderDownColor: '#ef4444', wickUpColor: '#10b981', wickDownColor: '#ef4444', }); async function load() { const res = await fetch( `https://api.xrpl.to/v1/ohlc/${MD5}?interval=1h&limit=200` ); const { ohlc } = await res.json(); series.setData(ohlc.map(([t, o, h, l, c]) => ({ time: t / 1000, open: o, high: h, low: l, close: c, }))); } load(); // Refresh every 30 seconds setInterval(load, 30000); </script> </body> </html> 

Open the file in a browser. You have a live-updating candlestick chart.

4. Add volume bars

const volumeSeries = chart.addHistogramSeries({ priceFormat: { type: 'volume' }, priceScaleId: 'volume', }); chart.priceScale('volume').applyOptions({ scaleMargins: { top: 0.8, bottom: 0 }, }); // Inside load(): volumeSeries.setData(ohlc.map(([t, o, , , c, v]) => ({ time: t / 1000, value: v, color: c >= o ? '#10b98140' : '#ef444440', }))); 

5. Multiple tokens

Swap MD5 for any token. Find the MD5 on xrpl.to — it is in the URL of every token page, or query the search endpoint.

// RLUSD const RLUSD = '0dd550278b74cb6690fdae351e8e0df3'; // Daily candles in USD const res = await fetch( `https://api.xrpl.to/v1/ohlc/${RLUSD}?interval=1d&limit=90&vs_currency=USD` ); 

Rate limits

No key: 2 requests per second. Free key: 10/s. Enough for a multi-token dashboard refreshing every 15 seconds.

Full API

The candle endpoint is one of 200+ on the xrpl.to API. Others:

  • Token list with sorting: GET /v1/tokens?sortBy=vol24hXrp&limit=20
  • Holder count over time: GET /v1/token/{md5}/holders/history
  • Trade history: GET /v1/token/{md5}/trades
  • Live stream: wss://api.xrpl.to/ws/sync/

Docs: xrpl.to/docs

XRP Ledger developer documentation: xrpl.build

Full-history XRPL node: xrpl.stream

Data by xrpl.to — the free XRP Ledger data API. No key required.