Skip to main content
GET
/
v1
/
route
cURL
curl --request GET \
  --url https://swaps.sprinter.tech/mainnet/v1/route \
  --header 'Authorization: Basic <encoded-value>'
{
  "requestId": "<string>",
  "amountOut": "<string>",
  "minAmountOut": "<string>",
  "target": "<string>",
  "callData": "<string>",
  "gasUsed": 180000,
  "gasLimit": 234000
}

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Query Parameters

amountIn
string
required

The amount of input tokens to swap (in token's smallest unit)

Pattern: ^[0-9]+$
Example:

"5000000000"

tokenIn
string
required

Contract address of the input token to sell. The zero address (0x00…00) represents the native currency ETH.

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"

tokenOut
string
required

Contract address of the output token to buy. The zero address (0x00…00) represents the native currency ETH.

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"

slippageBps
integer<int32>
default:50

The slippage tolerance in basis points (e.g., 50 for 0.5%)

Required range: 0 <= x <= 10000
timeout
integer<int32>

Optional timeout in milliseconds. If set, returns the best pathfinder result within the timeout window. Must be a positive integer.

Required range: x >= 1

Response

Successfully calculated swap route with execution details

Successfully created route with execution details

requestId
string<hex>
required

Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix

Pattern: ^0x[a-fA-F0-9]{32}$
amountOut
string
required

Amount of tokens to receive

Pattern: ^[0-9]+$
minAmountOut
string
required

Minimum amount of tokens to receive after slippage

Pattern: ^[0-9]+$
target
string
required

The target contract address for the swap

Pattern: ^0x[a-fA-F0-9]{40}$
callData
string
required

Hex encoded calldata for the swap

Pattern: ^0x[a-fA-F0-9]*$
gasUsed
integer<uint64>
required

Actual gas consumed by the swap simulation

Required range: x >= 0
Example:

180000

gasLimit
integer<uint64>
required

Recommended gas limit for the swap transaction (gasUsed * 1.3)

Required range: x >= 0
Example:

234000