Get an indicative price for a transaction
GET/price
Get an indicative price for a transaction
Request
Details
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.
Responses
- 200
- 400
- 401
Indicative price for the transaction
- application/json
- Schema
- Example (from schema)
Details
Schema
Array [
]
Price of buyToken in sellToken and vice versa.
Price with fees removed.
Estimated change in price due to price impact.
Amount of ether (in wei) to be sent with the transaction.
Gas price (in wei) for the transaction.
Estimated gas limit for the transaction.
Estimate of the actual gas used in the transaction.
Maximum ether paid towards the protocol fee (in wei).
Minimum ether paid towards the protocol fee (in wei).
Amount of buyToken that would be bought in this swap.
BuyAmount with fees removed.
Amount of sellToken that would be sold in this swap.
SellAmount with fees removed.
Details
sources
object[]
Distribution of buyAmount or sellAmount between liquidity sources.
ERC20 token address of the token you want to receive.
ERC20 token address of the token you want to sell.
Target contract address for which the user needs to have an allowance.
Rate between ETH and sellToken.
Rate between ETH and buyToken.
Expected slippage used in routing calculations for the quote.
Details
fees
object
Fees that would be charged, including 0x fee details.
Details
zeroExFee
object
{
"price": "string",
"grossPrice": "string",
"estimatedPriceImpact": "string",
"value": "string",
"gasPrice": "string",
"gas": "string",
"estimatedGas": "string",
"protocolFee": "string",
"minimumProtocolFee": "string",
"buyAmount": "string",
"grossBuyAmount": "string",
"sellAmount": "string",
"grossSellAmount": "string",
"sources": [
{
"name": "string",
"proportion": "string"
}
],
"buyTokenAddress": "string",
"sellTokenAddress": "string",
"allowanceTarget": "string",
"sellTokenToEthRate": "string",
"buyTokenToEthRate": "string",
"expectedSlippage": "string",
"fees": {
"zeroExFee": {
"feeType": "string",
"feeToken": "string",
"feeAmount": "string",
"billingType": "string"
}
}
}
Bad request, possibly due to missing or invalid parameters
- application/json
- Schema
- Example (from schema)
Details
Schema
{
"message": "string",
"code": 0
}
Unauthorized, possibly due to missing or invalid API key
- application/json
- Schema
- Example (from schema)
Details
Schema
{
"message": "string",
"code": 0
}