Build trading bots, portfolio trackers, and analytics dashboards with real-time DEX data from the XRP Ledger.
The XRPL.to DEX API covers the full trading lifecycle on the XRP Ledger's built-in decentralized exchange. You can query trade history, pull live orderbook depth, get swap quotes, check exchange rates, discover trading pairs, and submit signed transactions. All endpoints return JSON and work without authentication for basic usage.
Retrieve recent trades for any token. Filter by token, account, or time range.
curl https://api.xrpl.to/v1/history?md5=TOKEN_MD5&limit=50
Each trade record includes the price, volume, timestamp, buyer/seller accounts, and transaction hash. You can also filter by a specific account to see their trading history:
curl https://api.xrpl.to/v1/history?account=rAddress&limit=20
Get current bid/ask depth for any trading pair on the XRPL DEX.
fetch('https://api.xrpl.to/v1/orderbook?base=TOKEN_MD5')
.then(res => res.json())
.then(data => {
console.log('Bids:', data.bids.length);
console.log('Asks:', data.asks.length);
console.log('Best bid:', data.bids[0]?.price);
console.log('Best ask:', data.asks[0]?.price);
});The orderbook response includes price, amount, and account for each order on both sides.
Get a swap quote before executing a trade. The quote endpoint calculates the best path through the DEX and any AMM pools.
curl -X POST https://api.xrpl.to/v1/dex/quote \
-H "Content-Type: application/json" \
-d '{"source_token":"XRP","destination_token":"TOKEN_MD5","amount":"100"}'Returns the expected output amount, price impact, and the transaction payload ready for signing.
Fetch current exchange rates between token pairs.
curl https://api.xrpl.to/v1/stats/rates
Useful for displaying real-time prices in wallets, portfolio trackers, and trading interfaces.
Discover all available trading pairs for a given token.
curl https://api.xrpl.to/v1/pairs/TOKEN_MD5
Returns a list of tokens that have active order book depth or AMM pools against the queried token.
Submit signed XRPL transactions or preview them with a dry-run before broadcasting.
# Dry-run (preview without submitting)
curl -X POST https://api.xrpl.to/v1/submit/preview \
-H "Content-Type: application/json" \
-d '{"tx_blob":"SIGNED_TX_BLOB"}'
# Submit to the network
curl -X POST https://api.xrpl.to/v1/submit \
-H "Content-Type: application/json" \
-d '{"tx_blob":"SIGNED_TX_BLOB"}'Always preview transactions before submitting to verify the expected outcome. See the API documentation for transaction format details.