services / phone-validate
utilityoperational · 2 ms
Phone Number Validation
Parse and validate any phone number worldwide using libphonenumber. Returns is_valid, e164 (canonical international format e.g. '+4917612345678'), national_format, country_code (ISO alpha-2), and line_type (MOBILE/FIXED_LINE/VOIP/TOLL_FREE). Provide country_code hint (e.g. 'DE') for local numbers without country prefix.
Run free trial ↗3 free calls per day with the example input. Paid: $0.002 USDC, no limit.
Call it
Input
| Field | Type | Description |
|---|---|---|
| phone * | string | Phone number to validate. Can be in any format: E.164 ('+4915123456789'), national ('015123456789'), or international ('0049 151 23456789'). Include country code (+ prefix) for best results. |
| country_code | string | ISO 3166-1 alpha-2 country code hint for parsing national numbers without country prefix (e.g. 'DE' for Germany, 'US' for United States). Optional if number includes country code (+...). |
Output
| Field | Type | Description |
|---|---|---|
| phone | string | The input phone number as provided |
| is_valid | boolean | true if the number is a valid, dialable phone number |
| e164 | string | E.164 formatted number (e.g. '+4915123456789'). International standard format. |
| national_format | string | Nationally formatted number (e.g. '0151 23456789' for Germany) |
| international_format | string | Internationally formatted number (e.g. '+49 151 23456789') |
| country_code | string | ISO 3166-1 alpha-2 country code (e.g. 'DE', 'US', 'GB') |
| country_calling_code | string | International dialing code (e.g. '49' for Germany, '1' for US) |
| line_type | string | Type of phone line: 'MOBILE', 'FIXED_LINE', 'FIXED_LINE_OR_MOBILE', 'TOLL_FREE', 'PREMIUM_RATE', 'SHARED_COST', 'VOIP', 'PERSONAL_NUMBER', 'PAGER', 'UAN', 'VOICEMAIL', or 'UNKNOWN' |
| checks | object |
Example response (data)
{
"phone": "+49 151 23456789",
"is_valid": true,
"e164": "+4915123456789",
"national_format": "0151 23456789",
"international_format": "+49 151 23456789",
"country_code": "DE",
"country_calling_code": "49",
"line_type": "MOBILE",
"checks": {
"is_possible": true,
"is_valid": true
}
}