/swapTo - Request buy swap options

Check the swap options to buy a given token

The /swapTo endpoint is called specifying a token, and provides a list of tokens that it can be bought with using SwapKit's API. The response includes all possible providers. It can be used as an alternative filter to the /tokens, or as a counterpart to the /swapFrom endpoints.

Method: GET URL: https://api.swapkit.dev/swapTo

Example Request

curl -X 'GET' \
  'https://api.swapkit.dev/swapTo?sellAsset=BTC.BTC' \
  -H 'accept: application/json' \
  -H "x-api-key: YOUR_VARIABLE_HERE"

Example shortened response

[
  "AVAX.AVAX",
  "BASE.ETH",
  "BCH.BCH",
  "BSC.BNB",
  "DOGE.DOGE",
  "ETH.ETH",
  "GAIA.ATOM",
  "LTC.LTC",
  "THOR.RUJI",
  "THOR.TCY",
  "TRON.TRX",
  "XRP.XRP",
  "THOR.RUNE",
  "AVAX.SOL-0XFE6B19286885A4F7F55ADAD09C3CD1F906D2478F",
  "AVAX.USDC-0XB97EF9EF8734C71904D8002F8B6BC66DD9C48A6E",
  "AVAX.USDT-0X9702230A8EA53601F5CD2DC00FDBC13D4DF4A8C7",
  "BASE.USDC-0X833589FCD6EDB6E08F4C7C32D4F71B54BDA02913",
  "BSC.BTCB-0X7130D2A12B9BCBFAE4F2634D864A1EE1CE3EAD9C",
  "BSC.BUSD-0XE9E7CEA3DEDCA5984780BAFC599BD69ADD087D56",
  "BSC.ETH-0X2170ED0880AC9A755FD29B2688956BD959F933F8",
  ...
]

Notes

  • Include the token's identifier in the request as a parameter, as in the example request.

    • For USDC on Ethereum, it would be https://api.swapkit.dev/swapTo?sellAsset=ETH.USDC-0XA0B86991C6218B36C1D19D4A2E9EB0CE3606EB48 for example

  • As mentioned before, the response includes all available tokens to swap to using any of the providers SwapKit has available. Because of this, the list for an ERC-20 token will be quite long.

Last updated