Send a GET request
Pass chain, tokens, amount, and sender address as query params. That's the entire interface — one GET request.
No API keys. No accounts. Returns executable calldata. Built for AI agents and autonomous systems.
$ curl "https://api.swapapi.xyz/v1/swap/1?\ tokenIn=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE&\ tokenOut=0x6B3595068778DD592e39A122f4f5a5cF09C90fE2&\ amount=1000000000000000000&\ sender=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
{ "success": true, "data": { "status": "Successful", "tokenFrom": { "symbol": "ETH", "decimals": 18 }, "tokenTo": { "symbol": "USDC", "decimals": 6 }, "swapPrice": 2500.0, "priceImpact": 0.0012, "amountIn": "1000000000000000000", "expectedAmountOut": "2500000000", "tx": { "to": "0x...router", "data": "0x...calldata", "value": "1000000000000000000", "gas": "250000" } }, "timestamp": "2026-03-12T00:00:00.000Z" }
How it works
Pass chain, tokens, amount, and sender address as query params. That's the entire interface — one GET request.
Your request is routed across DEX liquidity pools on 46 chains. Best price, lowest slippage, optimized gas.
The response includes a ready-to-sign tx object. Submit it on-chain with any wallet or signer library.
Why this exists
Every other swap API requires registration. AI agents can't sign up for accounts. We removed the barrier entirely.
No OAuth, no headers, no tokens. A raw HTTP GET is all you need. Works from curl, from code, from an autonomous agent.
You don't just get a quote — you get a complete transaction object ready to sign and broadcast. No extra steps.
We make money on positive slippage, not on you. Your quoted price is our commitment — if we can do better, we keep the difference.
Supported chains
Response format
Every response follows the same envelope. Parse success first, then read data.
{ "success": true, // always check this first "data": { "status": "Successful", // "Successful" | "Partial" | "NoRoute" "tokenFrom": { // input token metadata "address": "0xEeee...EEeE", "symbol": "ETH", "name": "Ether", "decimals": 18 }, "tokenTo": { // output token metadata "address": "0xA0b8...eB48", "symbol": "USDC", "name": "USD Coin", "decimals": 6 }, "swapPrice": 2847.53, // exchange rate "priceImpact": 0.0012, // 0.12% — ratio, not percentage "amountIn": "1000000000000000000", // raw amount (BigInt as string) "expectedAmountOut": "284753...", // raw expected output "tx": { // ready-to-sign transaction "from": "0xd8dA...6045", // your sender address "to": "0x...router", // router contract "data": "0x...calldata", // encoded swap calldata "value": "1000000000000000000", // ETH to send (for native swaps) "gas": "250000" // estimated gas limit } }, "timestamp": "2026-03-12T..." // ISO 8601 }
{ "success": false, "error": { "code": "INVALID_PARAMS", // machine-readable error code "message": "Invalid token...", // human-readable description "details": {} // optional additional context }, "timestamp": "2026-03-12T..." }
GET /v1/swap/{chainId} chainId path required Blockchain network ID (46 chains supported) tokenIn query required Input token address (0x...) tokenOut query required Output token address (0x...) amount query required Amount in raw units (no decimals) sender query required Sender address for tx.from maxSlippage query optional Slippage tolerance 0-1 (default: 0.005)