Developers
API code examples.
Copy-paste requests for the SwapKit API. Replace $SWAPKIT_API_KEY with your key from the dashboard.
01
List providers and tokens
- 1
Providers
Every available provider and the chains it supports.
- 2
Tokens
Search supported tokens, optionally for one provider.
curl "https://api.swapkit.dev/providers" -H "x-api-key: $SWAPKIT_API_KEY"
curl "https://api.swapkit.dev/tokens?provider=NEAR" -H "x-api-key: $SWAPKIT_API_KEY" 02
Quote and build a swap
- 1
Quote
Price the swap across every provider. No addresses needed yet.
- 2
Build
Pass the chosen routeId with your user's addresses to get a ready-to-sign transaction.
curl -X POST "https://api.swapkit.dev/v3/quote" \
-H "Content-Type: application/json" -H "x-api-key: $SWAPKIT_API_KEY" \
-d '{"sellAsset":"ETH.ETH","buyAsset":"BTC.BTC","sellAmount":"0.05","slippage":3}'
curl -X POST "https://api.swapkit.dev/v3/swap" \
-H "Content-Type: application/json" -H "x-api-key: $SWAPKIT_API_KEY" \
-d '{"routeId":"ROUTE_ID","sourceAddress":"0xYOUR_ETH_ADDRESS","destinationAddress":"YOUR_BTC_ADDRESS"}' 03
Track the swap
- 1
Track
Pass the transaction hash and the sell chain's ID. Poll until the status is completed, refunded or failed.
- 2
Share
Users can follow the same swap at track.swapkit.dev.
curl -X POST "https://api.swapkit.dev/track" \
-H "Content-Type: application/json" -H "x-api-key: $SWAPKIT_API_KEY" \
-d '{"hash":"0xYOUR_TRANSACTION_HASH","chainId":"1"}' Ship cross-chain swaps this week.
One integration for 10,000+ assets across 30+ chains, with limit orders and Hyperliquid deposits included. Non-custodial by design.