Implementation
Edited
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);
?>