認證
在帳戶的「API 金鑰」頁建立金鑰,然後在每個請求的標頭中附上。金鑰只會在建立時顯示一次。建立新金鑰後,舊金鑰會立即停用。
Authorization: Bearer YOUR_KEY # 或 X-Api-Key: YOUR_KEY
基本 URL https://socialsms.live/api/v1
請求限制
每個金鑰每分鐘最多可發送 120 個請求。超出限制會返回 429(rate_limited),請稍等再試。輪詢驗證碼時,每 3~5 秒一次已經足夠。
GET
/balance查詢餘額
返回你目前的美元餘額。
# 請求 curl https://socialsms.live/api/v1/balance \ -H "Authorization: Bearer YOUR_KEY" # 回應 { "ok": true, "balance": "12.40", "currency": "USD" }
GET
/services服務列表
全部 1,043 項可用服務,附國家數目和最低價。service 值就是取得號碼時使用的名稱。
# 請求 curl https://socialsms.live/api/v1/services \ -H "Authorization: Bearer YOUR_KEY" # 回應 { "ok": true, "services": [ { "service": "telegram", "name": "Telegram", "countries": 167, "from": "0.01" } ] }
GET
/prices?service=telegram各國家價格
某項服務在各國家的價格。country 是兩個字母的國家代碼(id、us、gb)。
# 請求 curl https://socialsms.live/api/v1/prices?service=telegram \ -H "Authorization: Bearer YOUR_KEY" # 回應 { "ok": true, "service": "telegram", "prices": [ { "country": "id", "dial": "+62", "price": "0.01" } ] }
POST
/numbers取得號碼
發送 service 和 country 即可立即取得號碼。價格會從餘額扣除。用回應中的 id 查詢驗證碼。接受 JSON 或表格資料。
# 請求 curl -X POST https://socialsms.live/api/v1/numbers \ -H "Authorization: Bearer YOUR_KEY" \ -d service=telegram -d country=id # 回應 { "ok": true, "id": "S62AYTG9T3MJ", "service": "telegram", "country": "id", "number": "+62 427 015 069", "price": "0.01", "status": "waiting", "created_at": "2026-11-15T08:10:00.000Z", "expires_at": "2026-11-15T08:30:00.000Z", "codes": [] }
GET
/numbers/{id}號碼狀態及驗證碼
號碼的狀態(waiting、received、refunded、canceled)及目前收到的所有驗證碼。如 20 分鐘內沒有收到驗證碼,狀態會變成 refunded,款項會退回。
# 請求 curl https://socialsms.live/api/v1/numbers/S62AYTG9T3MJ \ -H "Authorization: Bearer YOUR_KEY" # 回應 { "ok": true, "id": "S62AYTG9T3MJ", "status": "received", "codes": [ { "code": "51382", "text": "Telegram code: 51382", "received_at": "..." } ], ... }
POST
/numbers/{id}/cancel取消號碼
在收到驗證碼前取消號碼,款項會立即退回餘額。refunded 是退回的金額。
# 請求 curl -X POST https://socialsms.live/api/v1/numbers/S62AYTG9T3MJ/cancel \ -H "Authorization: Bearer YOUR_KEY" # 回應 { "ok": true, "id": "S62AYTG9T3MJ", "status": "canceled", "refunded": "0.01", ... }
錯誤
失敗時,ok 為 false,error 會說明原因。
| 狀態 | error | 意思 |
|---|---|---|
| 401 | unauthorized | 缺少金鑰或金鑰錯誤。 |
| 429 | rate_limited | 超出每分鐘請求限制。 |
| 400 | bad_service | 服務名稱不存在。 |
| 400 | bad_country | 這個國家沒有此服務的號碼。 |
| 402 | low_balance | 餘額不足。 |
| 503 | unavailable | 這個國家目前沒有號碼。系統沒有扣款。 |
| 404 | not_found | 沒有這個 id 的號碼。 |
| 409 | cannot_cancel | 無法取消,因為已收到驗證碼或時間已到。 |
一般流程
- 1
呼叫 prices 查看某項服務在各國家的價格,然後選擇國家。
- 2
把 service 和 country 發送到 numbers,取得號碼。
- 3
在你要註冊的服務中輸入號碼,讓它發送驗證短訊。
- 4
每 3~5 秒呼叫 numbers/{id},驗證碼在 codes 出現後即可使用。
- 5
如 2~3 分鐘後仍未收到,呼叫 cancel 取得退款,再試其他國家。