Skip to main content

Quote params

Find the best quote to exchange via 1inch router: /api/quote#

Description of query parameters#

Parameter nameTypeDescription
fromTokenAddress*stringcontract address of a token to sell
e.g.: 0x6b175474e89094c44da98b954eedeac495271d0f
toTokenAddress*stringcontract address of a token to buy
e.g.: 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
amount*integeramount of a token to sell, set in minimal divisible units
e.g.:
1.00 DAI set as 1000000000000000000
51.03 USDC set as 51030000
feenumberthis percentage of fromTokenAddress token amount will be sent to referrerAddress,
the rest will be used as input for a swap
min: 0; max: 3; default: 0;
example to set a fee to 1.5%: &fee=1.5
protocolsstringspecify liquidity protocols to use. If not set, all liquidity protocols will be used
e.g.: &protocols=WETH,CURVE,BALANCER,...,ZRX
default: all protocols can be used
gasPricestring1inch takes in account gas expenses to determine exchange route. It is important to use the same gas price
on the quote and swap methods
gas price set in wei: 12.5 GWEI set as 12500000000
default: "fast" from the network
complexityLevelstringmaximum number of token-connectors to be used in a transaction. The more is used — the longer route estimation will take, the more complex route might be as a result. If not set, two token-connectors might be used
min: 0; max: 3; default: 2
connectorTokensstringtoken-connectors can be specified via this parameter. The more is set — the longer route estimation will take. If not set, default token-connectors will be used. If token you want to exchange doesn't have a pool with one of the default token-connectors, this parameter will help find the route; should be the same for a quote and swap e.g.:
&connectorTokens=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE, 0x6b175474e89094c44da98b954eedeac495271d0f
default: list of default token-connectors
gasLimitintegermaximum amount of gas for a swap;
should be the same for a quote and swap
default: 11500000; max: 11500000;
mainRoutePartsintegerlimit maximum number of main route parts;
should be the same for a quote and swap
default: 20; max: 50;
partsintegerlimit maximum number of parts each main route part can be split into; should be the same for a quote and swap
default: 20; max: 100;

Description of response parameters#

Parameter nameTypeDescription
fromTokenstringparameters of a token to sell
toTokenstringparameters of a token to buy
fromTokenAmountstringinput amount of fromToken in minimal divisible units
toTokenAmountstringresult amount of toToken in minimal divisible units
protocolsstringroute of the trade
estimatedGasstringrough estimated amount of the gas limit for used protocols;
do not use estimatedGas from the quote method as the gas limit of a transaction