Lookup

Overview

The Lookup endpoint is used to retrieve a complete address using parameters returned from an API call to another endpoint such as Autocomplete or Drilldown.

Please read API Overview first.

API Endpoint

https://api.autoaddress.com/3.0/lookup

Request

Please note: It is not possible to construct your own Lookup requests.

Attempts to use a manually constructed Lookup request will result in a HTTP error. 

Input Fields

NameTypeDescription
token*stringAccess token from Create Token endpoint
sig*stringSignature returned from previous API call
aa3id*stringAutoaddress ID for the Lookup
countrystringCountry to limit results to
languagestringLanguage to return result in

* Required Field

The following is an example cURL Lookup call.

curl --location 'https://api.autoaddress.com/3.0/lookup?aa3Id=AA3_ID&token=YOUR_TOKEN&sig=SIGNATURE'

Response

The following is a sample JSON response returned for a Lookup API request.

{
    "type": "lookup",
    "message": {
        "id": 100,
        "language": "en",
        "value": "Address Found"
    },
    "address": {
        "id": "IE1900166318",
        "language": "en",
        "charset": "Latn",
        "lines": [
            {
                "key": "AddressLine1",
                "value": "Unit 109"
            },
            {
                "key": "AddressLine2",
                "value": "Block A, Dublin Airport Business Park, Swords Road"
            }
        ],
        "city": {
            "value": ""
        },
        "region": {
            "value": "Dublin 9"
        },
        "postcode": {
            "value": "D09 CT96"
        },
        "country": {
            "language": "en",
            "value": "Ireland",
            "iso": "IE"
        },
        "label": [
            [
                "Unit 109"
            ],
            [
                "Block A, Dublin Airport Business Park, Swords Road"
            ],
            [
                "Dublin 9"
            ],
            [
                "D09 CT96"
            ]
        ]
    },
    "data": {},
    "links": [
        {
            "rel": "self",
            "href": "https://api.autoaddress.com:443/3.0/lookup?aa3Id=IE1900166318_Latn_en_V&sig=c5ac4d1fcfc95ed68bad4f33af3eca5d&token=fvBby7sc9D+oGwJKa6f83sMca6oNynj2ehtH5P%2FmQpHfFpqemQ+Ge17P1lVmboVXUauDn07Z8MjLx4%2FZBhW0wQ%3D%3D",
            "title": "self"
        },
        {
            "rel": "autoaddressformlayout",
            "href": "https://api.autoaddress.com/3.0/autoaddressformlayout?token=fvBby7sc9D%20oGwJKa6f83sMca6oNynj2ehtH5P%2FmQpHfFpqemQ%20Ge17P1lVmboVXUauDn07Z8MjLx4%2FZBhW0wQ%3D%3D&selectedCountry=IE&selectedLanguage=en&sig=0aa0d0290b930c76556fa180f0843ade",
            "title": "autoaddressformlayout"
        }
    ]
}

Output Fields

NameTypeDescription
typestringName of the response type
messageMessageA Message object (described below)
addressAddressAn Address object (described below)
datadynamicDynamic field containing customer specific data
linksLink[]An array of Link objects (described below)

Address Object

NameTypeDescription
idstringAutoaddress ID of the address
languagestringPrimary language for the address
charsetstringCharacter set the address is in
linesValue[]Key/value pairs for each line of the address
cityValueValue object containing the city the address is located in
regionValueValue object containing the region the address is located in
postcodeValueValue object containing the post code associated with the address
countryCountryA Country object (described below)
labelstring[]An array of labels containing each part of the address

Value Object

NameTypeDescription
keystringKey of the object
valuestringValue of the object

Country Object

NameTypeDescription
languagestringPrimary language of the country
valuestringName of the country
isostringISO code for the country

Message Object

NameTypeDescription
idintMessage ID
languagestringLanguage of the message
valuestringValue of the message

Link Object

NameTypeDescription
relstringType of link
hrefstringThe hyperlink the client should follow is stored in the value of this property
titlestringDisplay name of the link

Examples

jQuery

var settings = {
  "url": "https://api.autoaddress.com/3.0/lookup?aa3Id=AA3_ID&token=YOUR_TOKEN&sig=SIGNATURE",
  "method": "GET",
  "timeout": 0,
};

$.ajax(settings).done(function (response) {
  console.log(response);
});

Ruby

require "uri"
require "net/http"

url = URI("https://api.autoaddress.com/3.0/lookup?aa3Id=AA3_ID&token=YOUR_TOKEN&sig=SIGNATURE")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["User-Agent"] = "Ruby application" 

response = https.request(request)
puts response.read_body

Python

import requests

url = "https://api.autoaddress.com/3.0/lookup?aa3Id=AA3_ID&token=YOUR_TOKEN&sig=SIGNATURE"

payload = {}
headers = {
  'User-Agent': 'Python application'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

C#

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.autoaddress.com/3.0/lookup?aa3Id=AA3_ID&token=YOUR_TOKEN&sig=SIGNATURE");
request.Headers.Add("User-Agent", ".NET application");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());