Get a quote for buying or selling any ERC20 token
GET/quote
Get a quote for buying or selling any ERC20 token
Request
Query Parameters
Your Public API key.
The ERC20 token address of the token you want to sell.
The ERC20 token address of the token you want to receive.
The amount of sellToken (in sellToken base units) you want to send.
The amount of buyToken (in buyToken base units) you want to receive.
The maximum acceptable slippage percentage.
The target gas price for the swap transaction.
The address which will fill the quote.
Liquidity sources to exclude from the quote.
Liquidity sources to include in the quote.
Skip validation of the quote.
The address that should receive affiliate fees.
The percentage of the buyAmount attributed as affiliate fees.
Enable slippage protection.
Allowed price impact percentage.
The recipient address of any trade surplus fees.
Sell the entirety of the caller's takerToken balance.
Responses
- 200
- 400
- 401
Successful response with the quote details
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
sources object[]
allowanceTarget string
zeroExFee object
{
"price": "string",
"guaranteedPrice": "string",
"to": "string",
"data": "string",
"value": "string",
"gasPrice": "string",
"gas": "string",
"estimatedGas": "string",
"protocolFee": "string",
"minimumProtocolFee": "string",
"buyAmount": "string",
"sellAmount": "string",
"sources": [
{
"name": "string",
"proportion": "string"
}
],
"buyTokenAddress": "string",
"sellTokenAddress": "string",
"allowanceTarget": "string",
"grossPrice": "string",
"grossBuyAmount": "string",
"grossSellAmount": "string",
"sellTokenToEthRate": "string",
"buyTokenToEthRate": "string",
"expectedSlippage": "string"
}
Bad request, possibly due to missing or invalid parameters
- application/json
- Schema
- Example (from schema)
Schema
{
"message": "string",
"code": 0
}
Unauthorized, possibly due to missing or invalid API key
- application/json
- Schema
- Example (from schema)
Schema
{
"message": "string",
"code": 0
}