驗證方式
在帳號的 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 取得退款,再換其他國家試試。