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
/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.
Response
A JSON object with the following fields or an error if the request is unsuccessful.
validBoolean indicating whether the phone number is valid.
typePhone number type such as
mobile,landline, ortoll_free(if available).international_numberThe normalized international representation of the phone number (E.164 format).
country_codeThe ISO-3166 country code associated with the phone number.
carrierThe carrier / operator name when available.
Sample Request Live Demo!
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 3-digit 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 returnsvalid(whether the number is valid),type(such asmobile,landline, ortoll_free),international_numberin normalized E.164 format,country_code(ISO-3166), andcarrierwhen available. 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 thevalidfield, normalize contact lists into E.164international_numberformat, and route messages based on thetypeandcarrierfields. For broader contact verification, pair it with the Validate Email API.Can the API tell me whether a number is mobile or landline?
Yes, thetypefield distinguishes values likemobile,landline, andtoll_freewhen that information is available for the number. To enrich validation with geolocation data, you can combine it with the IP Lookup API.