Skip to main content
GET

Overview

Route V2 endpoint provides the same routing functionality as V1, with additional features including integrator support, enhanced metadata, and improved response structure. Currently available on EVM networks.
V2 API is currently available on Evm networks. V1 endpoints remain available for backward compatibility.

Endpoint

Find the optimal trading route through Fibrous’ integrated liquidity sources to maximize output and minimize slippage. This endpoint analyzes multiple protocols, pool depths, and potential paths to deliver the most efficient swap execution for your tokens.

What’s New in V2

Integrator Support

Monetize your integration with fees or surplus sharing

Enhanced Metadata

All responses include API version and timestamp

Better Tracking

Track output amounts before and after fees

API Key Support

Use API keys for higher rate limits and integrator features

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 token
string
required
The address of the input token.Example: "0x0000000000000000000000000000000000000000" for native token
string
required
The address of the output token.Example: "0x3bd359c1119da7da1d913d1c4d2b7c461115433a" for wrapped token
boolean
Not supported yet - reserved for future use. Default: false
boolean
If true, only direct swaps between the input and output tokens will be considered. Default: false
string
Comma-separated list of protocol IDs to exclude from routing (e.g., “1,2,3”). Default: ""
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, 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

boolean
Indicates if the request was successful.
number
Type of swap route (0: ETH to Token, 1: Token to ETH, 2: Token to Token).
object
Details about the input token.
string
The input amount in wei format.
object
Details about the output token (same structure as inputToken).
string
The estimated amount of output tokens in wei format.
string
The output amount after integrator fee deduction (if integrator fee is used).
string
Estimated gas cost for the swap in wei.
number
Estimated gas cost in USD.
array
Array of route segments with detailed swap information.
string
Integrator address (if provided).
number
Integrator fee percentage in basis points (if applicable).
number
Integrator surplus percentage in basis points (if applicable).
string
Integrator name from API key (if applicable).
object
required
API metadata including version and timestamp.

Integrator Features

API Key Required: To use integrator features, partners must obtain an API key from Fibrous. Generate and manage your API keys at the Fibrous Partnership Portal.
To use integrator features, include your API key in the request headers:
You cannot use both integratorFeePercentageBps and integratorSurplusPercentageBps in the same request. Choose one monetization method.

Differences from V1

Best Practices

  1. Always check meta.apiVersion to ensure you’re using the expected API version
  2. Use API keys for production integrations to access integrator features
  3. Monitor meta.timestamp for debugging and tracking response times
  4. Handle outputAmountAfterFee when using integrator fees to show accurate amounts to users