Skip to main content
POST
/
quote
Get Swap Quote
curl --request POST \
  --url https://api.nexroute.io/v1/quote \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "tokenIn": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
  "tokenOut": "0x55d398326f99059fF775485246999027B3197955",
  "amountIn": "1000000000000000000"
}
'
{
  "amountOut": "8643194859422640072",
  "gas": 237995,
  "calldata": "0x8f01f039...",
  "router": "0x365193e7e200CC2Ce82eb67DB0Fed117F8C7c660",
  "spender": "0x365193e7e200CC2Ce82eb67DB0Fed117F8C7c660"
}

Authorizations

X-API-Key
string
header
required

API key for authentication

Body

application/json
tokenIn
string
required

Input token contract address (0x-prefixed, 40 hex characters)

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

"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"

tokenOut
string
required

Output token contract address (0x-prefixed, 40 hex characters)

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

"0x55d398326f99059fF775485246999027B3197955"

amountIn
string
required

Input amount in wei (uint256 as decimal string, must be > 0)

Pattern: ^[1-9]\d*$
Example:

"1000000000000000000"

Response

Successful quote response

amountOut
string

Output amount in wei (uint256 as decimal string)

Example:

"8643194859422640072"

gas
integer

Estimated gas cost

Example:

237995

calldata
string

Calldata for the swap transaction

Example:

"0x8f01f039..."

router
string

Router contract address to call

Example:

"0x365193e7e200CC2Ce82eb67DB0Fed117F8C7c660"

spender
string

Spender address for token approval

Example:

"0x365193e7e200CC2Ce82eb67DB0Fed117F8C7c660"