Table of Contents
API Overview
The SwiftSwap API allows developers to integrate no-KYC cryptocurrency swap functionality directly into their own applications, wallets, bots, or services. The API follows REST conventions, uses JSON for all request and response bodies, and communicates over HTTPS.
With the SwiftSwap API, your application can:
- Get real-time exchange rates for any supported pair
- Create swap orders programmatically
- Monitor swap status in real time
- Embed a revenue-sharing affiliate flow
- Build automated trading bots or arbitrage tools
The base URL for all API requests is: https://api.swiftswap.net/v1
Full API documentation is available at swiftswap.net/api.html.
Authentication
Some API endpoints are publicly accessible without authentication (rate queries). Endpoints that create or manage orders require an API key. To obtain an API key:
- Contact SwiftSwap support via the support page
- Specify your intended use case (wallet integration, bot, affiliate)
- Receive your API key and affiliate ID
API keys are passed in the request header:
X-API-Key: your_api_key_here
Security note: Never expose your API key in client-side JavaScript or public repositories. All API calls that create orders should be made server-side. Use environment variables to store keys.
Core Endpoints
GET/rate
Get the current exchange rate for a trading pair. No authentication required.
Parameters:
from— Source currency ticker (e.g.,btc)to— Destination currency ticker (e.g.,usdt_trc20)amount— Amount of source currency to swaptype— Rate type:standardorfixed(optional, default: standard)
GET /rate?from=btc&to=usdt_trc20&amount=0.1&type=fixed
Response:
{
"from": "btc",
"to": "usdt_trc20",
"amount_in": 0.1,
"amount_out": 9842.50,
"rate": 98425.00,
"fee": 147.64,
"type": "fixed",
"valid_until": "2026-04-06T14:35:00Z"
}
POST/create
Create a new swap order. Requires API key authentication.
Request body:
{
"from": "btc",
"to": "usdt_trc20",
"amount": 0.1,
"destination": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
"type": "fixed",
"affiliate_id": "your_affiliate_id"
}
Response:
{
"order_id": "SS-20260406-ABC123",
"deposit_address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7Divf",
"deposit_amount": 0.1,
"expected_output": 9842.50,
"destination": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
"status": "waiting",
"expires_at": "2026-04-06T15:05:00Z"
}
GET/status/{order_id}
Check the current status of a swap order. No authentication required.
GET /status/SS-20260406-ABC123
Response:
{
"order_id": "SS-20260406-ABC123",
"status": "exchanging",
"deposit_confirmed": true,
"deposit_tx_hash": "abc123def456...",
"output_tx_hash": null,
"created_at": "2026-04-06T14:05:00Z",
"updated_at": "2026-04-06T14:18:42Z"
}
Status values: waiting → confirming → exchanging → sending → completed | expired | refunded
Endpoint Summary
| Endpoint | Method | Auth | Description |
|---|---|---|---|
| /rate | GET | No | Get exchange rate |
| /pairs | GET | No | List all supported pairs |
| /create | POST | Yes | Create swap order |
| /status/{id} | GET | No | Check order status |
| /refund | POST | Yes | Request refund for expired order |
Node.js Integration Example
A complete example showing how to get a rate and create a swap order using Node.js and the built-in fetch API:
const API_BASE = 'https://api.swiftswap.net/v1';
const API_KEY = process.env.SWIFTSWAP_API_KEY;
async function getRate(from, to, amount, type = 'fixed') {
const url = `${API_BASE}/rate?from=${from}&to=${to}&amount=${amount}&type=${type}`;
const response = await fetch(url);
const data = await response.json();
return data;
}
async function createSwap(from, to, amount, destination, type = 'fixed') {
const response = await fetch(`${API_BASE}/create`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': API_KEY
},
body: JSON.stringify({ from, to, amount, destination, type })
});
const order = await response.json();
return order;
}
async function pollStatus(orderId, intervalMs = 15000) {
return new Promise((resolve) => {
const interval = setInterval(async () => {
const res = await fetch(`${API_BASE}/status/${orderId}`);
const data = await res.json();
console.log(`Status: ${data.status}`);
if (['completed', 'refunded', 'expired'].includes(data.status)) {
clearInterval(interval);
resolve(data);
}
}, intervalMs);
});
}
// Usage
(async () => {
const rate = await getRate('btc', 'usdt_trc20', 0.1);
console.log(`Expected output: ${rate.amount_out} USDT`);
const order = await createSwap(
'btc', 'usdt_trc20', 0.1,
'TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE'
);
console.log(`Deposit to: ${order.deposit_address}`);
const result = await pollStatus(order.order_id);
console.log(`Final status: ${result.status}`);
})();
Python Integration Example
The same flow in Python using the requests library:
import requests
import os
import time
API_BASE = 'https://api.swiftswap.net/v1'
API_KEY = os.environ.get('SWIFTSWAP_API_KEY')
HEADERS = {'X-API-Key': API_KEY, 'Content-Type': 'application/json'}
def get_rate(from_coin, to_coin, amount, rate_type='fixed'):
params = {'from': from_coin, 'to': to_coin,
'amount': amount, 'type': rate_type}
r = requests.get(f'{API_BASE}/rate', params=params)
return r.json()
def create_swap(from_coin, to_coin, amount, destination, rate_type='fixed'):
payload = {
'from': from_coin, 'to': to_coin,
'amount': amount, 'destination': destination,
'type': rate_type
}
r = requests.post(f'{API_BASE}/create', json=payload, headers=HEADERS)
return r.json()
def poll_status(order_id, interval=15):
while True:
r = requests.get(f'{API_BASE}/status/{order_id}')
data = r.json()
print(f"Status: {data['status']}")
if data['status'] in ('completed', 'refunded', 'expired'):
return data
time.sleep(interval)
# Usage
rate = get_rate('btc', 'usdt_trc20', 0.1)
print(f"Expected output: {rate['amount_out']} USDT")
order = create_swap('btc', 'usdt_trc20', 0.1,
'TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE')
print(f"Deposit to: {order['deposit_address']}")
result = poll_status(order['order_id'])
print(f"Final status: {result['status']}")
Common API Use Cases
- Crypto wallet integration: Embed a "Swap" feature in your wallet app so users can convert coins without leaving the app
- Payment processing: Accept any crypto and auto-convert to USDT for stable accounting
- DCA bots: Build an automated dollar-cost averaging bot that converts fiat-equivalent stablecoins to BTC on a schedule
- Arbitrage tools: Monitor rate discrepancies and automatically execute swaps when profitable
- Business invoicing: Accept customer payments in any coin and instantly convert to your preferred stablecoin
Rate Limits and Best Practices
- Rate endpoint: 60 requests per minute (unauthenticated), 300/min (with API key)
- Create endpoint: 10 orders per minute per API key
- Status endpoint: 120 requests per minute per IP
- Webhook support: Contact support to register a webhook URL for automated status callbacks — avoids polling
- Error handling: Always implement retry logic with exponential backoff for transient errors (5xx responses)
- Idempotency: Each /create call generates a unique order. Never retry a create call if you already received a successful response — check status instead
Frequently Asked Questions
Is the SwiftSwap API free to use?
The API is free for standard integrations. Partners who generate significant swap volume receive priority support and enhanced rate limits. Contact SwiftSwap support for enterprise API access and custom arrangements.
Does API integration pass the 1% fee to users?
By default, the standard 1% fee applies to all swaps regardless of integration method. Partners can optionally earn a portion of this fee through the affiliate program — contact support for details.
Can I create swaps for my users without sharing their data?
Yes. The SwiftSwap API requires no user personal data. You pass only the swap parameters (amounts, currencies, destination address). No email, name, or identity information is needed or accepted. Your users' privacy is maintained.
Is there a sandbox/test environment?
Yes. SwiftSwap provides a test environment at https://api-sandbox.swiftswap.net/v1 for integration testing. Sandbox swaps do not process real funds. Contact support to activate sandbox access with your API key.
What happens if the rate changes between /rate and /create?
If you use the fixed type, the rate returned by /rate is guaranteed when creating the order within the validity window (typically 30 minutes). If using standard type, the final rate is set at the time of deposit confirmation. For production integrations, always use fixed type to provide predictable outputs to users.
Start Building With SwiftSwap API
Integrate no-KYC crypto swaps into your app. Contact support for your API key.
Get API Access ⚡