Phone Number Online Validation API

Based on our experience in Phone Number List Validation, we also offer our service as Phone Number Online Validation API.

We offer complete, full-service validation for any national or international phone number:

Avoid Disconnects and Wrong Numbers - Keep Your List Clean!

Keep your customer database clean and focus on real people - real-time phone number validation is easy to implement and has a lot of benefits for your business. The best way to capture good leads is to verify contact information right at the point of entry.

Keep in Touch With Your Customers

Integrate our online phone number validation API directly into your sign-up forms or web apps and allow your website visitors to fix errors in their data instantly - only valid, usable phone numbers will be accepted.

How Does It Work?

Integrating our Phone Validation API into the Javascript, PHP, Java, C#, VB.NET code of your website or application or into content management systems (CMS) like Drupal, TYPO3, WordPress or Joomla is very easy now - all you have to do is to send a HTTP/HTTPS request to our servers!
If you have any questions, just send us an email to support@byteplant.com.


<script type="text/javascript" src="path/to/jquery"></script>
<script type="text/javascript">
$(document).ready(function() {
    ...
    // send API request
    Locale = 'en-US';
    $.ajax({
        url: 'http://www.phone-validator.net/api/verify',
        type: 'POST',
        data: { PhoneNumber: PhoneNumber, CountryCode: CountryCode,
                Locale: Locale, APIKey: 'your API key'},
        dataType: 'json',
        success: function (json) {
            // check API result
            if (typeof(json.status) != "undefined") {
                status = json.status;
                linetype = json.linetype;
                geolocation = json.geolocation;
                regioncode = json.regioncode;
                formatnational = json.formatnational;
                formatinternational = json.formatinternational;
            }
        }
    });
    ...
});
</script>

...
// build API request
$APIUrl = 'http://www.phone-validator.net/api/verify';
$Params = array('PhoneNumber' => $PhoneNumber,
                'CountryCode' => $CountryCode,
                'Locale' => $Locale,
                'APIKey' => 'your API key');
$Request = @http_build_query($Params);
$ctxData = array(
     'method' => "POST",
     'header' => "Connection: close\r\n".
     "Content-Length: ".strlen($Request)."\r\n",
     'content'=> $Request);
$ctx = @stream_context_create(array('http' => $ctxData));

// send API request
$result = json_decode(@file_get_contents(
    $APIUrl, false, $ctx));

// check API result
if ($result && $result->{'status'} == 'VALID_CONFIRMED') {
    $linetype = $result->{'linetype'};
    $geolocation = $result->{'geolocation'};
    $regioncode = $result->{'regioncode'};
    $formatnational = $result->{'formatnational'};
    $formatinternational = $result->{'formatinternational'};
} else {
    echo $result->{'info'};
}
...

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;

import org.apache.http.util.EntityUtils;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
...
HttpClient client = new DefaultHttpClient();
String PhoneNumber = "phone number";
String CountryCode = "country code";
String Locale = "locale";
String ApiKey = "your API key";
String APIURL = "http://www.phone-validator.net/api/verify";
try {
    HttpPost request = new HttpPost(APIURL);
    List <NameValuePair> Input = new ArrayList<NameValuePair>();
    Input.add(new BasicNameValuePair("PhoneNumber", PhoneNumber));
    Input.add(new BasicNameValuePair("CountryCode", CountryCode));
    Input.add(new BasicNameValuePair("Locale", Locale));
    Input.add(new BasicNameValuePair("APIKey", ApiKey));
    request.setEntity(new UrlEncodedFormEntity(Input));
    HttpResponse response = client.execute(request);
    HttpEntity entity = response.getEntity();
    String Output = EntityUtils.toString(entity, "UTF-8");
    JSONParser parser = new JSONParser();
    Object obj = parser.parse(Output);
    JSONObject jsonObject = (JSONObject) obj;
    String result = (String) jsonObject.get("status");
    if (result.equalsIgnoreCase("VALID_CONFIRMED")) {
        String LineType = (String) jsonObject.get("linetype");
        String GeoLocation = (String) jsonObject.get("geolocation");
        String RegionCode = (String) jsonObject.get("regioncode");
        String FormatNational = (String) jsonObject.get("formatnational");
        String FormatIntl = (String) jsonObject.get("formatinternational");
    }
    ...
} catch (IOException e) {
    e.printStackTrace();
} catch (ParseException e) {
    e.printStackTrace();
} finally {
    client.getConnectionManager().shutdown();
}
...

// C# .NET 4.5
using System;
using System.Collections.Generic;
using System.Net.Http;
...

private class APIResult
{
    public String status { get; set; }
    public String linetype { get; set; }
    public String geolocation { get; set; }
    public String regioncode { get; set; }
    public String formatnational { get; set; }
    public String formatinternational { get; set; }
}

const String APIURL = "http://www.phone-validator.net/api/verify";
HttpClient client = new HttpClient();
String PhoneNumber = "phone number";
String CountryCode = "country code";
String Locale = "locale";
String ApiKey = "your API key";

var postData = new List<KeyValuePair<string, string>>();
postData.Add(new KeyValuePair<string, string>("PhoneNumber", PhoneNumber));
postData.Add(new KeyValuePair<string, string>("CountryCode", CountryCode));
postData.Add(new KeyValuePair<string, string>("Locale", Locale));
postData.Add(new KeyValuePair<string, string>("APIKey", APIKey));

HttpContent content = new FormUrlEncodedContent(postData);

HttpResponseMessage result = client.PostAsync(APIURL, content).Result;
string resultContent = result.Content.ReadAsStringAsync().Result;

APIResult res = new System.Web.Script.Serialization.JavaScriptSerializer().
                    Deserialize<APIResult>(resultContent);

if (res.status.Equals("VALID_CONFIRMED")) {
    String LineType = res.linetype;
    String GeoLocation = res.geolocation;
    String RegionCode = res.regioncode;
    String FormatNational = res.formatnational;
    String FormatInternational = res.formatinternational;
}
...

' VB.NET 4.5
...
Private Sub checkPhoneNumber(ByVal PhoneNumber As String,
                       ByVal CountryCode As String,
                       ByVal Locale As String,
                       ByVal APIKey As String)
    Const APIURL As String = "http://www.phone-validator.net/api/verify"
    Using client As New Net.WebClient
      Dim postData As New Specialized.NameValueCollection
      postData.Add("PhoneNumber", PhoneNumber)
      postData.Add("CountryCode", CountryCode)
      postData.Add("Locale", Locale)
      postData.Add("APIKey", APIKey)
      Dim reply = client.UploadValues(APIURL, "POST", postData)
      Dim data As String = (New System.Text.UTF8Encoding).GetString(reply)
      Dim res = New System.Web.Script.Serialization.JavaScriptSerializer().
        Deserialize(Of APIResult)(data)
      If res.status.Equals("VALID_CONFIRMED") Then
        Dim LineType As String = res.linetype
        Dim GeoLocation As String = res.geolocation
        Dim RegionCode As String = res.regioncode
        Dim FormatNational As String = res.formatnational
        Dim FormatInternational As String = res.formatinternational
      End If
    End Using
End Sub

Private Class APIResult
    Public status As String
    Public linetype As String
    Public geolocation As String
    Public regioncode As String
    Public formatnational As String
    Public formatinternational As String
End Class
...

API URL : http://www.phone-validator.net/api/verify
Method: GET/POST
Parameters:
   PhoneNumber: phone number to validate (string)
   CountryCode: two letter ISO 3166-1 country code (string); default 'US'
   Locale: IETF language tag for Geocoding (string); default 'en-US'
   APIKey: API key (string)
Validation API Result (JSON):
   status: VALID_ACTIVE, VALID_CONFIRMED, VALID_UNCONFIRMED or INVALID
   linetype: FIXED_LINE, MOBILE, VOIP etc.
   geolocation: geographical location (city, county, state)
   regioncode: two letter ISO 3166-1 country code
   formatnational: national number format
   formatinternational: international number format