跳转到内容

实时单号检测

POST/v1/realtime/check/phone

同步检测一个号码。一次请求可以选择多个实时产品;每个产品必须使用实时产品 ID,不能使用批量产品 slug。

字段类型必填说明
identifierstring一个 E.164 手机号,例如 +8613800138000
countrystring完整 E.164 号码可省略;本地号码必须提供匹配的 ISO 国家代码。
product_idsarray<int>实时产品 ID 数组,1 到 10 个。
{
"request_id": "8c1e4f91-7bd8-4d7e-a3ae-3d7e5b0c6c11",
"identifier": "+8613800138000",
"status": "succeeded",
"request_status": "completed",
"total_reserved": 0.004000,
"total_charged": 0.004000,
"total_refunded": 0.000000,
"results": [
{
"product_id": 101,
"product": "whatsapp-realtime",
"result": "valid",
"cached": false,
"billing_status": "charged",
"charged_amount": 0.004000,
"refunded_amount": 0.000000,
"checked_at": "2026-09-05T10:00:00Z",
"error_code": null
}
]
}
Terminal window
curl -X POST "https://app.zelnum.com/api/v1/realtime/check/phone" \
-H "X-API-Key: zn_live_xxxxxxxxxxxx" \
-H "Idempotency-Key: UNIQUE_REQUEST_ID" \
-H "Content-Type: application/json" \
-d '{"identifier":"+8613800138000","country":"CN","product_ids":[101,102]}'
  • 计费:每个产品按本次请求锁定的单次价计费,缓存命中同价。仅 valid / invalid 收费;unknown、超时或通道繁忙退还对应子项。total_reserved = total_charged + total_refundedcharged_amount 是退款后的净扣费。
  • 部分成功:组合检测部分成功仍返回 HTTP 200,status=partial_succeeded;全部失败为 failed。请逐项检查 billing_statuserror_code,不要仅凭 HTTP 200 判断成功。
  • 重放Idempotency-Key 最长 191 字节,以用户为作用域。超时或 500 后使用原 Key 和原内容重试;处理中的重试返回 409/request_in_progress。日志与幂等结果默认保留 30 天。
HTTPcode含义与处理
400invalid_realtime_request / idempotency_key_required检查号码、产品及请求键;未预扣。
401 / 403unauthorized / account_banned / realtime_disabled检查密钥、账号状态与实时功能权限;未预扣。
402insufficient_balance余额不足,整个组合不执行。
409request_in_progress / idempotency_conflict处理中请按 Retry-After 重试;内容冲突时不能复用该 Key。
429realtime_rate_limitedRetry-After 等待;未预扣。
503realtime_route_unavailable / realtime_fact_cache_unavailable / realtime_rate_limiter_unavailable通道、缓存或限流设施不可用;未预扣,请稍后重试。
500internal_error结果暂时不能确认;保留原 Key 重试,不要换 Key 盲目重发。

子项 error_code 会指出上游、通道容量、请求时限、缓存或并发保护问题;上述失败子项均不收费