Complete API reference, integration guides, and real-world examples. Get your first trade running in under 5 minutes.
Get up and running in 60 seconds
Sign up for a free account and generate your API key from the dashboard. Free tier includes 100 requests per day — perfect for testing.
curl -X GET 'https://api.dexflow.dev/v1/quote' \
-H 'X-API-Key: sk_live_your_api_key' \
-d 'from=ETH' \
-d 'to=USDC' \
-d 'amount=1000000000000000000'{
"success": true,
"data": {
"bestRoute": {
"dex": "Uniswap V3",
"amountOut": "1825430000",
"price": "1825.43",
"priceImpact": "0.12%",
"estimatedGas": "150000",
"gasPrice": "$12.40"
},
"savings": "2.3%",
"mevProtection": {
"safe": true,
"riskLevel": "low"
}
}
}DexFlow uses API keys to authenticate requests. Include your API key in theX-API-Key header:
Keep your API key secret
Never commit API keys to version control or expose them in client-side code. Use environment variables and keep them server-side.
/v1/quoteGet the best price for a token swap across all integrated DEXs
fromrequiredToken symbol to swap from (e.g., "ETH", "USDC", "WBTC")
torequiredToken symbol to swap to (e.g., "ETH", "USDC", "DAI")
amountrequiredAmount to swap in wei (for ETH) or smallest unit. Example: "1000000000000000000" = 1 ETH
slippageoptionalMaximum acceptable slippage percentage (default: 0.5)
{
"success": true,
"data": {
"request": {
"from": { "symbol": "ETH", "address": "0xEee..." },
"to": { "symbol": "USDC", "address": "0xA0b..." },
"amountIn": "1000000000000000000"
},
"bestRoute": {
"dex": "Uniswap V3",
"pool": "0x88e6...0.3%",
"amountOut": "1825430000",
"price": "1825.43",
"priceImpact": "0.12%",
"estimatedGas": "150000",
"gasPrice": "$12.40",
"netProfit": "$42.15"
},
"allRoutes": [
{
"dex": "Uniswap V3",
"price": "1825.43",
"score": 1850430
},
{
"dex": "SushiSwap",
"price": "1821.12",
"score": 1821120
}
],
"savings": "2.3%",
"quotesFound": 5,
"timestamp": "2024-11-24T12:34:56.789Z",
"mevAnalysis": {
"protected": true,
"riskLevel": "low",
"recommendation": "Safe to execute"
}
}
}const axios = require('axios');
const quote = await axios.get('https://api.dexflow.dev/v1/quote', {
headers: { 'X-API-Key': process.env.DEXFLOW_API_KEY },
params: {
from: 'ETH',
to: 'USDC',
amount: '1000000000000000000'
}
});
console.log(`Best price: $${quote.data.bestRoute.price}`);
console.log(`You save: ${quote.data.savings}`);import requests
import os
response = requests.get(
'https://api.dexflow.dev/v1/quote',
headers={'X-API-Key': os.getenv('DEXFLOW_API_KEY')},
params={'from': 'ETH', 'to': 'USDC', 'amount': '1000000000000000000'}
)
result = response.json()
print(f"Best price: {result['bestRoute']['price']}")
print(f"You save: {result['savings']}")