Migrate from 1inch API to swapapi
TL;DR
swapapi is a drop-in alternative to 1inch's Swap API. No API key, no SDK, no account. One GET request returns the same calldata you're used to — across 46 EVM chains instead of ~10.
Why Developers Switch
API Key Registration
1inch requires creating an account and generating an API key before making any requests. swapapi requires nothing — start with a curl command in 30 seconds.
Restrictive Rate Limits
1inch rate limits vary by plan. The free tier is restrictive and paid plans can be expensive for high-volume applications. swapapi has generous rate limits with no paid tiers.
Breaking API Changes
1inch changed their swap endpoint from GET to POST, breaking existing integrations. swapapi uses a simple GET request and maintains backward compatibility.
Zero Setup
No SDK installation, no account creation, no environment variables. swapapi works with raw HTTP from any language, any platform, any autonomous agent.
Parameter Mapping
Most parameters map directly. The main differences are naming and slippage format.
| 1inch Parameter | swapapi Parameter | Notes |
|---|---|---|
| src | tokenIn | Same format (0x address) |
| dst | tokenOut | Same format (0x address) |
| amount | amount | Same (raw units, no decimals) |
| from | sender | Same (wallet address) |
| slippage | maxSlippage | 1inch: 1-50 (percentage). swapapi: 0-1 (decimal). 1inch slippage=1 is swapapi maxSlippage=0.01 |
| Authorization header | (not needed) | swapapi requires no authentication |
Before and After
1inch (before):
curl -X GET \
"https://api.1inch.dev/swap/v6.0/1/swap" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
--data '{
"src": "0xEeee...EEeE",
"dst": "0xA0b8...eB48",
"amount": "1000000000000000000",
"from": "0xd8dA...6045",
"slippage": 1
}'
swapapi (after):
curl "https://api.swapapi.dev/v1/swap/1?\
tokenIn=0xEeee...EEeE&\
tokenOut=0xA0b8...eB48&\
amount=1000000000000000000&\
sender=0xd8dA...6045"
# No API key
# No headers
# No request body
# Just a GET request
Response Differences
swapapi wraps every response in an envelope with a success flag and timestamp. The transaction data is structurally similar.
1inch response:
{
"tx": {
"from": "0xd8dA...6045",
"to": "0x...router",
"data": "0x...calldata",
"value": "1000000000000000000",
"gas": 250000 // number — unsafe for large values
}
}
swapapi response:
{
"success": true, // always check this first
"data": {
"status": "Successful", // "Successful" | "Partial" | "NoRoute"
"swapPrice": 2847.53, // exchange rate
"priceImpact": 0.0012, // 0.12% as decimal
"amountIn": "1000000000000000000", // string — BigInt safe
"expectedAmountOut": "2847530000", // string — BigInt safe
"tx": {
"from": "0xd8dA...6045",
"to": "0x...router",
"data": "0x...calldata",
"value": "1000000000000000000",
"gas": "250000" // string — BigInt safe
},
"rpcUrls": ["https://..."] // bonus: RPC endpoints for the chain
},
"timestamp": "2026-03-20T..." // ISO 8601
}
Key differences: swapapi adds a success envelope, a status field (Successful/Partial/NoRoute), price impact data, and RPC URLs. All BigInt values are returned as strings to prevent JavaScript precision loss.
What You Gain and What You Lose
What You Gain
- No authentication overhead — no keys, no headers, no secrets
- 46 EVM chains (vs ~10 on 1inch)
- BigInt-safe string serialization for all large numbers
- Built-in RPC URLs in every response
- AI-agent ready — designed for autonomous systems
- Consistent JSON envelope with status and price impact
What You Lose
- No Fusion mode (gasless swaps via resolvers)
- No limit orders API
- No portfolio/balance tracking API
- No cross-chain swaps (for that, consider Li.Fi)
Migration Checklist
- Replace base URL:
api.1inch.dev/swap/v6.0/{chainId}toapi.swapapi.dev/v1/swap/{chainId} - Remove Authorization header
- Rename
srctotokenIn - Rename
dsttotokenOut - Rename
fromtosender - Convert slippage: divide by 100 (e.g.,
slippage=1becomesmaxSlippage=0.01) - Update response parsing: unwrap
response.data.txinstead ofresponse.tx - Test with a small amount first
