curl -L \
"https://api.fibrous.finance/{network}/v2/routeAndCalldata?amount=1000000000000000000&tokenInAddress=0x0000000000000000000000000000000000000000&tokenOutAddress=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&slippage=0.5&destination=0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb" \
--header "Accept: */*"
const axios = require('axios');
const params = {
amount: '1000000000000000000',
tokenInAddress: '0x0000000000000000000000000000000000000000',
tokenOutAddress: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
slippage: 0.5,
destination: '0x1234567890123456789012345678901234567890'
};
axios.get('https://api.fibrous.finance/{network}/v2/routeAndCalldata', { params })
.then(response => {
const { route, calldata, router_address, meta } = response.data;
console.log(`API Version: ${meta.apiVersion}`);
// Use calldata to execute transaction
console.log(`Router: ${router_address}`);
})
.catch(error => console.error(error));
import requests
url = "https://api.fibrous.finance/{network}/v2/routeAndCalldata"
params = {
"amount": "1000000000000000000",
"tokenInAddress": "0x0000000000000000000000000000000000000000",
"tokenOutAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"slippage": 0.5,
"destination": "0x1234567890123456789012345678901234567890"
}
response = requests.get(url, params=params)
data = response.json()
print(f"API Version: {data['meta']['apiVersion']}")
print(f"Router Address: {data['router_address']}")
# Use data['calldata'] to execute transaction
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
public class FibrousRouteAndCallData {
public static void main(String[] args) throws Exception {
String baseUrl = "https://api.fibrous.finance/{network}/v2/routeAndCalldata";
String params = "amount=1000000000000000000" +
"&tokenInAddress=0x0000000000000000000000000000000000000000" +
"&tokenOutAddress=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" +
"&slippage=0.5" +
"&destination=0x1234567890123456789012345678901234567890";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(baseUrl + "?" + params))
.header("Accept", "*/*")
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println("Response: " + response.body());
}
}
package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL := "https://api.fibrous.finance/{network}/v2/routeAndCalldata"
params := url.Values{}
params.Add("amount", "1000000000000000000")
params.Add("tokenInAddress", "0x0000000000000000000000000000000000000000")
params.Add("tokenOutAddress", "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913")
params.Add("slippage", "0.5")
params.Add("destination", "0x1234567890123456789012345678901234567890")
req, err := http.NewRequest("GET", baseURL+"?"+params.Encode(), nil)
if err != nil {
panic(err)
}
req.Header.Set("Accept", "*/*")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println("Response:", string(body))
}
{
"route": {
"success": true,
"routeSwapType": 0,
"inputToken": {
"name": "Wrapped Ether",
"address": "0x4200000000000000000000000000000000000006",
"decimals": 18,
"price": 2949.717076112869
},
"inputAmount": "1000000000000000000",
"outputToken": {
"name": "USD Coin",
"address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"decimals": 6,
"price": 0.999597487941284
},
"outputAmount": "2951108576",
"time": 3.285,
"estimatedGasUsed": "0",
"estimatedGasUsedInUsd": 0,
"route": [
{
"percent": "35%",
"swaps": [
[
{
"protocol": 3,
"poolName": "Aerodrome Slipstream",
"poolAddress": "0xb2cc224c1c9fee385f8ad6a55b4d94e92359dc59",
"fromTokenAddress": "0x4200000000000000000000000000000000000006",
"toTokenAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"percent": "48.57%",
"extraData": {
"tickSpacing": 100
}
}
]
]
}
],
"bestQuotesByProtocols": [],
"initial": false,
"meta": {
"apiVersion": "2.0",
"timestamp": "2026-01-24T21:46:39.518Z"
}
},
"calldata": {
"route": {
"token_in": "0x4200000000000000000000000000000000000006",
"token_out": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"amount_in": "1000000000000000000",
"amount_out": "2951108576",
"min_received": "2936407033",
"destination": "0x1234567890123456789012345678901234567890",
"swap_type": 0
},
"swap_parameters": [
{
"token_in": "0x4200000000000000000000000000000000000006",
"token_out": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"rate": "2951108576",
"protocol_id": "3",
"pool_address": "0xb2cc224c1c9fee385f8ad6a55b4d94e92359dc59",
"swap_type": 0,
"extra_data": "0x0064"
}
]
},
"router_address": "0x274602a953847d807231d2370072f5f4e4594b44",
"meta": {
"apiVersion": "2.0",
"timestamp": "2026-01-24T21:46:40.000Z"
}
}
Core Endpoints V2
Route and Calldata (V2)
Get route and calldata in a single V2 API request
GET
/
{network}
/
v2
/
routeAndCalldata
curl -L \
"https://api.fibrous.finance/{network}/v2/routeAndCalldata?amount=1000000000000000000&tokenInAddress=0x0000000000000000000000000000000000000000&tokenOutAddress=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&slippage=0.5&destination=0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb" \
--header "Accept: */*"
const axios = require('axios');
const params = {
amount: '1000000000000000000',
tokenInAddress: '0x0000000000000000000000000000000000000000',
tokenOutAddress: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
slippage: 0.5,
destination: '0x1234567890123456789012345678901234567890'
};
axios.get('https://api.fibrous.finance/{network}/v2/routeAndCalldata', { params })
.then(response => {
const { route, calldata, router_address, meta } = response.data;
console.log(`API Version: ${meta.apiVersion}`);
// Use calldata to execute transaction
console.log(`Router: ${router_address}`);
})
.catch(error => console.error(error));
import requests
url = "https://api.fibrous.finance/{network}/v2/routeAndCalldata"
params = {
"amount": "1000000000000000000",
"tokenInAddress": "0x0000000000000000000000000000000000000000",
"tokenOutAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"slippage": 0.5,
"destination": "0x1234567890123456789012345678901234567890"
}
response = requests.get(url, params=params)
data = response.json()
print(f"API Version: {data['meta']['apiVersion']}")
print(f"Router Address: {data['router_address']}")
# Use data['calldata'] to execute transaction
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
public class FibrousRouteAndCallData {
public static void main(String[] args) throws Exception {
String baseUrl = "https://api.fibrous.finance/{network}/v2/routeAndCalldata";
String params = "amount=1000000000000000000" +
"&tokenInAddress=0x0000000000000000000000000000000000000000" +
"&tokenOutAddress=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" +
"&slippage=0.5" +
"&destination=0x1234567890123456789012345678901234567890";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(baseUrl + "?" + params))
.header("Accept", "*/*")
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println("Response: " + response.body());
}
}
package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL := "https://api.fibrous.finance/{network}/v2/routeAndCalldata"
params := url.Values{}
params.Add("amount", "1000000000000000000")
params.Add("tokenInAddress", "0x0000000000000000000000000000000000000000")
params.Add("tokenOutAddress", "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913")
params.Add("slippage", "0.5")
params.Add("destination", "0x1234567890123456789012345678901234567890")
req, err := http.NewRequest("GET", baseURL+"?"+params.Encode(), nil)
if err != nil {
panic(err)
}
req.Header.Set("Accept", "*/*")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println("Response:", string(body))
}
{
"route": {
"success": true,
"routeSwapType": 0,
"inputToken": {
"name": "Wrapped Ether",
"address": "0x4200000000000000000000000000000000000006",
"decimals": 18,
"price": 2949.717076112869
},
"inputAmount": "1000000000000000000",
"outputToken": {
"name": "USD Coin",
"address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"decimals": 6,
"price": 0.999597487941284
},
"outputAmount": "2951108576",
"time": 3.285,
"estimatedGasUsed": "0",
"estimatedGasUsedInUsd": 0,
"route": [
{
"percent": "35%",
"swaps": [
[
{
"protocol": 3,
"poolName": "Aerodrome Slipstream",
"poolAddress": "0xb2cc224c1c9fee385f8ad6a55b4d94e92359dc59",
"fromTokenAddress": "0x4200000000000000000000000000000000000006",
"toTokenAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"percent": "48.57%",
"extraData": {
"tickSpacing": 100
}
}
]
]
}
],
"bestQuotesByProtocols": [],
"initial": false,
"meta": {
"apiVersion": "2.0",
"timestamp": "2026-01-24T21:46:39.518Z"
}
},
"calldata": {
"route": {
"token_in": "0x4200000000000000000000000000000000000006",
"token_out": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"amount_in": "1000000000000000000",
"amount_out": "2951108576",
"min_received": "2936407033",
"destination": "0x1234567890123456789012345678901234567890",
"swap_type": 0
},
"swap_parameters": [
{
"token_in": "0x4200000000000000000000000000000000000006",
"token_out": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"rate": "2951108576",
"protocol_id": "3",
"pool_address": "0xb2cc224c1c9fee385f8ad6a55b4d94e92359dc59",
"swap_type": 0,
"extra_data": "0x0064"
}
]
},
"router_address": "0x274602a953847d807231d2370072f5f4e4594b44",
"meta": {
"apiVersion": "2.0",
"timestamp": "2026-01-24T21:46:40.000Z"
}
}
Important: If integrator fees are used (integratorFeePercentageBps > 0), the
min_received value in the calldata response will be the amount after fees have been deducted and slippage has been applied. This ensures the minimum received amount accounts for the integrator fee that will be taken from the output.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
https://api.fibrous.finance/{network}/v2/routeAndCalldata
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.
API Key Required: Integrator features (integratorAddress, integratorFeePercentageBps or integratorSurplusPercentageBps) require an API key. Generate and manage your API keys at the Fibrous Partnership Portal. Include the API key in the request headers as
X-API-Key.Response
object
The complete route response object (same structure as
/v2/route endpoint).Show child attributes
Show child attributes
boolean
Indicates if the route calculation was successful.
object
Details about the input token.
object
Details about the output token.
string
The estimated amount of output tokens in wei format.
array
Array of route segments with detailed swap information.
object
API metadata including version and timestamp.
object
Transaction calldata for executing the swap.
Show child attributes
Show child attributes
object
Route information for the calldata.
Show child attributes
Show child attributes
array
Array of swap parameters for each hop in the route.
string
Router contract address for executing the swap.
object
required
curl -L \
"https://api.fibrous.finance/{network}/v2/routeAndCalldata?amount=1000000000000000000&tokenInAddress=0x0000000000000000000000000000000000000000&tokenOutAddress=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&slippage=0.5&destination=0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb" \
--header "Accept: */*"
const axios = require('axios');
const params = {
amount: '1000000000000000000',
tokenInAddress: '0x0000000000000000000000000000000000000000',
tokenOutAddress: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
slippage: 0.5,
destination: '0x1234567890123456789012345678901234567890'
};
axios.get('https://api.fibrous.finance/{network}/v2/routeAndCalldata', { params })
.then(response => {
const { route, calldata, router_address, meta } = response.data;
console.log(`API Version: ${meta.apiVersion}`);
// Use calldata to execute transaction
console.log(`Router: ${router_address}`);
})
.catch(error => console.error(error));
import requests
url = "https://api.fibrous.finance/{network}/v2/routeAndCalldata"
params = {
"amount": "1000000000000000000",
"tokenInAddress": "0x0000000000000000000000000000000000000000",
"tokenOutAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"slippage": 0.5,
"destination": "0x1234567890123456789012345678901234567890"
}
response = requests.get(url, params=params)
data = response.json()
print(f"API Version: {data['meta']['apiVersion']}")
print(f"Router Address: {data['router_address']}")
# Use data['calldata'] to execute transaction
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
public class FibrousRouteAndCallData {
public static void main(String[] args) throws Exception {
String baseUrl = "https://api.fibrous.finance/{network}/v2/routeAndCalldata";
String params = "amount=1000000000000000000" +
"&tokenInAddress=0x0000000000000000000000000000000000000000" +
"&tokenOutAddress=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" +
"&slippage=0.5" +
"&destination=0x1234567890123456789012345678901234567890";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(baseUrl + "?" + params))
.header("Accept", "*/*")
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println("Response: " + response.body());
}
}
package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL := "https://api.fibrous.finance/{network}/v2/routeAndCalldata"
params := url.Values{}
params.Add("amount", "1000000000000000000")
params.Add("tokenInAddress", "0x0000000000000000000000000000000000000000")
params.Add("tokenOutAddress", "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913")
params.Add("slippage", "0.5")
params.Add("destination", "0x1234567890123456789012345678901234567890")
req, err := http.NewRequest("GET", baseURL+"?"+params.Encode(), nil)
if err != nil {
panic(err)
}
req.Header.Set("Accept", "*/*")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println("Response:", string(body))
}
{
"route": {
"success": true,
"routeSwapType": 0,
"inputToken": {
"name": "Wrapped Ether",
"address": "0x4200000000000000000000000000000000000006",
"decimals": 18,
"price": 2949.717076112869
},
"inputAmount": "1000000000000000000",
"outputToken": {
"name": "USD Coin",
"address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"decimals": 6,
"price": 0.999597487941284
},
"outputAmount": "2951108576",
"time": 3.285,
"estimatedGasUsed": "0",
"estimatedGasUsedInUsd": 0,
"route": [
{
"percent": "35%",
"swaps": [
[
{
"protocol": 3,
"poolName": "Aerodrome Slipstream",
"poolAddress": "0xb2cc224c1c9fee385f8ad6a55b4d94e92359dc59",
"fromTokenAddress": "0x4200000000000000000000000000000000000006",
"toTokenAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"percent": "48.57%",
"extraData": {
"tickSpacing": 100
}
}
]
]
}
],
"bestQuotesByProtocols": [],
"initial": false,
"meta": {
"apiVersion": "2.0",
"timestamp": "2026-01-24T21:46:39.518Z"
}
},
"calldata": {
"route": {
"token_in": "0x4200000000000000000000000000000000000006",
"token_out": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"amount_in": "1000000000000000000",
"amount_out": "2951108576",
"min_received": "2936407033",
"destination": "0x1234567890123456789012345678901234567890",
"swap_type": 0
},
"swap_parameters": [
{
"token_in": "0x4200000000000000000000000000000000000006",
"token_out": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"rate": "2951108576",
"protocol_id": "3",
"pool_address": "0xb2cc224c1c9fee385f8ad6a55b4d94e92359dc59",
"swap_type": 0,
"extra_data": "0x0064"
}
]
},
"router_address": "0x274602a953847d807231d2370072f5f4e4594b44",
"meta": {
"apiVersion": "2.0",
"timestamp": "2026-01-24T21:46:40.000Z"
}
}
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