// get /v1/phone-validator
电话验证 API
通过我们的 RESTful API 实时验证电话号码检查格式、检测类型、识别国家和运营商。
1 search credit
// api 控制台
API 参考中的示例响应
- valid
- true
- intl_format
- +1 650-555-0132
- line_type
- MOBILE
- carrier
- AT&T
- country_code
- US
- region.name
- California
- timezones
- 1 item
// 01 · 请求
Phone Validator只需一个 HTTPS 请求
使用您的密钥和密钥密码发送参数。每个 SDK、CLI 和 MCP 服务器都发出相同的调用。
GET
/phone-validator参数phone必填- The number, ideally in E.164
country_codeUS- Country, when the number has no prefix
curl "https://api.tomba.io/v1/phone-validator?phone=%2B16505550132" \
-H "X-Tomba-Key: $TOMBA_API_KEY" \
-H "X-Tomba-Secret: $TOMBA_SECRET_KEY"const res = await fetch("https://api.tomba.io/v1/phone-validator?phone=%2B16505550132", {
headers: {
"X-Tomba-Key": process.env.TOMBA_API_KEY,
"X-Tomba-Secret": process.env.TOMBA_SECRET_KEY
}
});
const { data } = await res.json();import os, requests
res = requests.get(
"https://api.tomba.io/v1/phone-validator?phone=%2B16505550132",
headers={
"X-Tomba-Key": os.environ["TOMBA_API_KEY"],
"X-Tomba-Secret": os.environ["TOMBA_SECRET_KEY"],
},
)
data = res.json()["data"]// 02 · 响应
返回的内容
JSON,在任何语言中都相同。Tomba 不知道的字段为 null,绝不猜测。
GET
/phone-validator字段dataobject | array- The number's details; an empty array, with phone repeating your input, when it isn't valid
data.validboolean | null- Whether the number is a valid phone number
data.intl_format, data.e164_format, data.local_formatstring | null- The number in international, E.164 and national formats
data.country_codestring | null- Country of the number (ISO code)
data.line_typestring | null- MOBILE, FIXED_LINE, FIXED_LINE_OR_MOBILE, VOIP, TOLL_FREE…
data.carrierstring | null- The network operator
data.region, data.timezonesobject | null, array | null- Where the number is registered, and its time zones
GET /phone-validator
200 OK· 1 search credit
{
"data": {
"valid": true,
"local_format": "(650) 555-0132",
"intl_format": "+1 650-555-0132",
"e164_format": "+16505550132",
"rfc3966_format": "tel:+1-650-555-0132",
"country_code": "US",
"line_type": "MOBILE",
"carrier": "AT&T",
"region": {
"name": "California",
"code": "CA"
},
"timezones": [
"America/Los_Angeles"
]
}
}// 03 · 费用和限制
调用的费用
仅在满足以下条件时才对调用收费。速率限制取决于您的套餐。
// 费用
1search credit
收费条件: Every successful response, including one with no data.
错误、429 和 451 响应,以及在用量窗口内重复的相同请求均不收费。
积分如何运作// 速率限制
每秒 / 每分钟 / 每天请求数| Free | Basic | Growth | Pro | |
|---|---|---|---|---|
| Search, finder, similar, technology | 1 / 2 / 5 | 3 / 50 / 500 | 5 / 80 / 1,000 | 8 / 150 / 4,000 |
| Email verifier | 1 / 2 / 10 | 2 / 40 / 500 | 3 / 60 / 1,000 | 5 / 100 / 4,000 |
Pro Plus, Scale and credit packs of 50,000 or more: no limit on these endpoints. Enterprise: no per-second or per-minute limit, 100,000 requests a day. Daily limits reset at 00:00 UTC. 速率限制
格式验证、号码类型检测、国家/地区识别、运营商查询和时区检测。
本地、国际、E.164 和 RFC3966 格式,附带国家代码和拨号代码。
每次电话验证 1 个积分。比电话查找(10 积分)便宜得多。
是的。批量电话验证 API 通过 CSV 或 API 处理数千个号码。