Implementation
Check Address
This section demonstrates how to call the Check API endpoint and how this is reflected on the Account Centre. The response returned will be a success message and no other details.
The example below uses the following request:
Endpoint:
https://api.autoaddress.com/3.0/check
Parameters:
addressLines=8 silver birches
city=Dunboyne
region=Co. Meath
country=IE
language=en
token=YOUR_TOKEN
After calling the Check API, the Reports on the Account Centre will provide statistics for how well the service is performing. For detailed information on reports, click here.
Verify Address
The following section demonstrates how to call the Verify API endpoint in multiple programming languages.
The examples below use the following request:
Endpoint:
https://api.autoaddress.com/3.0/verify
Parameters:
addressLines=8 silver birches
city=Dunboyne
region=Co. Meath
country=IE
language=en
token=YOUR_TOKEN
JavaScript (Node.js) Example
const fetch = require('node-fetch');
const url = 'https://api.autoaddress.com/3.0/verify' +
'?addressLine=8+silver+birches' +
'&city=Dunboyne' +
'®ion=Co.+Meath' +
'&country=IE' +
'&language=en' +
'&token=YOUR_TOKEN';
fetch(url)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
Python Example
import requests
url = 'https://api.autoaddress.com/3.0/verify'
params = {
'addressLine': '8 silver birches',
'city': 'Dunboyne',
'region': 'Co. Meath',
'country': 'IE',
'language': 'en',
'token': 'YOUR_TOKEN'
}
response = requests.get(url, params=params)
print(response.json())
C# Example
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
using (var client = new HttpClient())
{
var url = "https://api.autoaddress.com/3.0/verify" +
"?addressLine=8+silver+birches" +
"&city=Dunboyne" +
"®ion=Co.+Meath" +
"&country=IE" +
"&language=en" +
"&token=YOUR_TOKEN";
var response = await client.GetAsync(url);
var content = await response.Content.ReadAsStringAsync();
Console.WriteLine(content);
}
}
}
PHP Example
<?php
$url = "https://api.autoaddress.com/3.0/verify" .
"?addressLine=8+silver+birches" .
"&city=Dunboyne" .
"®ion=Co.+Meath" .
"&country=IE" .
"&language=en" .
"&token=YOUR_TOKEN";
$response = file_get_contents($url);
if ($response === FALSE) {
die('Error occurred');
}
$data = json_decode($response, true);
print_r($data);
?>