Autocomplete

Overview

The Autocomplete endpoint is used to retrieve a list of suggested addresses from a search query.
Please read API Overview first.

API Endpoint

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

Request

To retrieve Autocomplete results, a simple  GET request from your desired language is all that is needed.

The request must be authenticated. Please see the API Authentication documentation for full details.

Input Fields

NameTypeDescription
address*stringAddress to search
token*stringAccess token from Create Token endpoint. Required if key is not provided. See Authentication documentation for more details
countrystringCountry to limit results to
latitudestringLatitude to search at
longitudestringLongitude to search at
h3indexstringH3 index to search in
languagestringLanguage to return result in
* Required Fields

The following is an example cURL Autocomplete call using an address and token.

curl --location 'https://api.autoaddress.com/3.0/autocomplete?address=YOUR_ADDRESS&token=YOUR_TOKEN'

Response

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

{
    "type": "autocomplete",
    "message": {
        "id": 3100,
        "language": "en",
        "value": "Select an option below"
    },
    "options": [
        {
            "value": "Dublin Street Medical Centre, 19 Dublin Street, Longford, N39",
            "link": {
                "rel": "drilldown",
                "href": "https://api.autoaddress.com/3.0/drilldown?aa3Id=IE311b5a4b-afca-4129-a7d2-0f91e49504a8_Latn_en_V&address=Dublin&token=fvBby7sc9D%20oGwJKa6f83sMca6oNynj2ehtH5P%2FmQpHfFpqemQ%20Ge17P1lVmboVXUauDn07Z8MjLx4%2FZBhW0wQ%3D%3D&sig=72d5fe4df89c974e17dcba77cac73cfb",
                "title": "Dublin Street Medical Centre, 19 Dublin Street, Longford, N39"
            },
            "format": {
                "highlights": [
                    0,
                    29
                ],
                "lineBreaks": []
            },
            "suffix": "2 Addresses"
        },
        {
            "value": "DUBLIN STREET DENTAL CLINIC, 43 Dublin Street, Dundalk, Co. Louth, A91",
            "link": {
                "rel": "lookup",
                "href": "https://api.autoaddress.com/3.0/lookup?aa3Id=IE1900120792_Latn_en_V&token=fvBby7sc9D%20oGwJKa6f83sMca6oNynj2ehtH5P%2FmQpHfFpqemQ%20Ge17P1lVmboVXUauDn07Z8MjLx4%2FZBhW0wQ%3D%3D&sig=2beb534cbbd8bb17019084947761cab8",
                "title": "DUBLIN STREET DENTAL CLINIC, 43 Dublin Street, Dundalk, Co. Louth, A91"
            },
            "format": {
                "highlights": [
                    0,
                    28
                ],
                "lineBreaks": []
            },
            "suffix": ""
        },
        {
            "value": "R.S. MACHINERY (DUBLIN), Summit House, Unit 134, Slaney Close, Dublin Industrial Estate, Glasnevin, Dublin 11",
            "link": {
                "rel": "lookup",
                "href": "https://api.autoaddress.com/3.0/lookup?aa3Id=IE1900013833_Latn_en_V&token=fvBby7sc9D%20oGwJKa6f83sMca6oNynj2ehtH5P%2FmQpHfFpqemQ%20Ge17P1lVmboVXUauDn07Z8MjLx4%2FZBhW0wQ%3D%3D&sig=b5bb36daddeb612736b146bd75d9c321",
                "title": "R.S. MACHINERY (DUBLIN), Summit House, Unit 134, Slaney Close, Dublin Industrial Estate, Glasnevin, Dublin 11"
            },
            "format": {
                "highlights": [
                    0,
                    24
                ],
                "lineBreaks": []
            },
            "suffix": ""
        },
        {
            "value": "DUBLINIA VIKING CENTRE, Winetavern Street, Dublin 8",
            "link": {
                "rel": "lookup",
                "href": "https://api.autoaddress.com/3.0/lookup?aa3Id=IE1900012790_Latn_en_V&token=fvBby7sc9D%20oGwJKa6f83sMca6oNynj2ehtH5P%2FmQpHfFpqemQ%20Ge17P1lVmboVXUauDn07Z8MjLx4%2FZBhW0wQ%3D%3D&sig=36f5ce138b2dd61808d07174d39e413d",
                "title": "DUBLINIA VIKING CENTRE, Winetavern Street, Dublin 8"
            },
            "format": {
                "highlights": [
                    0,
                    23
                ],
                "lineBreaks": []
            },
            "suffix": ""
        },
        {
            "value": "Dublin Airport Business Park, Swords Road, Dublin 9",
            "link": {
                "rel": "drilldown",
                "href": "https://api.autoaddress.com/3.0/drilldown?aa3Id=IE05457e65-9978-458c-98a2-f3488f7232fa_Latn_en_V&address=Dublin&token=fvBby7sc9D%20oGwJKa6f83sMca6oNynj2ehtH5P%2FmQpHfFpqemQ%20Ge17P1lVmboVXUauDn07Z8MjLx4%2FZBhW0wQ%3D%3D&sig=d9430edbe44c93053b3bd9c66712fe93",
                "title": "Dublin Airport Business Park, Swords Road, Dublin 9"
            },
            "format": {
                "highlights": [
                    0,
                    29
                ],
                "lineBreaks": []
            },
            "suffix": "10 Addresses"
        },
        {
            "value": "Dublin Airport, Co. Dublin, K67",
            "link": {
                "rel": "drilldown",
                "href": "https://api.autoaddress.com/3.0/drilldown?aa3Id=IEbc478e11-46ea-4796-bcef-8aa6e2e85602_Latn_en_V&address=Dublin&token=fvBby7sc9D%20oGwJKa6f83sMca6oNynj2ehtH5P%2FmQpHfFpqemQ%20Ge17P1lVmboVXUauDn07Z8MjLx4%2FZBhW0wQ%3D%3D&sig=81fa90c866977d36f15cf8aa97d1626d",
                "title": "Dublin Airport, Co. Dublin, K67"
            },
            "format": {
                "highlights": [
                    0,
                    15
                ],
                "lineBreaks": []
            },
            "suffix": "2 Addresses"
        },
        {
            "value": "Dublin Business Centre, Blackwater Road, Dublin Industrial Estate, Dublin 11",
            "link": {
                "rel": "drilldown",
                "href": "https://api.autoaddress.com/3.0/drilldown?aa3Id=IEb0322659-ac6e-4e39-b344-496b206bfd26_Latn_en_V&address=Dublin&token=fvBby7sc9D%20oGwJKa6f83sMca6oNynj2ehtH5P%2FmQpHfFpqemQ%20Ge17P1lVmboVXUauDn07Z8MjLx4%2FZBhW0wQ%3D%3D&sig=1600f94491c670bd72a78d73cc683dfa",
                "title": "Dublin Business Centre, Blackwater Road, Dublin Industrial Estate, Dublin 11"
            },
            "format": {
                "highlights": [
                    0,
                    23
                ],
                "lineBreaks": []
            },
            "suffix": "4 Addresses"
        },
        {
            "value": "Dublin Gate Street, Athlone, Co. Westmeath, N37",
            "link": {
                "rel": "drilldown",
                "href": "https://api.autoaddress.com/3.0/drilldown?aa3Id=IE9ca86ea0-2555-420f-894f-637691077cb1_Latn_en_V&address=Dublin&token=fvBby7sc9D%20oGwJKa6f83sMca6oNynj2ehtH5P%2FmQpHfFpqemQ%20Ge17P1lVmboVXUauDn07Z8MjLx4%2FZBhW0wQ%3D%3D&sig=88a953af55c55824254fabadc9548b67",
                "title": "Dublin Gate Street, Athlone, Co. Westmeath, N37"
            },
            "format": {
                "highlights": [
                    0,
                    19
                ],
                "lineBreaks": []
            },
            "suffix": "10 Addresses"
        }
    ],
    "links": [
        {
            "rel": "self",
            "href": "https://api.autoaddress.com:443/3.0/autocomplete?address=Dublin&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&sig=eef1cd3044a3f9b2b7187f78b6078972",
            "title": "Enter your address manually >"
        }
    ]
}

Output Fields

NameTypeDescription
typestringName of the response type
messageMessageA Message object (detailed below)
optionsOption[]An array of Option objects (detailed below)
linksLink[]An array of Link object (detailed below)

Message Object

NameTypeDescription
idintMessage ID
languagestringLanguage of the message
valuestringValue of the message

Option Object

NameTypeDescription
valuestringDisplay name of the option
linkLinkA Link Object (Detailed below)
formatFormatFormatting instructions for autocomplete widget
suffixstringSuffix to be displayed after the options value

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/autocomplete?address=YOUR_ADDRESS&token=YOUR_TOKEN",
  "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/autocomplete?address=YOUR_ADDRESS&token=YOUR_TOKEN")


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/autocomplete?address=YOUR_ADDRESS&token=YOUR_TOKEN"
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/autocomplete?address=YOUR_ADDRESS&token=YOUR_TOKEN");
request.Headers.Add("User-Agent", ".NET application");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());