Skip to main content

Get quotes

Retrieves the best available swap quote for a given source token, destination token, and amount. Also, returns pricing details, limits, and metadata required to proceed with a swap.

Quotes has time limits and must be executed before their expiration.

HTTP request

POST /v1/quotes/

Request

Header parameters

Requires authentication.

Body parameters

NameTypeRequiredDescription
fromObjectRequiredBase token information to receive a quote.
from.token_idNumberConditional requiredPart of the from object. Required only if network_id and token are not provided. To receive token_id, use the GET /v1/tokens endpoint.
from.network_idNumberConditional requiredPart of the from object. Required only if token_id is not provided. To receive network_id, use the GET /v1/networks endpoint.
from.contract_addressStringConditional requiredPart of the from object. Required only if token_id is not provided.
toObjectRequiredQuote token information for receiving quote.
to.token_idNumberConditional requiredPart of the to object. Required only if network_id and token are not provided. To receive token_id, use the GET /v1/tokens endpoint.
to.network_idNumberConditional requiredPart of the to object. Required only if token_id is not provided. To receive network_id, use the GET /v1/networks endpoint.
to.contract_addressStringConditional requiredPart of the to object. Required only if token_id is not provided.
amountDecimals in stringRequiredAmount to swap.
slippage_bpsStringOptionalSlippage expressed in basis points.
Sample request
application/json
{
"from": {
"token_id": 278,
},
"to": {
"token_id": 678,
},
"amount": 1000000,
"slippage_bps": "50"
}

Response

Successful response

NameTypeRequiredDescription
idNumberRequiredQuote id.
fromObjectRequiredBase token information to receive a quote.
from.network_idNumberOptionalPart of the from object.
from.contract_addressStringOptionalPart of the from object.
from.token_idNumberOptionalPart of the from object.
from.addressStringOptionalPart of the from object. Sender address.
from.amountDecimals in stringRequiredPart of the from object. Amount to swap.
from.decimalsNumberRequiredPart of the from object.
toObjectRequiredQuote token information for receiving quote.
to.network_idNumberOptionalPart of the to object.
to.contract_addressStringOptionalPart of the to object.
to.token_idNumberOptionalPart of the to object.
to.min_amountDecimals in stringRequiredPart of the to object. Minimal quote amount expressed in basis points.
to.amountDecimals in stringRequiredPart of the to object. Maximum quote amount expressed in basis points.
to.decimalsNumberOptionalPart of the to object.
slippage_bpsStringOptionalSlippage expressed in basis points.
expires_atTimestampOptionalQuote expiration time. After this timestamp, the quote is no longer valid and must be refreshed. Quotes should always be executed before expiry to guarantee pricing.
feesObjectRequiredApplied fees for current quote.
fees.changellyObjectOptionalPart of the fees object. Changelly fee information.
fees.changelly.network_idNumberOptionalPart of the fees.changelly object. Network relation.
fees.changelly.contract_addressStringOptionalPart of the fees.changelly object. Token contract address.
fees.changelly.token_idNumberOptionalPart of the fees.changelly object. Token ID.
fees.changelly.decimalsNumberOptionalPart of the fees.changelly object. Token decimals to adjust amount.
fees.changelly.amountDecimals in stringOptionalPart of the fees.changelly object. Changelly fee amount.
fees.changelly.bpsStringOptionalPart of the fees.changelly object. Amount of basis points.
fees.affiliateObjectOptionalPart of the fees object. Affiliate fee information.
fees.affiliate.network_idNumberOptionalPart of the fees.affiliate object. Network relation.
fees.affiliate.contract_addressStringOptionalPart of the fees.affiliate object. Affiliate token contract address.
fees.affiliate.token_idNumberOptionalPart of the fees.affiliate object. Affiliate token ID.
fees.affiliate.decimalsNumberOptionalPart of the fees.affiliate object. Affiliate token decimals to adjust amount.
fees.affiliate.amountDecimals in stringOptionalPart of the fees.affiliate object. Affiliate fee amount.
fees.affiliate.bpsStringOptionalPart of the fees.affiliate object. Affiliate amount of basis points.
Sample response
application/json
{
"id": "e3c25822-2a69-48e6-a590-765ea4eaeacf",
"from": {
"network_id": 3,
"token_id": 278,
"contract_address": "0x000000000000000000000000000000000000000",
"amount": "1000000",
"decimals": 6
},
"to": {
"network_id": 177,
"token_id": 678,
"contract_address": null,
"amount": "6971475",
"decimals": 9,
"min_amount": "6936617"
},
"slippage_bps": "50",
"expires_at": 1780068191262000,
"fees": {
"changelly": {
"network_id": 3,
"contract_address": "0xc02aaa39************083c756cc2",
"token_id": 4669,
"decimals": 18,
"amount": "4960821904096",
"bps": "100"
},
"affiliate": {
"network_id": 3,
"contract_address": "0xc02aaa39************083c756cc2",
"token_id": 4669,
"decimals": 18,
"amount": "2480410952048",
"bps": "50"
}
}
}

Error response

Check the error response schema.