XRPL Token Search API
The search bar on xrpl.to runs on one public endpoint: send the text a user typed and get back the tokens, NFT collections and NFTs that match, best first. Use it for a token picker, a swap widget or a wallet’s search.
The request
curl -X POST "https://api.xrpl.to/v1/search" \
-H "Content-Type: application/json" \
-d '{"search": "solo", "limit": 3}'{
"success": true,
"order": [
"tokens",
"collections",
"nfts"
],
"tokens": [
{
"md5": "0413ca7cfc258dfaf698c02fe304e607",
"name": "SOLO",
"user": "Sologenic",
"issuer": "rsoLo2S1kiGeCcn6hCUXVrCpGMWLrRrLZz",
"exch": 0.007730218176286219,
"holders": 214745
},
{
"md5": "a1362a74d44de6727136dd130b2ddab0",
"name": "LP XRP/SOLO",
"issuer": "rMEJo9H5XvTe17UoAJzj8jtKVvTRcxwngo",
"exch": 0.00029504136304148057,
"holders": 837
},
{
"md5": "778dc748cbcafad204cf61135c5588b4",
"name": "SOLO",
"user": "SOLOGENIC",
"issuer": "r3aURbDvKHyk4utaNi6Egpg8fdyNCAtBXX",
"exch": 47.42019760227743,
"holders": 8
}
]
}The body takes search, and optionally limit (up to 100) and offset. Matches cover names, currency codes, issuer addresses and md5s.
An autocomplete
// Server side: keep your API key off the page.
async function searchTokens(query) {
const res = await fetch('https://api.xrpl.to/v1/search', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-Api-Key': process.env.XRPLTO_KEY },
body: JSON.stringify({ search: query, limit: 10 }),
});
const { tokens } = await res.json();
return tokens.map((t) => ({ md5: t.md5, name: t.name, issuer: t.issuer, price: t.exch }));
}
// In the browser: call your own route above, 250 ms after the last keystroke.
const debounce = (fn, ms) => { let h; return (...a) => { clearTimeout(h); h = setTimeout(() => fn(...a), ms); }; };Token logos come from GET https://api.xrpl.to/v1/thumb/{md5}?w=48, which needs the API key too: fetch them on your server and cache them, so the key never reaches the page.
Limits
- Without a key: 7 searches a minute per IP address, enough to try it.
- Free key: four times that; paid plans scale it further (plans and limits).
- When you hit a limit the answer is a 429 with a Retry-After header saying when to try again.
Mistakes to avoid
- Searching with GET /tokens?search= returns a different, paged shape; use POST /v1/search.
- Keeping only the name. Store the md5 or issuer and currency of the token the user chose.
- A request per keystroke. Wait for a pause in typing and keep recent answers for half a minute.
Any app that shows xrpl.to data must show a visible, clickable “Data by xrpl.to” credit beside it (API terms). More: token data API, API guide.
Questions
- How do I search XRP Ledger tokens by name?
- POST https://api.xrpl.to/v1/search with {"search": "your text"}. It returns matching tokens, NFT collections and NFTs, and the account when the text is an address.
- Do I need an API key to search?
- No, but without one the search allows 7 requests a minute per address; a free key raises that four times, and paid plans further.
- How do I tell two tokens with the same name apart?
- By issuer. Any account can issue a token called USD or SOLO, so store the md5 (or issuer and currency) the user picked, never the name alone.