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
| Name | Type | Required | Description |
|---|---|---|---|
from | Object | Required | Base token information to receive a quote. |
from.token_id | Number | Conditional required | Part 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_id | Number | Conditional required | Part of the from object. Required only if token_id is not provided. To receive network_id, use the GET /v1/networks endpoint. |
from.contract_address | String | Conditional required | Part of the from object. Required only if token_id is not provided. |
to | Object | Required | Quote token information for receiving quote. |
to.token_id | Number | Conditional required | Part 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_id | Number | Conditional required | Part of the to object. Required only if token_id is not provided. To receive network_id, use the GET /v1/networks endpoint. |
to.contract_address | String | Conditional required | Part of the to object. Required only if token_id is not provided. |
amount | Decimals in string | Required | Amount to swap. |
slippage_bps | String | Optional | Slippage expressed in basis points. |
Sample request
application/json
{
"from": {
"token_id": 278,
},
"to": {
"token_id": 678,
},
"amount": 1000000,
"slippage_bps": "50"
}
Response
Successful response
| Name | Type | Required | Description |
|---|---|---|---|
id | Number | Required | Quote id. |
from | Object | Required | Base token information to receive a quote. |
from.network_id | Number | Optional | Part of the from object. |
from.contract_address | String | Optional | Part of the from object. |
from.token_id | Number | Optional | Part of the from object. |
from.address | String | Optional | Part of the from object. Sender address. |
from.amount | Decimals in string | Required | Part of the from object. Amount to swap. |
from.decimals | Number | Required | Part of the from object. |
to | Object | Required | Quote token information for receiving quote. |
to.network_id | Number | Optional | Part of the to object. |
to.contract_address | String | Optional | Part of the to object. |
to.token_id | Number | Optional | Part of the to object. |
to.min_amount | Decimals in string | Required | Part of the to object. Minimal quote amount expressed in basis points. |
to.amount | Decimals in string | Required | Part of the to object. Maximum quote amount expressed in basis points. |
to.decimals | Number | Optional | Part of the to object. |
slippage_bps | String | Optional | Slippage expressed in basis points. |
expires_at | Timestamp | Optional | Quote 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. |
fees | Object | Required | Applied fees for current quote. |
fees.changelly | Object | Optional | Part of the fees object. Changelly fee information. |
fees.changelly.network_id | Number | Optional | Part of the fees.changelly object. Network relation. |
fees.changelly.contract_address | String | Optional | Part of the fees.changelly object. Token contract address. |
fees.changelly.token_id | Number | Optional | Part of the fees.changelly object. Token ID. |
fees.changelly.decimals | Number | Optional | Part of the fees.changelly object. Token decimals to adjust amount. |
fees.changelly.amount | Decimals in string | Optional | Part of the fees.changelly object. Changelly fee amount. |
fees.changelly.bps | String | Optional | Part of the fees.changelly object. Amount of basis points. |
fees.affiliate | Object | Optional | Part of the fees object. Affiliate fee information. |
fees.affiliate.network_id | Number | Optional | Part of the fees.affiliate object. Network relation. |
fees.affiliate.contract_address | String | Optional | Part of the fees.affiliate object. Affiliate token contract address. |
fees.affiliate.token_id | Number | Optional | Part of the fees.affiliate object. Affiliate token ID. |
fees.affiliate.decimals | Number | Optional | Part of the fees.affiliate object. Affiliate token decimals to adjust amount. |
fees.affiliate.amount | Decimals in string | Optional | Part of the fees.affiliate object. Affiliate fee amount. |
fees.affiliate.bps | String | Optional | Part 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.