Validate and format a phone number
hlrlookup.people.phone.validateValidates the number and returns number type, issuing network and formatted output without a live HLR lookup.
- 价格
- free按目录价
- 成功率
- 100%近 30 天 · 110,900 次
- 延迟 p50
- 186 毫秒p95 480 毫秒
- 最后验证
- 2026年10月8日实测可用
POSThttps://toolswitch.dev/v1/tools/hlrlookup.people.phone.validateBeta- 可用平台额度调用
- 同步返回
- 读取公开数据
参数
Free: a live call reported credits_spent 0 and left the balance unchanged. Answers arrive in results[0]: telephone_number_type and original_network_details. This is the network that issued the number range, not the one serving it now, and there is no live status.
| 参数 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| 请求体(JSON) | ||||
input_format | 字符串 | 可选 | ISO3 country code when telephone_number is in national format, e.g. GBR. | |
output_format | 字符串 | 可选 | Format of formatted_telephone_number: E164, PLUS_E164, NATIONAL, or an ISO3 country code. | |
telephone_number | 字符串 | 必填 | International E.164 digits without the leading +, or a national number with input_format. | 447540822872 |
- 请求体(JSON)
input_format字符串可选ISO3 country code when telephone_number is in national format, e.g. GBR.
output_format字符串可选Format of formatted_telephone_number: E164, PLUS_E164, NATIONAL, or an ISO3 country code.
telephone_number字符串必填International E.164 digits without the leading +, or a national number with input_format.
示例:
447540822872
代码示例
将 $TOOLSWITCH_KEY 替换为你在控制台创建的密钥。
Beta
curl -X POST 'https://toolswitch.dev/v1/tools/hlrlookup.people.phone.validate' \
-H "X-Toolswitch-Key: $TOOLSWITCH_KEY" \
-H "Content-Type: application/json" \
--data-raw '{"telephone_number":"447540822872"}'import os
import json
import requests
response = requests.request(
"POST",
"https://toolswitch.dev/v1/tools/hlrlookup.people.phone.validate",
headers={"X-Toolswitch-Key": os.environ["TOOLSWITCH_KEY"]},
json=json.loads("{\"telephone_number\":\"447540822872\"}"),
)
response.raise_for_status()
print(response.text)const response = await fetch("https://toolswitch.dev/v1/tools/hlrlookup.people.phone.validate", {
method: "POST",
headers: {
"X-Toolswitch-Key": process.env.TOOLSWITCH_KEY ?? "",
"Content-Type": "application/json",
},
body: JSON.stringify(JSON.parse("{\"telephone_number\":\"447540822872\"}")),
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
console.log(await response.text());网关接口为 Beta,地址与鉴权方式可能变更。 示例参数仅为样例数据。 调用按 free 计费,已含服务费。