G-NAF Addresses

Resolve a whole address string to one record

For an address you are holding rather than one being typed: a delivery address off a checkout form, a row in a spreadsheet.

Give the whole thing, however it is written. Abbreviations, missing commas and a missing state are all fine; where the street ends and the suburb begins is worked out by trying the readings against G-NAF.

This answers validation, geocoding and parsing in one call, because they are one question: matched says whether the address is real, and address carries the coordinates, the components and the pid. It is one unit, not three.

get/v1/addresses/resolve

Request

  • Base URL: https://api.locio.com.au
  • URL: https://api.locio.com.au/v1/addresses/resolve
  • Auth: HTTP bearer

Query parameters

qstring required
countrystring

Which country's addresses to search, as a two letter ISO 3166-1 code. Defaults to AU.

Only a secret key may send it. A public key is scoped to the country the request came from, which Cloudflare resolves from the browser's address, and this parameter is ignored on one: a key that sits in a page cannot choose what it may see.

A country no address data is loaded for answers 200 with an empty data, a country_code and a note saying so. That is not an error: it is the right answer for somebody typing from a country you do not hold.

Response

Whether it resolved, and what it resolved to. An address that is not in G-NAF is a 200 with matched false, not an error: that is the answer you asked for.

country_codestring

The country these results were searched in. AU today. Distinct from an address's own country, which is the country's name.

notestring

Why the answer is empty when empty is correct: no address data is loaded for this country, or the country could not be determined. Absent on an ordinary answer.

Example response

{
  "data": {
    "address": {
      "id": "GATAS717990791",
      "address_detail_pid": "GAVIC411711441",
      "gnaf_pid": "GAVIC411711441",
      "formatted": "Shop 3, 145 Sydney Road, Coburg VIC 3058",
      "components": {
        "building_name": "Piermont Resort",
        "flat_type": "Shop",
        "flat_number": "3",
        "level_type": "Level",
        "level_number": "3",
        "number_first": "145",
        "number_first_suffix": "A",
        "number_last": "437",
        "street_name": "Sydney",
        "street_type": "Road",
        "street_suffix": "West",
        "locality_name": "Coburg",
        "state": "VIC",
        "postcode": "3058",
        "lot_number": "3"
      },
      "lat": -37.7409,
      "lng": 144.9654,
      "mesh_block": "60049060000",
      "gnaf": {
        "date_created": "2004-04-29",
        "legal_parcel_id": "3\\RP4791",
        "alias_principal": "PRINCIPAL",
        "primary_secondary": "SECONDARY",
        "primary_pid": "GAVIC422078857",
        "geocode_type": "FRONTAGE CENTRE SETBACK"
      },
      "country_code": "AU"
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.