NewConnect Claude, Gemini, ChatGPT, and other AI agents to API Ninjas via our MCP server

Validate Phone API

The Validate Phone API allows you to check whether a given phone number is valid and return its metadata.

(4.4)

From 4,450 users

4,200+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
278ms318ms333ms614ms1137ms

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

  • number  required

    Phone number to check. If country is not set, the 3-digit country code prefix needs to be included.

  • country  optional

    2-letter ISO-3166 country code the phone number belongs to.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON object with the following fields or an error if the request is unsuccessful.

  • valid

    Boolean indicating whether the phone number is valid.

  • type

    Phone number type such as mobile, landline, or toll_free (if available).

  • international_number

    The normalized international representation of the phone number (E.164 format).

  • country_code

    The ISO-3166 country code associated with the phone number.

  • carrier

    The carrier / operator name when available.

Sample Request Live Demo!

number
country

Try this endpoint live with a free API key

Instant access — no credit card required.

https://api.api-ninjas.com/v1/validatephone?number=%2B12065550100

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
{
    valid:true,
    type:"landline",
    international_number:"+12065550100",
    country_code:"US",
    carrier:"Level 3 Communications"
}

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

  • 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.
  • Sign up for a free account to instantly get your API key, then pass it in the X-Api-Key header on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.
  • 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.
  • 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.
  • If you do not set the optional country parameter (a 2-letter ISO-3166 code), the required number parameter must include its 3-digit country code prefix, for example +12065550100. Browse related verification tools in the API catalog.
  • The JSON response returns valid (whether the number is valid), type (such as mobile, landline, or toll_free), international_number in normalized E.164 format, country_code (ISO-3166), and carrier when available. Unsuccessful requests instead return one of the documented error codes.
  • You can verify phone numbers at signup using the valid field, normalize contact lists into E.164 international_number format, and route messages based on the type and carrier fields. For broader contact verification, pair it with the Validate Email API.
  • Yes, the type field distinguishes values like mobile, landline, and toll_free when that information is available for the number. To enrich validation with geolocation data, you can combine it with the IP Lookup API.