短信验证码 API

通过 BinOTP API,你可以在自己的应用或脚本中租用虚拟号码、接收 OTP 验证码并取消订单。所有接口均返回 JSON,并使用 API 密钥认证。

快速开始

基础地址:
https://binotp.com/api/v1
你的 API Key:
免费注册 即可获得 API 密钥,登录后在账户页面查看。
认证 — 建议通过请求头传递 API Key:
X-API-Key: YOUR_API_KEY
旧方式 ?apikey=... 仍然可用,以免破坏现有集成,但 不建议使用:URL 中的密钥会被记录 会出现在服务器日志、浏览器历史和 Referer 请求头中。

限制与说明

  • 每个 API 密钥每分钟最多 60 次请求(所有接口合计),超出将返回 429 错误。
  • 最多同时有 5 个订单等待验证码。
  • 建议每 5 秒调用一次 get-sms,更频繁的查询并不会让验证码更快到达。
  • 订单过期仍未收到验证码时,get-sms 返回 status "expired",refunded 字段显示退回到余额的金额。

代码示例

租用一个美国的 Google(opt4)号码,然后每 5 秒查询一次验证码,直到有结果。

# 1. Rent a Google (opt4) number in the US
curl -X POST "https://binotp.com/api/v1/rent-number" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"service": "opt4", "country": "US"}'

# 2. Check for the SMS code (repeat every 5 seconds until status is not "waiting_sms")
curl "https://binotp.com/api/v1/get-sms?orderId=ORDER_ID" \
  -H "X-API-Key: YOUR_API_KEY"

接口列表

8
GET/api/v1/me

获取账户信息

返回你的余额与账户信息。

参数:
名称类型是否必填说明
apikeystring必填你的 API Key
返回结果:
{ "success": true, "balance": 10.00, "email": "user@example.com", "username": "demo" }

错误码

出错时,API 返回下表中的 HTTP 状态码,JSON 中 success 为 false,error 字段描述错误(始终为英文):

{ "success": false, "error": "Insufficient balance" }
HTTPerror(示例)含义
400Missing service or country code缺少必填参数或参数无效。
400Insufficient balance余额不足,请充值后重试。
400Temporarily out of stock, please try again该服务/国家暂时无号,请稍后重试或换一个国家。
400Price is $0.25 which exceeds your maxPrice of $0.20…当前价格高于你设置的 maxPrice,请提高 maxPrice 或通过 /prices 查询价格。
401Invalid or missing API key缺少 API 密钥、密钥错误,或账户已被停用。
404Order not found你的账户中没有该订单。
409Cannot cancel: SMS code already received…该订单已收到验证码,无法取消,请调用 get-sms 读取。
409Cannot cancel yet: please wait about 2 minutes after purchase…购买后暂时无法立即取消,请几分钟后重试。
429Too many requests. Limit: 60/min每分钟请求超过 60 次。
429You already have 5 active orders (max 5)…等待验证码的订单过多,请等待收码、过期或取消部分订单。
429Cannot cancel yet: please wait … minute(s) after purchase…购买后暂时无法立即取消,请几分钟后重试。
503Service temporarily unavailable服务暂时不可用,请稍后重试。