Core Endpoints V2
Route and Calldata (V2)
Get route and calldata in a single V2 API request
GET
Overview
The Route and Calldata V2 endpoint combines route finding and calldata generation in a single request, reducing API calls and latency. This is a V2-only endpoint that provides enhanced features including integrator support and metadata. Currently available on EVM networks.This endpoint is V2-only and currently available on EVM networks. For V1, use separate
/route and /calldata endpoints.Endpoint
- EVM Networks
Query Parameters
string
required
The amount of input tokens in wei format. For tokens with 18 decimals, multiply the amount by 10^18.Example:
"1000000000000000000" for 1 tokenstring
required
The address of the input token.Example:
"0x0000000000000000000000000000000000000000" for native tokenstring
required
The address of the output token.Example:
"0x3bd359c1119da7da1d913d1c4d2b7c461115433a" for wrapped tokenboolean
Not supported yet - reserved for future use. Default:
falseboolean
If true, only direct swaps between the input and output tokens will be considered. Default:
falsestring
Comma-separated list of protocol IDs to exclude from routing (e.g., “1,2,3”). Default:
""number
required
Maximum acceptable slippage percentage (0-49, e.g., 0.5 for 0.5%).
string
required
Recipient address for the output tokens.
string
Integrator wallet address to receive fees or surplus. Requires API key authentication.
number
Integrator fee percentage in basis points (0-500, maximum 5%). Cannot be used together with integratorSurplusPercentageBps.
number
Integrator surplus percentage in basis points (0-5000, maximum 50%). Cannot be used together with integratorFeePercentageBps.
Response
object
The complete route response object (same structure as
/v2/route endpoint).object
Transaction calldata for executing the swap.
string
Router contract address for executing the swap.
object
required
API metadata including version and timestamp.
When to Use This Endpoint
Use This Endpoint
- Single-step swap execution
- Minimizing API calls
- Reducing latency
- Simple integrations
- Immediate execution needed
Use Separate Endpoints
- Need to display route preview
- User confirmation required
- Complex routing logic
- Custom route manipulation
- Two-step flow preferred
Benefits Over V1 Approach
V1 (2 API calls):- GET
/route- Get optimal route - GET
/calldata- Generate calldata from route
- GET
/v2/routeAndCalldata- Get route and calldata together
- API latency (one round trip instead of two)
- API call count (50% reduction)
- Code complexity (single request handling)
Best Practices
- Verify min_received - Always check that the minimum received amount matches your expectations. Note that if integrator fees are used,
min_receivedalready accounts for the fee deduction. - Check destination - Ensure the destination address is correct before executing
- Use fresh data - This endpoint provides fresh route and calldata, ideal for immediate execution
- Monitor meta.timestamp - Track when the response was generated for debugging
Related Endpoints
- Route V2 - Get route only
- Calldata V2 - Generate calldata from existing route
- V2 Migration Guide - Complete migration guide