Validate Phone API
The Validate Phone API allows you to check whether a given phone number is valid and return its metadata.
From 4,450 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 278ms | 318ms | 333ms | 614ms | 1137ms |
Similar APIs
Didn't find what you were looking for? Suggest an improvement
https://api.api-ninjas.com/v1/validatephone
Returns metadata (including whether it is valid) for a given phone number.
Parameters
numberrequiredPhone number to check. The leading
+is optional. Ifcountryis not set, include the country code (e.g.12065550100or+12065550100).countryoptional2-letter ISO-3166 country code the phone number belongs to.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON object with the following fields or an error if the request is unsuccessful.
is_validBoolean indicating whether the phone number is valid.
is_formatted_properlyWhether the supplied number was already correctly formatted.
countryCountry the phone number is registered to.
locationGeographic region/location associated with the phone number.
timezonesArray of IANA time zones associated with the phone number.
format_nationalThe phone number in national format.
format_internationalThe phone number in international format.
format_e164The phone number in E.164 format.
country_codeThe numeric country calling code (e.g.,
1for the United States).line_typeLine type of the number, such as
mobile,landline,voip, ortoll_free. For carrier and VOIP details, see the Phone Lookup API.is_mobileWhether the number is a mobile number.
format_rfc3966The phone number as an RFC3966
tel:URI.is_possibleWhether the number is a possible number (valid length and pattern), even if not confirmed valid.
Sample Request Live Demo!
Try our APIs in the API playground
Sign up for a free API key to get started — no credit card required.
https://api.api-ninjas.com/v1/validatephone?number=%2B12065550100Headers
X-Api-KeyLog in or sign up to get your API KeySample Response
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.
Frequently Asked Questions
Can I use the Validate Phone API for commercial purposes?
Yes, but you must have a premium subscription. Commercial use of the Validate Phone API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.How do I get an API key and start using the Validate Phone API?
Sign up for a free account to instantly get your API key, then pass it in theX-Api-Keyheader on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.What happens if I exceed my quota for the month?
Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.What happens if a request to the Validate Phone API fails?
The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.Do I need to include the country code in the number parameter?
If you do not set the optionalcountryparameter (a 2-letter ISO-3166 code), the requirednumberparameter must include its country code prefix, for example+12065550100. Browse related verification tools in the API catalog.What metadata does the Validate Phone response include?
The JSON response returnsis_valid,is_formatted_properly,country,location,timezones, theformat_national,format_international,format_e164, andformat_rfc3966representations,country_code,line_type(such asmobile,landline, ortoll_free),is_mobile, andis_possible. For a number'scarrier, VOIP status, and MCC/MNC, use the Phone Lookup API. Unsuccessful requests instead return one of the documented error codes.What are some use cases for the Validate Phone API?
You can verify phone numbers at signup using theis_validfield, normalize contact lists into E.164format_e164, and display or route numbers using theline_typeandformat_nationalfields. For broader contact verification, pair it with the Validate Email API.Can the API tell me whether a number is mobile or landline?
Theline_typefield distinguishes values likemobile,landline, andtoll_freewhere the numbering plan makes them distinct; North American numbers share ranges, so they can reportfixed_line_or_mobile. To resolve the actual carrier and VOIP status, use the Phone Lookup API.