SwapRouter
Cotiza, reserva y rastrea intercambios de criptomonedas sin custodia a Monero o cualquier otra moneda. Mejor ruta, código QR de depósito y seguimiento. Sin cuenta ni autenticación.
Servidor MCP alojado
npx add-mcp 'https://swaprouter.app/mcp'Se instala en Claude Code, Codex, Cursor y más
Documentación
Build on it
Add swaps to your site or app. You earn half of what we earn on every swap you send us.
Widget
One tag. It's an iframe from our domain, so wallets and addresses never touch your page. With your public key, it can only be framed by your own sites.
<script src="https://swaprouter.app/embed.js" async></script>
<swap-widget key="pk_…" from="base:0x8335…2913" to="monero:native" amount="100"></swap-widget>
It tells your page when a swap is created and when its state changes:
const widget = document.querySelector('swap-widget');
widget.addEventListener('swap.updated', (e) => console.log(e.detail.state));
Payment links
Create a payment link to share directly or copy as an HTML button or iframe. No account is needed. The payer picks a different coin to send. The card locks the payout coin and address. A fixed amount uses exact-payout routes. USD amounts use the payout coin’s price when the link opens and need a USD price for that coin.
The iframe uses /embed with the same fragment as /pay. Keep everything after # in the fragment. The recipient address goes to the swap API at booking. The description comes from whoever made the link. Check the full address before paying, and check your wallet for receipt if you’re the payee.
Add ?r=CODE before # to credit a partner share code. An embed’s public key takes precedence. Use the usual theme parameters before #.
Deposit and withdraw
Set the coins on your app in the partner dashboard, then add flow and the user's address on your app. Your key then only quotes and books swaps into those coins (deposit) or out of them (withdraw).
<swap-widget key="pk_…" flow="withdraw" address="USER_ADDRESS"></swap-widget>
Deposit locks "You get" to your coins and fills in the payout address. Withdraw locks "You send" and fills in the refund address. The address goes after # in the frame's URL, so it never reaches our server.
With your key, the widget also sends swap.deposit with { swapId, asset, address, memo, amount }, so your app can send the deposit for the user.
Your theme
<swap-widget theme="light" accent="#ff5500" button-text="#14161a"
radius="12" font="Arial, sans-serif"></swap-widget>
Choose light, dark (default) or auto. The same settings work as /embed query parameters. Use local system fonts; iframe fonts are separate from your page. No fonts are downloaded.
Tokens: background, surface, border, text, muted, accent, button-text (hex, rgb or hsl); radius (0–32 px); font (family list); scale (0.875–1.25). Invalid values are ignored.
API
For your own UI, use the SDK: quoteStream for live routes, createSwap to book, then getSwap or signed webhooks to track it.
Quote, book and track swaps from your server. Money is always an integer string in the asset's smallest unit. Full reference: OpenAPI spec.
import { SwapClient } from '@swap/sdk';
const api = new SwapClient({ baseUrl: 'https://swaprouter.app', secretKey: process.env.SWAP_SECRET_KEY });
const quote = await api.quote({ from: 'base:0x8335…2913', to: 'monero:native', amount: '100000000' });
const { secret, swap } = await api.createSwap(
{ routeId: quote.routes[0].id, recipient, refundAddress, clientReference: 'order-123' },
{ idempotencyKey: 'order-123' },
);
Taking a payment? Pass exactOut: true and amount is what the recipient gets, exactly: fixed-rate, one-step routes ranked by the least to send (costIn). The widget takes mode="fixed" too.
Each route has kycRisk and privacy (0–5, what we must keep or send about the user for its providers; absent when unscored). Pass maxPrivacy: true for only routes with low KYC risk and privacy 5. Each leg has kind (exchange, bridge or dex) and noKyc: true when its provider says it never asks for ID.
Quotes may carry prices: USD per whole unit of the two coins, in micro-USD ("1000000" is $1), only for coins with a known price. Dollar value = amount × price / 10 decimals.
Use your secret key only on your server. Send the same Idempotency-Key when you retry and you get the first swap back, never a second booking.
MCP
AI agents can quote, book and track swaps through our MCP server at /mcp (Streamable HTTP, no key). Booking only returns a deposit address and QR; nothing moves until the user sends.
Live rates and limits
The rates table on the home and pair pages is the same for every visitor, people and crawlers alike, and is checked every 10 minutes. Amounts are what the user receives after the providers' fees, for the amount sent at a floating rate. Some providers publish a minimum and maximum per coin; outside them that provider simply returns no route, and the others still quote.
Webhooks
We POST swap.updated to your URL whenever a swap's state changes, signed with your webhook secret. Retries back off for about two days. Each event's id stays the same across retries.
import { verifyWebhook } from '@swap/sdk';
const ok = await verifyWebhook(webhookSecret, req.headers.get('Swap-Signature') ?? '', rawBody);
Keys
Make them on your partner account: a public key for the widget, a secret key for your server and a webhook secret, each shown once.
Providers
All providers are on by default. Turn any off on your partner account. Requests with your keys, your embed or MCP calls made with your key never ask them, and booking refuses a route through them. Quotes then list them in disabledProviders. With every provider off, quotes answer 409 no_providers_enabled.