Dec 282017 0 Responses

Phone Number Validation & Lookup JSON API

NumVerify helps web and application developers to validate national and international phone numbers. It provides simple RESTful API that one can use for phone number lookup and validation easily. Around 232 countries around the world is supported.
Passed number is checked in real-time, cross-verified with the latest database of international phone and mobile numbers and output is return with as much information as possible. API returns JSON string containing information like geographical location, carrier details, phone formats, and phone type.

In short, NumVerify allows you to find details behind every phone number and helps you to identify local-friendly number formats, reduce undelivered messages, and protect from spam and fraud.

 

 Find Local Format:
Systematically find and adapt international phone numbers into a identifiable local format. Numbers can be written in many formats. eg. 66-226636-7436 also can be written as (22)6636-7436 (national format) or +662266367436 (E.164 format).
This makes sure that the number chosen will be mostly identified by the locals by looking up the national format.

 

Check Number Format:
To err is human. People are prone to make mistakes so it is advisable to check and validate every numbers before entering into the database. This avoid junk entries and makes our database fully correct.

 

Identify Carrier:
You can identify the carrier behind the phone number. It is very easy to acquire phone numbers from some carriers. Anyone can get multiple phone numbers from a free on-line provider, enabling them to create fake profiles to defraud or spam a business. So you can make additional identify check for carrier associated with higher fraud instances.

 

Check Number Type:
You can check the number type like the number is landline or mobile. Some number types don’t accept all communication. For example, VoIP numbers and land-line numbers don’t accept text messages. Based on the number type, you can communicate.

The API will return following type of JSON string as output
{
  "valid": true,
  "number": "14158586273",
  "local_format": "4158586273",
  "international_format": "+14158586273",
  "country_prefix": "+1",
  "country_code": "US",
  "country_name": "United States of America",
  "location": "Novato",
  "carrier": "AT&T Mobility LLC",
  "line_type": "mobile"
}

SAMPLE PHP SCRIPT:
<?php
// set API Access Key
$access_key = 'YOUR_ACCESS_KEY';

// set phone number
$phone_number = '25269697384';

// Initialize CURL:
$ch = curl_init('http://apilayer.net/api/validate?access_key='.$access_key.'&number='.$phone_number.'');  
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// call the URL and get the response
$json = curl_exec($ch);
curl_close($ch);

// Decode JSON response:
$response = json_decode($json, true);

// print the response
var_dump($repsone);

// Access and use your preferred validation result properties
echo $response['valid'];
echo $response['local_format'];
echo $response['international_format'];

?>

Leave a Reply

Your email address will not be published. Please enter your name, email and a comment.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>