Introduction
The SwiftSwap API is a RESTful API that allows you to integrate cryptocurrency exchange functionality into your applications. All endpoints return JSON and use standard HTTP response codes.
Base URL:
https://api.swiftswap.net/v1
Quick Example
const response = await fetch('https://api.swiftswap.net/v1/rate?from=BTC&to=ETH&amount=0.1', { headers: { 'X-API-Key': 'your_api_key_here' } }); const data = await response.json(); console.log(data); // → { from: "BTC", to: "ETH", rate: 18.94, estimated: 1.894, fee: 0.01 }
Authentication
All API requests require an API key passed in the X-API-Key header. Get your free key by registering at SwiftSwap.
curl -X GET "https://api.swiftswap.net/v1/rate?from=BTC&to=ETH&amount=1" \ -H "X-API-Key: sk_live_xxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json"
Rate Limits
Free tier: 1,000 requests/day · Pro: 50,000/day · Enterprise: Unlimited. Rate limit headers are included in every response:
X-RateLimit-Limit: 1000 X-RateLimit-Remaining: 947 X-RateLimit-Reset: 1704067200
Error Handling
The API uses standard HTTP status codes. Errors include a JSON body with a code and message.
{
"error": {
"code": "AMOUNT_TOO_LOW",
"message": "Amount is below the minimum of 0.0001 BTC",
"min_amount": 0.0001
}
}
| Code | Status | Description |
|---|---|---|
| 200 | OK | Request successful |
| 400 | Bad Request | Invalid parameters or amount too low |
| 401 | Unauthorized | Missing or invalid API key |
| 429 | Too Many Requests | Rate limit exceeded |
| 503 | Service Unavailable | Pair temporarily unavailable |
Get Exchange Rate
| Parameter | Type | Required | Description |
|---|---|---|---|
| from | string | required | Source currency symbol (e.g. BTC) |
| to | string | required | Target currency symbol (e.g. ETH) |
| amount | number | required | Amount to exchange |
| type | string | optional | "fixed" or "float" (default: float) |
{
"from": "BTC",
"to": "ETH",
"amount": 0.1,
"rate": 18.94312,
"estimated": 1.87843,
"fee": 0.00943,
"fee_pct": 0.4,
"type": "float",
"expires_at": null
}
Get Available Pairs
| Parameter | Type | Required | Description |
|---|---|---|---|
| from | string | optional | Filter pairs by source currency |
{
"pairs": [
{
"from": "BTC", "to": "ETH",
"min": 0.0001, "max": 10,
"available": true
}
// ... more pairs
],
"total": 4892
}
Create Order
| Parameter | Type | Required | Description |
|---|---|---|---|
| from | string | required | Source currency symbol |
| to | string | required | Target currency symbol |
| amount | number | required | Amount to send |
| recipient | string | required | Recipient wallet address |
| type | string | optional | "fixed" or "float" |
| refund | string | optional | Refund address (recommended) |
const order = await fetch('https://api.swiftswap.net/v1/order', { method: 'POST', headers: { 'X-API-Key': 'your_key', 'Content-Type': 'application/json' }, body: JSON.stringify({ from: 'BTC', to: 'ETH', amount: 0.1, recipient: '0xYourEthAddress...', type: 'float' }) }); const { order_id, deposit_address, expires_at } = await order.json();
Order Status
{
"id": "ss_a1b2c3d4e5",
"status": "confirming",
// statuses: waiting | confirming | exchanging | sending | done | failed
"from": "BTC", "to": "ETH",
"amount_sent": 0.1,
"amount_received": 1.8784,
"deposit_address": "bc1qxy...",
"tx_from": "abc123...",
"tx_to": null,
"created_at": "2026-03-08T12:00:00Z"
}
JavaScript Widget
Embed the full SwiftSwap exchange widget into any webpage in seconds. No backend needed.
<!-- Add to your HTML --> <div id="swiftswap-widget"></div> <script src="https://cdn.swiftswap.net/widget.js"></script> <script> SwiftSwap.init({ container: '#swiftswap-widget', apiKey: 'your_api_key', defaultFrom: 'BTC', defaultTo: 'ETH', theme: 'dark' }); </script>
API Pricing
Start for free, scale as you grow. All plans include full API access.
- 1,000 requests / day
- All endpoints
- Rate data access
- Community support
- 50,000 requests / day
- Webhook support
- Order creation API
- Priority support
- Revenue share program
- Unlimited requests
- Dedicated infrastructure
- SLA guarantee
- White-label widget
- Dedicated account manager