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

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. The leading + is optional. If country is not set, include the country code (e.g. 12065550100 or +12065550100).

  • 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.

  • is_valid

    Boolean indicating whether the phone number is valid.

  • is_formatted_properly

    Whether the supplied number was already correctly formatted.

  • country

    Country the phone number is registered to.

  • location

    Geographic region/location associated with the phone number.

  • timezones

    Array of IANA time zones associated with the phone number.

  • format_national

    The phone number in national format.

  • format_international

    The phone number in international format.

  • format_e164

    The phone number in E.164 format.

  • country_code

    The numeric country calling code (e.g., 1 for the United States).

  • line_type

    Line type of the number, such as mobile, landline, voip, or toll_free. For carrier and VOIP details, see the Phone Lookup API.

  • is_mobile

    Whether the number is a mobile number.

  • format_rfc3966

    The phone number as an RFC3966 tel: URI.

  • is_possible

    Whether the number is a possible number (valid length and pattern), even if not confirmed valid.

Sample Request Live Demo!

number
country

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=%2B12065550100

Headers

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

Sample Response

JSON
{
    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,
    line_type:"fixed_line_or_mobile",
    is_mobile:true,
    format_rfc3966:"tel:+1-206-555-0100",
    is_possible:true
}

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 country code prefix, for example +12065550100. Browse related verification tools in the API catalog.
  • The JSON response returns is_valid, is_formatted_properly, country, location, timezones, the format_national, format_international, format_e164, and format_rfc3966 representations, country_code, line_type (such as mobile, landline, or toll_free), is_mobile, and is_possible. For a number's carrier, VOIP status, and MCC/MNC, use the Phone Lookup API. Unsuccessful requests instead return one of the documented error codes.
  • You can verify phone numbers at signup using the is_valid field, normalize contact lists into E.164 format_e164, and display or route numbers using the line_type and format_national fields. For broader contact verification, pair it with the Validate Email API.
  • The line_type field distinguishes values like mobile, landline, and toll_free where the numbering plan makes them distinct; North American numbers share ranges, so they can report fixed_line_or_mobile. To resolve the actual carrier and VOIP status, use the Phone Lookup API.