Autocomplete

Lookup for Postcode or Address auto complete options. Returns all available data if found.

Please read API Overview first


API Endpoint

The Autocomplete API endpoint won't change. It can be set as a constant.

https://api.autoaddress.ie/2.0/autocomplete
N.B. This EndPoint URL resolves to a dynamic IP address, please be aware of this when making DNS and Firewall decisions.

Request

To search for a Postcode or Address, a simple GET request from your desired language is all that is needed.

curl -v "https://api.autoaddress.ie/2.0/autocomplete?key=YOUR_KEY
&address=YOUR_ADDRESS_OR_POSTCODE"
$.ajax({
   type: "GET",
   dataType: "jsonp",
   url: "https://api.autoaddress.ie/2.0/autocomplete",
   data : {
       key: "YOUR_KEY",
       address: "YOUR_ADDRESS_OR_POSTCODE"
   },
   success: function(data){
       //do something with data
   }
});
$http.jsonp('https://api.autoaddress.ie/2.0/autocomplete',{
   params: {
      key: "YOUR_KEY",
      address: "YOUR_ADDRESS_OR_POSTCODE"
   }
}).success(function(data){
   //do something with data
});
require 'json'
require 'net/http'

uri = URI.parse("https://api.autoaddress.ie/2.0/autocomplete?key=YOUR_KEY&address=YOUR_ADDRESS_OR_POSTCODE")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
response = http.get(uri.request_uri)
result = JSON.parse(response.body)
import json
import urllib2
 
Response = urllib2.urlopen ("https://api.autoaddress.ie/2.0/autocomplete?key=YOUR_KEY&address=YOUR_ADDRESS_OR_POSTCODE")
jsonResult = json.load(Response)
using System.IO;
using System.Net;

HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://api.autoaddress.ie/2.0/autocomplete?key=YOUR_KEY&address=YOUR_ADDRESS_OR_POSTCODE");
request.Method = WebRequestMethods.Http.Get;
request.Accept = "application/json";

using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
{
   var result = new StreamReader(response.GetResponseStream()).ReadToEnd();
}

Response

The ​Autocomplete ​API call response ​may contain Options.  The Options consist of an array of addresses that match the input characters, together with a HATEOAS link. This allows interaction with the API solely through the hyperlinks we provide you.  As a developer you display the DisplayName to the user as a list. When the user selects an Option, retrieve the next href from that Option object and perform a GET request on that url which will make a call to the FindAddress API.
The following is a sample JSON response returned for a Autocomplete API request.

{
  "totalOptions": 1,
  "options": [
    {
      "displayName": "4 INNS COURT, WINETAVERN STREET, DUBLIN 8",
      "addressId": 1702105351,
      "addressType": {
        "code": 2100,
        "text": "NonResidentialAddressPoint"
      },
      "links": [
        {
          "rel": "next",
          "href": "https://api.autoaddress.ie/2.0/findaddress?key=YOUR_KEY&txn=4c43fa7d-6871-45f6-80cf-62f5034247cb&address=4%20INNS%20COURT%2C%20WINETAVERN%20STREET%2C%20DUBLIN%208&addressId=1702105351&limit=-1&vanityMode=False&addressElements=False"
        }
      ]
    }
  ],
  "input": {
    "key": "YOUR_KEY",
    "txn": "4c43fa7d-6871-45f6-80cf-62f5034247cb",
    "language": "en",
    "country": "ie",
    "limit": -1,
    "address": "4 inns co",
    "vanityMode": false,
    "addressElements": false
  },
  "links": [
    {
      "rel": "self",
      "href": "https://api.autoaddress.ie/2.0/autocomplete?key=YOUR_KEY&address=4+inns+co&limit=&language=en&vanityMode=false&addressElements=false"
    }
  ]
}

Input Fields

Name Type Default Description
key* string Licence key
address* string Address or Postcode to Search
limit integer 10 An upper limit on the number of options that may be returned.
language string "en" Language for returned address. Allowed values are "en" for English and "ga" for Irish.
country string "ie" Country the address should be searched in. Allowed values are "ie" for Ireland, "ni" for Northern Ireland and "gb" for Great Britain.
geographicAddress boolean false Return geographic address.
vanityMode boolean false Return vanity address format, if it exists.
addressElements boolean false Return address elements when an option link is followed.
addressProfileName string If supplied and an option link is followed, a reformatted address (according to profile rules) is returned in reformattedAddress field in JSON response.

* Required Field


Output Fields

Name Type Description
totalOptions int Number of options found
options option [ ] An array of Option objects (described below).
input object Input Object with Request Input Fields.
links link [ ] An array of Link objects (described below).
Option Object
Name Type Description
optionType enum Option Type Details
  • Standard = 0,
  • GroupedNonBusiness = 1,
  • GroupedBusiness = 2,
displayName string Option Name
postcode string Eircode or postcode
addressId integer Address ID (i.e. ECAD ID for Ireland)
addressType enum Type of Address Found
Full list of Address Types
links link [ ] An array of Link objects (described below).
Link Object
Name Type Description
rel string API response usually includes an array of HATEOAS links. This allows interaction with the API solely through the hyperlinks we provide you. You no longer need to hardcode logic into your client in order to use our API.
href string The hyperlink the client should follow is stored in the value of “href” property. That value can have some internal parameters, so the client should not parse it or modify it in any way.

Enter Sample Input Fields

Input Field Value Type Default
address* string
limit integer None
language string "en"
geographicAddress boolean false
vanityMode boolean false
addressElements boolean false
addressProfileName string

Response