swapapi
No authentication required. A single GET request returns executable calldata across 46 EVM chains. Built for developers, bots, and AI agents.
Last updated:
A DEX aggregator searches multiple decentralized exchanges simultaneously to find the best swap rate for a token trade. Instead of checking Uniswap, SushiSwap, and Curve individually, a DEX aggregator checks all of them in one request and routes your trade through the optimal path.
Fundamentals
A decentralized exchange (DEX) lets you swap tokens directly on-chain, with no intermediary holding your funds.
Aggregation
A DEX aggregator solves the fragmented liquidity problem by searching across all available DEXs at once.
Step by step
You specify what you want to trade: the input token, output token, amount, and chain. For example, swap 10 ETH for USDC on Ethereum.
The aggregator checks every available liquidity source on that chain — Uniswap V2, V3, Curve, Balancer, SushiSwap, and dozens more — to find where your trade gets the most output tokens.
The routing algorithm determines the best path. It might split 60% through Uniswap V3 and 40% through Curve, or route through an intermediate token if that yields a better price.
The aggregator returns a ready-to-sign transaction with the router contract address, encoded calldata, and the value to send. No further computation needed on your end.
Sign the transaction with your wallet and submit it to the blockchain. The router contract executes the optimized swap path atomically — either the entire trade succeeds or it reverts.
$ curl "https://api.swapapi.dev/v1/swap/1?\ tokenIn=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE&\ tokenOut=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&\ amount=10000000000000000000&\ sender=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
{ "success": true, "data": { "status": "Successful", "tokenFrom": { "symbol": "ETH", "decimals": 18 }, "tokenTo": { "symbol": "USDC", "decimals": 6 }, "swapPrice": 2847.53, "priceImpact": 0.0012, "amountIn": "10000000000000000000", "expectedAmountOut": "28475300000", // ~28,475 USDC "tx": { "to": "0x...router", "data": "0x...calldata", "value": "10000000000000000000", "gas": "350000" } }, "timestamp": "2026-03-20T00:00:00.000Z" }
Comparison
| Feature | Direct DEX (e.g., Uniswap) | DEX Aggregator (e.g., swapapi) |
|---|---|---|
| Best price | Only from one DEX | Best across all DEXs |
| Route optimization | Single pool | Multi-hop, split routes |
| Integration effort | Different SDK per DEX | One API for all DEXs |
| Chain coverage | Usually 1-3 chains | 46 chains (swapapi) |
| Maintenance | Update when DEX changes | Aggregator handles updates |
For developers
Most DEX aggregators offer APIs for programmatic access, making them the backbone of automated trading and DeFi applications.
# No API key. No SDK. Just a GET request. $ curl "https://api.swapapi.dev/v1/swap/1?\ tokenIn=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE&\ tokenOut=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&\ amount=1000000000000000000&\ sender=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
Landscape
No authentication required. A single GET request returns executable calldata across 46 EVM chains. Built for developers, bots, and AI agents.
The largest DEX aggregator by volume. Requires API key registration. Offers additional features like gasless swaps (Fusion mode) and limit orders.
Professional-grade swap API with strong Ethereum and L2 liquidity. Requires API key. Oriented toward enterprise integrations with usage-based pricing.
Competitive rates with a focus on gas optimization. Requires API key. Uses a two-step flow: GET for quotes, POST for building transactions.
Cross-chain focused aggregator that bridges and swaps in a single transaction. Best choice when you need cross-chain swaps.
The dominant aggregator on Solana. Free and fast, but Solana-only — no EVM chain support.
For a detailed side-by-side comparison, see DEX Aggregator API Comparison. Ready to start building? Read the step-by-step tutorial. Building a trading bot? Check the trading bot guide.