Real-Time Address Verification API

To save money on mailing and shipping, you need to verify address information right at the point of entry. Integrating our Realtime Global Address Verification Online API directly into your website or eCommerce application allows your customers to correct errors instantly and only valid addresses will be accepted.

Just register for a free API key and start testing our service.

Get Your FREE API Key

How Does the Address Validation API Work?

Integrating our Global Address Validation Online API into your website, eCommerce solution, CRM system or content management system (CMS) is very easy - code examples in Javascript, PHP, Java, C#, VB.NET are available below.

For each address, the API provides
  • the deliverability status
  • and a correction suggestion if the address is not deliverable

Address Validation API Code Examples

  • API Description
  • jQuery
  • PHP
  • Java
  • C#
  • VB.NET

Address Validation API

The Address Validation API returns the deliverability status and detailed information for the address that is provided as input.

API URLhttp[s]://api.address-validator.net/api/verify
MethodGET or POST
Example API request (using the GET method):
https://api.address-validator.net/api/verify?StreetAddress=Heilsbronner Str.4&City=Neuendettelsau&PostalCode=91564&CountryCode=de&APIKey=your API key
  
Input Parameters
   StreetAddressstreet address (string)
   AdditionalAddressInfoapt / suite / additional address info [optional] (string)
   Citycity (string)
   PostalCodezip / postal code [optional] (string)
   Statestate / province [optional] (string)
   CountryCodetwo-letter ISO 3166-1 country code [optional] (string)
   LocaleIETF language tag - for some countries, only English and the preferred local language used by the country's postal service is supported; default: local language [optional] (string)
   OutputCharsetoutput character set [us-ascii|utf-8]; default: 'utf-8' [optional] (string)
   APIKeyyour API key (string)
   Timeouttimeout in seconds [default 10s, min 5s, max 300s] (int)
API Result (JSON)
   statusVALID: address is correct and deliverable.
SUSPECT: address is incorrect and needs corrections to be deliverable, a suggested correction is provided.
INVALID: address is incorrect and not deliverable - either there is no match at all in the reference data or the address is ambiguous and there are a lot of different matches. In these cases automatic correction suggestions are not available.
DELAYED, RATE_LIMIT_EXCEEDED, API_KEY_INVALID_OR_DEPLETED, RESTRICTED, INTERNAL_ERROR
   addressline1address line 1 in standardized format
   addressline2address line 2 in standardized format
   addressline3address line 3 in standardized format
   formattedaddressfull address in standardized format
   streetstreet address in standardized format
   streetnumberstreet number in standardized format
   postalcodezip / postal code in standardized format
   citycity in standardized format
   rdiUSPS Residential Delivery Indicator (Commercial / Residential)
   districtdistrict in standardized format
   countycounty in standardized format
   statestate / province in standardized format
   countrytwo-letter ISO 3166-1 country code

Address Auto-Complete API

The Address Auto-Complete API returns suggestions matching the freeform address that is provided as input query.

API URLhttp[s]://api.address-validator.net/api/search
MethodGET or POST
Example API request (using the GET method):
https://api.address-validator.net/api/search?Query=Heilsbronner Str.4,91564 Neuendettelsau&APIKey=API key
  
Input Parameters
   Querysearch text (string)
   Countrytwo-letter ISO 3166-1 country code [optional] (string)
   LanguageIETF language tag - preferred language; default: local language [optional] (string)
   APIKeyyour API key (string)
   MaxResultsmaximum number of results [default 5, min 1, max 10] (int)
   Timeouttimeout in seconds [default 10s, min 5s, max 300s] (int)
  
API Result (JSON)
results (array)autocomplete suggestions
   idid to retrieve details for this address using the Address Retrieval API
   descriptiondescription for this address

Address Retrieval API

The Address Retrieval API returns detailed information for an address id provided as suggestion from the Address Auto-Complete API.

API URLhttp[s]://api.address-validator.net/api/fetch
MethodGET or POST
Input Parameters
   idaddress id as provided from the Address Auto-Complete API (string)
   APIKeyyour API key (string)
   Timeouttimeout in seconds [default 10s, min 5s, max 300s] (int)
  
API Result (JSON)
result (array)address details
   formattedaddressfull address in standardized format
   streetstreet address in standardized format
   streetnumberstreet number in standardized format
   postalcodezip / postal code in standardized format
   citycity in standardized format
   districtdistrict in standardized format
   countycounty in standardized format
   statestate / province in standardized format
   countrytwo-letter ISO 3166-1 country code

jQuery

<script type="text/javascript" src="path/to/jquery"></script>
<script type="text/javascript">
$(document).ready(function() {
    ...
    // send API request
    Locale = 'en';
    $.ajax({
        url: 'https://api.address-validator.net/api/verify',
        type: 'POST',
        data: { StreetAddress: StreetAddress,
                City: City,
                PostalCode: PostalCode,
                State: State,
                CountryCode: CountryCode,
                Locale: Locale,
                APIKey: 'your API key'},
        dataType: 'json',
        success: function (json) {
            // check API result
            if (typeof(json.status) != "undefined") {
                status = json.status;
                formattedaddress = json.formattedaddress;
            }
        }
    });
    ...
});
</script>

PHP

...
// build API request
$APIUrl = 'https://api.address-validator.net/api/verify';
$Params = array('StreetAddress' => $StreetAddress,
                'City' => $City,
                'PostalCode' => $PostalCode,
                'State' => $State,
                'CountryCode' => $CountryCode,
                'Locale' => $Locale,
                'APIKey' => 'your API key');
$Request = http_build_query($Params, '', '&');
$ctxData = array(
    'method'=>"POST",
    'header'=>"Connection: close\r\n".
    "Content-Type: application/x-www-form-urlencoded\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') {
    $formattedaddress = $result->{'formattedaddress'};
} else {
    echo $result->{'info'};
}
...

Java

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 StreetAddress = "...";
String City = "...";
String PostalCode = "...";
String State = "...";
String CountryCode = "US";
String Locale = "en";
String APIKey = "your API key";
String APIURL = "https://api.address-validator.net/api/verify";
try {
    HttpPost request = new HttpPost(APIURL);
    List <NameValuePair> Input = new ArrayList<NameValuePair>();
    Input.add(new BasicNameValuePair("StreetAddress", StreetAddress));
    Input.add(new BasicNameValuePair("City", City));
    Input.add(new BasicNameValuePair("PostalCode", PostalCode));
    Input.add(new BasicNameValuePair("State", State));
    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")) {
        String formattedaddress = (String) jsonObject.get("formattedaddress");
    }
    ...
} catch (IOException e) {
    e.printStackTrace();
} catch (ParseException e) {
    e.printStackTrace();
} finally {
    client.getConnectionManager().shutdown();
}
...

C# .NET 4.5

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

private class APIResult
{
    public String status { get; set; }
    public String formattedaddress { get; set; }
}

const String APIURL = "https://api.address-validator.net/api/verify";
HttpClient client = new HttpClient();
String StreetAddress = "...";
String City = "...";
String PostalCode = "...";
String State = "...";
String CountryCode = "US";
String Locale = "en";
String APIKey = "your API key";

var postData = new List<KeyValuePair<string, string>>();
postData.Add(new KeyValuePair<string, string>("StreetAddress", StreetAddress));
postData.Add(new KeyValuePair<string, string>("City", City));
postData.Add(new KeyValuePair<string, string>("PostalCode", PostalCode));
postData.Add(new KeyValuePair<string, string>("State", State));
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")) {
    String formattedaddress = res.formattedaddress;
}
...

VB.NET 4.5

' VB.NET 4.5
...
Private Sub checkAddress(ByVal StreetAddress As String,
                       ByVal City As String,
                       ByVal PostalCode As String,
                       ByVal State As String,
                       ByVal CountryCode As String,
                       ByVal Locale As String,
                       ByVal APIKey As String)
    Const APIURL As String = "https://api.address-validator.net/api/verify"
    Using client As New Net.WebClient
      Dim postData As New Specialized.NameValueCollection
      postData.Add("StreetAddress", StreetAddress)
      postData.Add("City", City)
      postData.Add("PostalCode", PostalCode)
      postData.Add("State", State)
      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") Then
        Dim formattedaddress As String = res.formattedaddress
      End If
    End Using
End Sub

Private Class APIResult
    Public status As String
    Public formattedaddress As String
End Class
...

Wordpress, jQuery & Node.js Plugins

Easy to install & use - these Address Validator API plugins are available already:

Get A Free Address Verification API Key!

You can use our Address Online Validation API to validate up to 100 addresses for free - sign up below for your free API key!

Register for a Free Address Validation Account!
You can use our Online Address Validation API to check up to 100 addresses for free -
just register for your free account and we send you an email with the details!