Validate Phone API
The Validate Phone API allows you to check whether a given phone number is valid and return its metadata.
API Status
Online - All Systems Operational
/v1/validatephone GET
https://api.api-ninjas.com/v1/validatephone
Returns metadata (including whether it is valid) for a given phone number.
Parameters
numberrequiredPhone number to check. If
countryis not set, the 3-digit country code prefix needs to be included.countryoptional2-letter ISO-3166 country code the phone number belongs to.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Sample Request Live Demo!
number
https://api.api-ninjas.com/v1/validatephone?number=+12065550100Headers
X-Api-KeyLog in or sign up to get your API KeySample Response
JSON
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"is_valid": true,
"is_formatted_properly": true,
"country": "United States",
"location": "Washington State",
"timezones": [
"America/Los_Angeles"
],
"format_national": "(206) 555-0100",
"format_international": "+1 206-555-0100",
"format_e164": "+12065550100",
"country_code": 1
}Code Examples
1
2
curl -X GET "https://api.api-ninjas.com/v1/validatephone?number=%2B12065550100" \
-H "X-Api-Key: YOUR_API_KEY"If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.