🚀 Experience the new and improved APIVoid! Check out what's new
A JSON API to check and validate phone numbers. Use this API to check if a phone number is valid, get carrier, location, line type. Format number in international, national and e164 format. Detect fake and abusive numbers.
Consumes 2 credits per API call
# Example Curl request from the command line:
curl -X POST "https://api.apivoid.com/v2/phone-validator" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY_HERE" \
-d '{"number": "12024746243"}'
# Example JSON output for a 200 HTTP status code:
{
"valid": true,
"number": "+12024746243",
"local_format": "(202) 474-6243",
"international_format": "+1 202-474-6243",
"e164_format": "+12024746243",
"country_prefix": "+1",
"country_code": "US",
"country_name": "United States",
"location": "Washington D.C.",
"carrier": "",
"line_type": "Fixed Line or Mobile",
"abusive": true,
"elapsed_ms": 155
}
Key Features
Businesses use this Phone Validator API to check if a phone number is valid, to check if it is an abusive or "bad" number, to format it as international format and to get country location.
This API uses different methods to check if the specified phone number is a valid number.
By checking if a phone number is valid, you can detect fake numbers like 123-456-7890.
This API can detect abusive phone numbers, check the abusive
field (a value of true means "bad").
With most numbers you can get the phone number location, carrier and line type (e.g Fixed or Mobile).
Common Use Cases
Our API can be used in many ways, from cybersecurity tasks to marketing-specific tasks. Here we showcase the most popular use cases according to our customers usage:
This API can be used to quickly validate if a phone number is valid and normalize it as needed.
Check a list of phone numbers (e.g in CSV format) to find invalid numbers or extract country location.
Validate and enhance phone numbers to guarantee the reliability of user-provided information.
Use this API to validate user-submitted phone numbers, block fake accounts that use invalid numbers.
USAGE EXAMPLE
All it takes is a HTTPS POST request with JSON payload to our endpoint, and you’ll receive the response within seconds, usually within 1 second or less. Here are a few code examples to use the API:
$phoneNumber = '441234567890';
$countryCode = 'GB';
$apiUrl = 'https://api.apivoid.com/v2/phone-validator';
$apiKey = 'your_api_key_here';
$ch = curl_init($apiUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'X-API-Key: ' . $apiKey]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['number' => $phoneNumber, 'country_code' => $countryCode]));
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode === 200) {
$responseData = json_decode($response, true);
print_r($responseData);
}
Create your account, pick a subscription plan, and make your first API call instantly with your API key—simple as that!
Get started now