SwiftOTP API
Buy virtual numbers and read OTP codes from your own code. It uses the same wallet, prices and refunds as the website and the Telegram bot. All amounts are in USD.
Authentication
Create a key in your account → Developer, then send it on every request:
Authorization: Bearer sotp_live_xxxxxxxxxxxxxxxx
Website login cookies are not accepted by the API. Keep your key secret; revoke it if it leaks.
Base URL
https://YOUR-HOST/api/v1
Limits & errors
60 requests per minute per key (10 purchases per minute). Errors are JSON: {"detail": "message"} with status 400 (bad input), 401 (missing/invalid key), 402 (insufficient balance), 404 (not found), 409 (sold out / already closed), 429 (rate limited) or 503 (temporarily unavailable, you were not charged).
Endpoints
GET /balance
{"balance_usd": 4.85, "currency": "USD"}
GET /services
{"apps": [{"code": "whatsapp", "name": "WhatsApp"}, {"code": "telegram", "name": "Telegram"}, ...]}
App codes: whatsapp, telegram, twitter, instagram, facebook, tiktok, google, snapchat, signal.
GET /countries?app=whatsapp
{"app": "whatsapp", "countries": [{"code": "usa", "name": "USA", "from_usd": 2.73}, ...]}
GET /prices?app=whatsapp&country=usa
{"app": "whatsapp", "country": "usa", "tiers": [
{"tier": "cheapest", "label": "Budget", "price_usd": 2.73},
{"tier": "best", "label": "Reliable", "price_usd": 3.79}]}
Labels: Premium, Reliable, Budget or Standard.
POST /buy
{"app": "whatsapp", "country": "usa", "tier": "cheapest"} // tier: "cheapest" | "best"
→ {"order_id": 123, "number": "+1555…", "price_usd": 2.73, "status": "PENDING", "expires_in_sec": 900}
The price is deducted from your wallet. If no SMS arrives within 15 minutes the order is cancelled and refunded automatically.
GET /orders/{id}
{"order_id": 123, "status": "RECEIVED", "code": "482913", "number": "+1555…", "price_usd": 2.73, ...}
Status: PENDING (waiting), RECEIVED (code ready), FINISHED, CANCELLED or TIMEOUT (both refunded). Poll every 5 seconds.
POST /orders/{id}/cancel
{"order_id": 123, "status": "CANCELLED", "refunded_usd": 2.73, "balance_usd": 4.85}Only while PENDING and no code has arrived.
GET /orders?limit=50
{"orders": [ ... ]}
curl
KEY=sotp_live_xxx
curl -H "Authorization: Bearer $KEY" BASE/balance
curl -H "Authorization: Bearer $KEY" "BASE/prices?app=whatsapp&country=usa"
curl -X POST -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{"app":"whatsapp","country":"usa","tier":"cheapest"}' BASE/buy
curl -H "Authorization: Bearer $KEY" BASE/orders/123
curl -X POST -H "Authorization: Bearer $KEY" BASE/orders/123/cancel
Python
import time, requests
BASE = "BASE"
H = {"Authorization": "Bearer sotp_live_xxx"}
print(requests.get(f"{BASE}/balance", headers=H).json())
r = requests.post(f"{BASE}/buy", headers=H, json={"app": "whatsapp", "country": "usa", "tier": "cheapest"})
r.raise_for_status()
order = r.json()
print("Number:", order["number"])
while True:
o = requests.get(f"{BASE}/orders/{order['order_id']}", headers=H).json()
if o["status"] == "RECEIVED":
print("Code:", o["code"]); break
if o["status"] in ("CANCELLED", "TIMEOUT"):
print("No code, refunded."); break
time.sleep(5)