API Documentation
Integrate SMSKody into your application to rent USA phone numbers and receive SMS verification codes programmatically. Compatible with the SMS-Activate protocol — if your software already supports it, just change the base URL and API key.
getNumber with a service code to rent a numbergetStatus every 3-5 seconds until the SMS arrivesTwo methods are supported. Header-based auth is recommended as it keeps your key out of server logs and browser history.
Authorization: Bearer sk_your_api_key_hereGET https://smskody.com/api/ext?api_key=sk_your_key&action=getBalancehttps://smskody.com/api/extdynamic per service — starting from $0.05/SMS
Use getPrices to check current prices. Only charged when SMS is received. Auto-refund on cancel/expire.
| Limit | Value | Response |
|---|---|---|
| API requests per key | 60 requests / minute | RATE_LIMIT |
Polling getStatus every 3 seconds uses ~20 req/min — well within the limit. If you get RATE_LIMIT, wait and retry.
# 1. Check balance
GET /api/ext?action=getBalance
→ ACCESS_BALANCE:10.50
# 2. Get available services and prices
GET /api/ext?action=getPrices
→ {"0": {"wa": {"cost": 0.05, "count": 219475}, ...}}
# 3. Rent a number for WhatsApp
GET /api/ext?action=getNumber&service=wa
→ ACCESS_NUMBER:8041315:12145550198
# 4. Use +12145550198 on WhatsApp to request SMS code
# 5. Poll for the SMS (every 3-5 seconds)
GET /api/ext?action=getStatus&id=8041315
→ STATUS_WAIT_CODE (keep polling)
→ STATUS_OK:482731 (SMS received!)
# 6. Done! Optionally mark as complete
GET /api/ext?action=setStatus&id=8041315&status=6
→ ACCESS_ACTIVATION
# If SMS never arrives, cancel for refund:
GET /api/ext?action=setStatus&id=8041315&status=8
→ ACCESS_CANCELEndpoints
Returns the current account balance in USD.
GET https://smskody.com/api/ext?action=getBalance| ACCESS_BALANCE:10.50 | Current balance |
| BAD_KEY | Invalid API key |
Returns a JSON array of all available services with code and name.
GET https://smskody.com/api/ext?action=getServicesList| [{"code":"wa","name":"Whatsapp"}, ...] | JSON array of services |
Returns prices and available number counts for all services, grouped by country.
| country | Country ID (optional, only 0 = USA) |
GET https://smskody.com/api/ext?action=getPrices| {"0":{"wa":{"cost":0.05,"count":219475},...}} | JSON object: country → service → {cost, count} |
Returns available countries. Currently only USA.
GET https://smskody.com/api/ext?action=getCountries| {"0":{"id":0,"name":"USA"}} | JSON object of countries |
Rent a phone number for a specific service. Balance is deducted at the service price (check getPrices). Number is active for 15 minutes.
| service* | Service code (e.g. wa, go, fb, ig, lf, ds, tw) |
| country | Country ID (default: 0 = USA) |
GET https://smskody.com/api/ext?action=getNumber&service=wa| ACCESS_NUMBER:8041315:12145550198 | Success — {activationId}:{phoneNumber} |
| NO_BALANCE | Insufficient balance |
| NO_NUMBERS | No numbers available for this service |
| BAD_SERVICE | Unknown service code |
Check the status of an activation. Poll this every 3-5 seconds to wait for the SMS code.
| id* | Activation ID from getNumber response |
GET https://smskody.com/api/ext?action=getStatus&id=8041315| STATUS_WAIT_CODE | Still waiting for SMS — keep polling |
| STATUS_OK:482731 | SMS received — code after the colon |
| STATUS_CANCEL | Activation was cancelled or expired |
| NO_ACTIVATION | Activation ID not found |
Change the status of an activation. Use status=8 to cancel (get refund), or status=6 to mark complete.
| id* | Activation ID |
| status* | 8 = cancel & refund, 6 = mark complete |
GET https://smskody.com/api/ext?action=setStatus&id=8041315&status=8| ACCESS_CANCEL | Cancelled — balance refunded |
| ACCESS_ACTIVATION | Marked as complete |
| BAD_STATUS | Invalid status value or wrong state |
| NO_ACTIVATION | Activation ID not found |
Webhooks (Optional)
Instead of polling, you can set a webhook URL in Settings. When an SMS arrives, we'll POST a JSON payload to your URL:
POST https://your-server.com/webhook
Content-Type: application/json
{
"activationId": 8041315,
"phone": "12145550198",
"service": "wa",
"smsCode": "482731",
"smsText": "Your WhatsApp code is 482731",
"status": "completed"
}Code Examples
import requests, time
API_KEY = "sk_your_key_here"
BASE = "https://smskody.com/api/ext"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}
r = requests.get(BASE, params={"action": "getNumber", "service": "wa"}, headers=HEADERS)
parts = r.text.split(":")
activation_id, phone = parts[1], parts[2]
print(f"Use this number: +{phone}")
while True:
r = requests.get(BASE, params={"action": "getStatus", "id": activation_id}, headers=HEADERS)
if r.text.startswith("STATUS_OK:"):
print(f"SMS code: {r.text.split(':')[1]}")
break
time.sleep(3)const API_KEY = "sk_your_key_here";
const BASE = "https://smskody.com/api/ext";
async function api(params) {
const url = BASE + "?" + new URLSearchParams(params);
const res = await fetch(url, { headers: { Authorization: "Bearer " + API_KEY } });
return res.text();
}
const result = await api({ action: "getNumber", service: "wa" });
const [, activationId, phone] = result.split(":");
console.log("Use number: +" + phone);
while (true) {
const status = await api({ action: "getStatus", id: activationId });
if (status.startsWith("STATUS_OK:")) {
console.log("Code:", status.split(":")[1]);
break;
}
await new Promise(r => setTimeout(r, 3000));
}curl -H "Authorization: Bearer sk_your_key" \ "https://smskody.com/api/ext?action=getBalance" curl -H "Authorization: Bearer sk_your_key" \ "https://smskody.com/api/ext?action=getNumber&service=wa" curl -H "Authorization: Bearer sk_your_key" \ "https://smskody.com/api/ext?action=getStatus&id=8041315" curl -H "Authorization: Bearer sk_your_key" \ "https://smskody.com/api/ext?action=setStatus&id=8041315&status=8"
Error Codes Reference
| Code | Meaning | What to do |
|---|---|---|
| BAD_KEY | Invalid or missing API key | Check your key in Settings |
| BAD_ACTION | Unknown action parameter | Check the action name |
| BAD_SERVICE | Service code not found | Use getServicesList to see valid codes |
| BAD_STATUS | Invalid status or wrong activation state | Check activation state before changing status |
| NO_BALANCE | Insufficient balance | Top up your account |
| NO_NUMBERS | No numbers available for this service | Try again later or use a different service |
| NO_ACTIVATION | Activation ID not found | Check the ID matches your account |
| RATE_LIMIT | Too many requests | Wait 60 seconds, max 60 req/min |
Test all endpoints in your browser with our interactive tool.
Open API Tester