Overview
The Phone Validation API is a powerful tool for parsing and validating phone numbers.
Features
- Get country code: Phone number validation API can determine the country code of the phone number being validated.
- Get phone number type (e.g toll free): The API can identify the type of phone number, such as whether it is a toll-free number or a fixed line/mobile number.
- Convert phone number to URI: Phone validator API can convert the phone number into a URI format, which is useful for various applications and integrations.
- Parse and find phone numbers in a text (full-text search): Phone number validator API can scan a block of text and extract any phone numbers present within it, allowing for full-text search and extraction of phone numbers.
Getting Started
To access the Phone Validation API , you need to obtain an API key from AnyAPI.io. The API key is used for authentication and should be included in the request URL as a query parameter.
Let’s Try Sign In
Find phone numbers in text (full-text) endpoint
Send a GET request to the following URL to Find phone numbers in text (full-text)
curl --request GET \
--url 'https://anyapi.io/api/v1/phone/find?text=For%20tech%20support%20call%20%2B7%20(800)%20555-35-35%20internationally%20or%20reach%20a%20local%20US%20branch%20at%20%2B12133734253&apiKey=YOUR_API_KEY'
[
{
"number": {
"valid": true,
"countryCode": "RU",
"format": {
"international": "+7 800 555 35 35",
"national": "8 (800) 555-35-35"
},
"uri": "tel:+78005553535"
},
"endsAt": 40,
"startsAt": 22
},
{
"number": {
"valid": true,
"countryCode": "US",
"type": "FIXED_LINE_OR_MOBILE",
"format": {
"international": "+1 213 373 4253",
"national": "(213) 373-4253"
},
"uri": "tel:+12133734253"
},
"endsAt": 99,
"startsAt": 87
}
]
Request parameters
Use the parameters listed below to customize your request. Mandatory parameters are indicated
Response parameters
The API returns its response in a simple, lightweight JSON format.
Validate and parse phone numbers endpoint
Send a GET request to the following URL to Validate and parse phone numbers
curl --request GET \
--url 'https://anyapi.io/api/v1/phone/validate?phone_number=%2B12133734253&apiKey=YOUR_API_KEY'
{
"valid": true,
"countryCode": "US",
"type": "FIXED_LINE_OR_MOBILE",
"format": {
"international": "+1 213 373 4253",
"national": "(213) 373-4253"
},
"uri": "tel:+12133734253"
}
Request parameters
Use the parameters listed below to customize your request. Mandatory parameters are indicated
Response parameters
The API returns its response in a simple, lightweight JSON format.
Response and error codes
Whenever you make a request that fails for some reason, an error is returned also in the JSON format. The errors include an error code and description, which you can find in detail below.
Status Code | Type | Details |
---|---|---|
200 | OK | The request was successful. |
400 | Bad Request | The request was invalid or cannot be otherwise served. |
401 | Unauthorized | Authentication credentials were missing or incorrect. |
422 | Quota reached | The request cannot be served due to the application's rate limit having been exhausted for the resource. |
404 | Not Found | The requested resource could not be found. |
429 | Too Many Requests | The request cannot be served due to the application's rate limit having been exhausted for the resource. |
500 | Internal Server Error | Something went wrong on the server. |
503 | Service Unavailable | The service is temporarily unavailable. |