xrpl.to now uses embedded non-custodial wallets. Xaman, Crossmark & GEM Wallet login is no longer supported.Now using embedded wallets. Xaman, Crossmark & GEM no longer supported.
Insights

XRPL WebSocket API: Real-Time Token Prices & Market Data

Stream live price feeds, orderbook updates, and ledger events over WebSocket. Zero polling, instant delivery.

Real-Time Data Streams

XRPL.to provides persistent WebSocket connections for streaming live market data directly to your application. Instead of polling REST endpoints every few seconds, open a single connection and receive instant push updates as prices change, trades execute, and new ledgers close.

WebSocket streams are available without authentication for public data. Connections are lightweight, support automatic reconnection, and deliver sub-second latency for all token price movements on the XRP Ledger DEX.

Available WebSocket Streams

Multi-Token Sync

wss://api.xrpl.to/ws/sync/

Subscribe to multiple tokens at once. Receive price, volume, and market cap updates in real time.

Single Token Stream

wss://api.xrpl.to/ws/token/:md5

Stream data for a specific token by its MD5 identifier. Ideal for detail pages and focused monitors.

Live Orderbook

wss://api.xrpl.to/ws/orderbook

Real-time orderbook depth updates for any trading pair on the XRPL DEX.

Ledger Updates

wss://api.xrpl.to/ws/ledger

Get notified on each new validated ledger with close time, transaction count, and fee summary.

Connect to Token Stream

Open a WebSocket connection and subscribe to token updates with just a few lines of JavaScript:

const ws = new WebSocket('wss://api.xrpl.to/ws/sync/');

ws.onopen = () => {
  // Subscribe to specific tokens by MD5 hash
  ws.send(JSON.stringify({
    action: 'subscribe',
    tokens: ['a1b2c3d4e5f6...']  // token MD5 identifiers
  }));
};

ws.onmessage = (event) => {
  const data = JSON.parse(event.data);
  console.log('Token update:', data);
};

ws.onclose = () => {
  // Reconnect after a short delay
  setTimeout(() => connectWebSocket(), 3000);
};

Message Format

Each price update message contains the token identifier, current price, 24-hour volume, and change percentage:

{
  "md5": "a1b2c3d4e5f6...",
  "currency": "USD",
  "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
  "price_xrp": "0.4521",
  "price_usd": "1.0002",
  "volume_24h": "1250000.00",
  "change_24h": "2.45",
  "market_cap": "52000000",
  "updated": 1717200000000
}

WebSocket vs REST Polling

Factor
WebSocket
REST Polling
Latency
Instant (sub-second)
1-10 seconds (poll interval)
Bandwidth
Low (delta updates only)
High (full response each poll)
API Credits
Single connection cost
Per-request cost adds up
Best For
Dashboards, bots, tickers
One-off lookups, batch jobs

Use Cases

Price Tickers

Embed live token prices on your website or app with instant updates.

Trading Bots

React to price movements in real time for automated trading strategies.

Portfolio Dashboards

Display live portfolio value without constant API polling.

Alert Systems

Trigger notifications when tokens hit target prices or volume spikes.

Get Started

Explore the full API documentation and related guides to start building with real-time XRPL data: