API
Aggregation as a service. One endpoint.
Drop cross-chain swap aggregation into your app. Call a single endpoint and get ranked routes with the calldata, approval target, and amounts you need to execute — sourced from numerous aggregators under the hood, with the best route first.
One endpoint
Quote, calldata & approval in a single call.
Numerous aggregators
Queried in parallel, ranked by best output.
No key needed (beta)
Open CORS — call it from anywhere today.
11 chains
Same-chain swaps and cross-chain bridges.
Try it live
Pick an endpoint, tweak the pre-filled defaults, and fire a real request against the live API. The quote example is ready to send — hit Send request and watch a ranked route come back with executable calldata.
/api/v1/quoteQuery every aggregator in parallel and return ranked routes. Supply a takerAddress to get an executable route (calldata + approval target); omit it for an indicative preview.
Examples
Token address, or the native sentinel 0xEeee…eEeE
0.01 ETH = 10000000000000000 (18 decimals)
Required for executable calldata. Sample address prefilled — swap in your user's wallet.
50 = 0.5%
cURL
curl -X POST 'https://www.swaproute.xyz/api/v1/quote' \
-H 'Content-Type: application/json' \
-d '{"fromChainId":8453,"fromToken":"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE","toChainId":8453,"toToken":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","amountRaw":"10000000000000000","takerAddress":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","slippageBps":50}'Runs against the live API. Rate-limited per IP.
Response
Quickstart
Base URL https://www.swaproute.xyz/api/v1. Supply a takerAddress to get executable calldata; omit it for an indicative preview. Poll /status with a route's tracking.ref to follow cross-chain settlement.
const res = await fetch("https://www.swaproute.xyz/api/v1/quote", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
fromChainId: 8453,
fromToken: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", // native ETH
toChainId: 8453,
toToken: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", // USDC on Base
amountRaw: "10000000000000000", // 0.01 ETH
takerAddress: userWallet, // for calldata
}),
});
const { mode, routes } = await res.json();
const best = routes[0];
// best.transaction → { to, data, value } ready to send
// best.approval → { token, spender, amount } (absent for native sells)Endpoint reference
/api/v1/quote·Get a quoteQuery every aggregator in parallel and return ranked routes. Supply a takerAddress to get an executable route (calldata + approval target); omit it for an indicative preview.
Request body
fromChainIdnumberrequiredSource chain ID.
fromTokenstringrequiredSell-token address, or the EIP-7528 native sentinel.
toChainIdnumberrequiredDestination chain ID.
toTokenstringrequiredBuy-token address, or the native sentinel.
amountRawstringrequiredSell amount in base units (positive integer string).
takerAddressstringConnected wallet. Required to receive executable calldata; omit for a preview.
recipientAddressstringAlternate destination; defaults to the taker.
slippageBpsnumberSlippage tolerance in basis points (default 50).
fromTokenMeta / toTokenMetaobject{ decimals, symbol } for tokens not in our registry so they can be priced/routed.
Response
mode"live" | "preview"required"live" when routes are executable (taker supplied), else "preview".
routes[]PublicRoute[]requiredRanked best-output-first.
routes[].routeIdstringrequiredOpaque route identifier.
routes[].estimatedOut / minOutstringrequiredExpected and guaranteed-minimum output, base units.
routes[].approvalobject?{ token, spender, amount } — approve this before sending (absent for native sells).
routes[].transactionobject?{ to, data, value, gas } — the executable transaction (live mode only).
routes[].feesobjectrequiredUSD fee breakdown: networkFeeUsd, bridgeFeeUsd, aggregatorFeeUsd, serviceFeeUsd, totalUsd.
routes[].tracking.refstring?Opaque handle to poll GET /api/v1/status.
/api/v1/status·Track a swapStatus of a submitted swap (same- or cross-chain) by the opaque ref from a route's tracking.ref, plus the source tx hash.
Query parameters
refstringrequiredThe route's tracking.ref (from a quote).
txHashstringSource-chain tx hash (required for same-chain and 0x cross-chain).
Response
state"pending" | "success" | "failed"requiredNormalized settlement state.
statusstringrequiredRaw upstream status string.
/api/v1/tokens/search·Search tokensLive token search across the registry and upstream metadata for a chain.
Query parameters
qstringrequiredSearch term (min 2 chars) or a token address.
chainIdnumberrequiredChain to search.
limitnumberMax results, 1–100 (default 40).
Response
tokens[]PublicToken[]requiredMatched tokens.
sources[]string[]requiredWhere results came from: "local" and/or "live".
/api/v1/tokens·List tokensFilterable, paginated token list from the registry.
Query parameters
chainIdnumberFilter to one chain.
qstringSubstring match on symbol/name (or exact address).
limitnumberPage size, 1–1000 (default 100).
offsetnumberPage offset.
Response
tokens[]PublicToken[]requiredPage of tokens.
totalnumberrequiredTotal matches before paging.
/api/v1/chains·List chainsChains the aggregation API can route across.
Response
chains[]object[]required{ chainId, key, name, shortName, nativeSymbol, logoURI, explorer, isL2 }.