Phone Validator API Reference
Check and validate a phone number: get country code, carrier and estimated line type, detect invalid, disposable (commonly used on signups) and abusive numbers.
Service details and pricing: Phone Validator API
Request example
Query the endpoint via an HTTPS POST request (replace YOUR_API_KEY_HERE with your API key):
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"}'The same request in PHP:
$number = '+12024746243';
$apiKey = 'YOUR_API_KEY_HERE';
$curl = curl_init('https://api.apivoid.com/v2/phone-validator');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'X-API-Key: ' . $apiKey]);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode(['number' => $number]));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($curl);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
if ($httpCode === 200) {
$responseData = json_decode($response, true);
print_r($responseData);
} else {
print_r('An error occurred: '.$response);
}Request parameters
Required
Phone number to submit, e.g. +12024746243 or 12024746243.
Optional
Country code of the phone number (e.g. US), not needed if the number has the prefix.
Response example
A successful request returns HTTP 200 with a JSON body:
{
"valid": true,
"number": "+12024746243",
"local_format": "(202) 474-6243",
"international_format": "+1 202-474-6243",
"e164_format": "+12024746243",
"uri": "tel:+12024746243",
"country_prefix": "+1",
"country_code": "US",
"country_name": "United States",
"location": "Washington D.C.",
"carrier": "",
"line_type": "Fixed Line or Mobile",
"disposable": true,
"abusive": true,
"elapsed_ms": 1
}Response fields
The fields returned in the JSON response:
validboolean
Returns true if the phone number format is valid.
numberstring
Returns the submitted phone number.
local_formatstring
Returns the phone number in local format, such as (202) 474-6243.
international_formatstring
Returns the phone number in international format (e.g. +1 202-474-6243).
e164_formatstring
Returns the phone number in E.164 format (e.g. +12024746243).
uristring
Returns the phone number in URI format suitable for HTML tags (e.g. tel:+12024746243).
country_prefixstring
Returns the phone number country prefix (e.g. +1 for the US).
country_codestring
Returns the phone number country code in ISO 3166-1 alpha-2 format (e.g. US).
country_namestring
Returns the phone number country name (e.g. United States).
locationstring
Returns the estimated geographic location of the phone number based on its numbering plan.
carrierstring
Returns the name of the phone number carrier (e.g. Vodafone).
line_typestring
Returns the phone line type, such as Fixed Line, Mobile, Fixed Line or Mobile, VoIP, Toll-Free, Premium Rate, Shared Cost, Personal Number, Pager, UAN, Voicemail, or Unknown.
disposableboolean
Returns true if the phone number is disposable (temporary).
abusiveboolean
Returns true if the phone number is disposable (temporary), spam or fake.
elapsed_msinteger
Time taken to process the request, in milliseconds.