Holiday Sale! Get over 30% off when you subscribe to an annual plan!

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
285ms297ms327ms552ms1129ms

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

  • 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 API endpoint with all available parameters in our API playground

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
1 2 3 4 5 6 7 { "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.