Phone Number Validator
Validate and parse phone numbers. Returns country, type (mobile/fixed/VoIP), and formatted variants in national, international, and E.164 formats.
Try it
Fill in the fields below and hit Send.
Why use this
Parsing and validating phone numbers correctly across all countries is genuinely hard — country codes, national prefixes, number length rules, and carrier ranges all vary. libphonenumber (Google's library, used by Android) handles all of it. One call gives you everything: validity, country, type, and all three standard formats.
Pricing
| Any number, any country | 1 credit |
|---|
Request format
{
"phone": "+353861234567",
"country": "IE"
}
| Field | Type | Notes |
|---|---|---|
phone |
string | Required. E.164 format preferred (+353861234567). National format accepted with country hint. |
country |
string | Optional ISO 3166-1 alpha-2 hint (e.g. IE, US, GB). Only needed for national-format numbers without a + prefix. |
Response — valid number
{
"valid": true,
"phone": "+353861234567",
"country": "IE",
"countryCallingCode": "353",
"type": "MOBILE",
"formatted": {
"national": "086 123 4567",
"international": "+353 86 123 4567",
"e164": "+353861234567"
}
}
Response — invalid number
{ "valid": false, "phone": "+1234" }
Invalid numbers return HTTP 200 with valid: false. This is not an error — the service ran, 1 credit is charged.
Number types
MOBILE, FIXED_LINE, FIXED_LINE_OR_MOBILE, TOLL_FREE, PREMIUM_RATE, SHARED_COST, VOIP, PERSONAL_NUMBER, PAGER, UAN, VOICEMAIL, UNKNOWN
Errors (400, no charge)
Missing or empty phone field only.
API Reference
Endpoint
POST https://api.lightningapi.tools/phone-validator/validate
Required headers
Authorization: Bearer <apiKey>
Content-Type: application/json
Example request
{
"phone": "+353861234567"
}
Example response
{
"valid": true,
"phone": "+353861234567",
"country": "IE",
"countryCallingCode": "353",
"type": "MOBILE",
"formatted": {
"national": "086 123 4567",
"international": "+353 86 123 4567",
"e164": "+353861234567"
}
}