Email API
Phone Validator
Validate and normalize any phone number — E.164, international, and local formats plus line type and timezone.
POST
$0.01/call/v1/email/phone-validatorUsage
const res = await fetch('https://api.yepapi.com/v1/email/phone-validator', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ phone: '+14155550132' }),
});
const { data } = await res.json();
console.log(data);curl -X POST https://api.yepapi.com/v1/email/phone-validator \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"phone": "+14155550132"}'Request Body
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
phone | string | Yes | Phone number to validate, in any common format | — |
country_code | string | No | ISO country code hint for numbers without an international prefix (e.g., US) | — |
Response
{
"data": {
"carrier": null,
"countryCode": "US",
"e164Format": "+14155550132",
"intlFormat": "+1 415-555-0132",
"lineType": "FIXED_LINE_OR_MOBILE",
"localFormat": "(415) 555-0132",
"timezones": [
"America/Los_Angeles"
],
"valid": true
},
"ok": true
}Response Fields
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the request succeeded |
data.valid | boolean | Whether the phone number is valid |
data.e164Format | string | Number normalized to E.164 format (e.g., +14155550132) |
data.intlFormat | string | Number in international display format |
data.localFormat | string | Number in national/local display format |
data.countryCode | string | ISO country code of the number |
data.lineType | string | Line type (e.g., FIXED_LINE_OR_MOBILE, MOBILE) |
data.carrier | string | null | Carrier name, when known |
data.timezones | string[] | IANA timezones associated with the number |
Under the Hood
Pass country_code when validating numbers stored without a + prefix — otherwise national numbers can't be resolved to a country.