Loading...
Sign in to see the examples with your own API key.

Get Location

The Get Location API resolves a Location suggestion 'Id' to the place and its centre.

Request

GET https://api.getaddress.nz/get-location/{id}?api-key={your-api-key}  
Example

Resolving the suggestion for 'Wellington Central, Wellington 6011'. The id is URL-encoded in the path (| is %7C).

Request

GET https://api.getaddress.nz/get-location/Wellington%20Central%7CWellington%7C6011?api-key={your-api-key}  

Response

{
    "id": "Wellington Central|Wellington|6011",
    "location": "Wellington Central, Wellington 6011",
    "locality_name": "Wellington Central",
    "town_city": "Wellington",
    "territorial_authority": "Wellington City",
    "postcode": "6011",
    "coordinates": {
        "latitude": -41.284889,
        "longitude": 174.774879
    }
}

Response Fields

Field Description
id The place's location id: its suburb, town or city and postcode joined by |, e.g. Normanby|Hāwera|4614. A place with no postcode ends in |.
location The label, the same text the suggestion showed.
locality_name The suburb or locality, as LINZ names it.
town_city The town or city, as LINZ names it.
territorial_authority The district or city council, e.g. Wellington City. A place on a boundary has two, joined by ; .
postcode The four-digit postcode. Unofficial, and "" when none could be assigned.
coordinates The centre of the place (WGS84): the mean position of its addresses. For a crescent-shaped suburb it can fall just outside the suburb's boundary.

Usage

  • Each successful Get Location request counts as 1 look-up against your plan's daily allowance.
  • An unknown id returns 404 and costs nothing.

Rate Limiting

Your subscription's plan will limit the number of requests per 5 minute span. Exceeding your plan's rate limit will return a HTTP 429 response.
The Retry-After HTTP header contains the number of seconds until a successful retry can be made.

Top