Calculate the optimal swap route and generate execution parameters for a token exchange
get/v1/route
Query parameters
amountInstring required
Example:5000000000
The amount of input tokens to swap (in token's smallest unit)
tokenInstring required
Example:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Contract address of the input token to sell. The zero address (0x00…00) represents the native currency ETH.
tokenOutstring required
Example:0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Contract address of the output token to buy. The zero address (0x00…00) represents the native currency ETH.
slippageBpsinteger
The slippage tolerance in basis points (e.g., 50 for 0.5%)
timeoutinteger
Optional timeout in milliseconds. If set, returns the best pathfinder result within the timeout window. Must be a positive integer.
Response
Successfully calculated swap route with execution details
Example response
{
"gasUsed": 180000,
"gasLimit": 234000
}