Get swaps
Retrieves the swap list.
HTTP request
GET /v1/swaps
Request
Header parameters
Requires authentication.
Query paramaters
| Name | Type | Required | Description |
|---|---|---|---|
from_token_id | Number | Optional | Sender token ID. Use together with to_token_id. |
to_token_id | Number | Optional | Receiver token ID. Use together with from_token_id. |
from_network_id | Number | Optional | Sender network relation. Use together with to_network_id. |
to_network_id | Number | Optional | Receiver network relation. Use together with from_network_id. |
from_contract_address | String | Optional | Sender contract address. Use together with to_contract_address. |
to_contract_address | String | Optional | Receiver contract address. Use together with from_contract_address. |
swap_created_from | Timestamp (microseconds) | Optional | Timestamp for swaps created at the time or later. Use together with swap_created_to. |
swap_created_to | Timestamp (microseconds) | Optional | Timestamp for swaps created at the time or earlier. Use together with swap_created_from. |
status | String | Optional | The swap status. |
limit | Number | Optional | Number of records to retrieve. The maximum limit is 100. Default value is 10. |
offset | Number | Optional | Records cursor. |
Body parameters
Doesn't require setting any body parameters.
Sample query
https://defiapi.changelly.com/v1/swaps?from_network_id=3&to_network_id=177
Response
Successful response
| Name | Type | Required | Description |
|---|---|---|---|
intent_id | Number | Required | Swap intent ID. |
status | String | Required | Swap intent status. Possible values. |
approval_mechanism | String | Required | Type of intent approval mechanism. |
from | Object | Required | Base token information. |
from.address | String | Required | Part of the from object. Sender address. |
from.tx | String | Optional | Part of the from object. Sender hash. |
from.network_id | Number | Required | Part of the from object. Sender network relation. |
from.token_id | Number | Required | Part of the from object. Sender token ID. |
from.contract_address | String | Required | Part of the from object. Sender contract address. |
from.decimals | Number | Required | Part of the from object. Sender token decimals to adjust amount. |
from.amount | Decimals in string | Required | Part of the from object. Amount to swap. |
to | Object | Required | Quote token information. |
to.address | String | Required | Part of the to object. Receiver address. |
to.tx | String | Optional | Part of the to object. Receiver hash. |
to.network_id | Number | Required | Part of the to object. Network relation. |
to.token_id | Number | Required | Part of the to object. Receiver token ID. |
to.contract_address | String | Required | Part of the to object. Receiver contract address. |
to.decimals | Number | Required | Part of the to object. Receiver token decimals to adjust amount. |
to.min_amount | Decimals in string | Required | Part of the to object. Minimal quote amount expressed in basis points. |
to.max_amount | Decimals in string | Required | Part of the to object. Maximum quote amount expressed in basis points. |
to.amount_expected | Decimals in string | Required | Part of the to object. Expected minimal quote amount expressed in basis points. |
refund | Object | Required | Refund information. |
refund.address | String | Optional | Part of the refund object. Address for potential refund. |
refund.tx | String | Optional | Part of the refund object. Refund hash. |
refund.tx_at | String | Optional | Part of the refund object. Time of refund hash creation. |
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. Affiliate 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. |
intent_created_at | Timestamp (microseconds) | Required | Swap intent creation time. |
swap_created_at | Timestamp (microseconds) | Required | Swap creation time. |
swap_updated_at | Timestamp (microseconds) | Required | Swap update time. |
Sample response
application/json
[
{
"intent_id": "2efaaa54-080d-4ac2-89c1-660b5a268eba",
"status": "created",
"approval_mechanism": "permit2",
"from": {
"address": "0xbe7A42Af09*********8a88c8EE",
"tx": null,
"network_id": 3,
"token_id": 278,
"contract_address": "0x000000000000000000000000000000000000000",
"decimals": 6,
"amount": "10000000"
},
"to": {
"address": "0xac6B52Af09*********8a88c8EE",
"tx": null,
"network_id": 3,
"token_id": 4669,
"contract_address": "1x000000000000000000000000000000000000000",
"decimals": 18,
"min_amount": "4230589541052713",
"max_amount": "4251848784977602",
"amount_expected": "4251848784977602"
},
"refund": {
"address": "0xbe7A42Af09*********8a88c8EE",
"tx": null
},
"fees": {
"changelly": {
"network_id": 1,
"token_id": 78,
"contract_address": "0xc02aaa39************083c756cc2",
"bps": "50",
"amount": "12000000000000",
"decimals": 18
},
"affiliate": {
"network_id": 1,
"token_id": 78,
"contract_address": "0xc02aaa39************083c756cc2",
"bps": "25",
"amount": "6000000000000",
"decimals": 18
}
},
"intent_created_at": 1778856025,
"swap_created_at": 1778856026,
"swap_updated_at": 1779793152
}
]
Error response
Check the error response schema.