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

Nearest Location

The Nearest Location API returns the places whose centres are nearest a latitude and longitude, nearest first, each with its distance in metres — which suburb a point is in, or near.

Request

GET https://api.getaddress.io/nearest-location/{latitude}/{longitude}?api-key={your-api-key}  
Example

The three places nearest Circular Quay, Sydney.

Request

GET https://api.getaddress.io/nearest-location/-33.8612/151.2107?api-key={your-api-key}&top=3  

Response

{
    "suggestions":
    [
        {
            "location": "THE ROCKS NSW 2000",
            "url": "/get-location/the-rocks-nsw-2000",
            "id": "the-rocks-nsw-2000",
            "distance": 322
        },
        {
            "location": "MILLERS POINT NSW 2000",
            "url": "/get-location/millers-point-nsw-2000",
            "id": "millers-point-nsw-2000",
            "distance": 654
        },
        {
            "location": "DAWES POINT NSW 2000",
            "url": "/get-location/dawes-point-nsw-2000",
            "id": "dawes-point-nsw-2000",
            "distance": 717
        }
    ]
}

Each suggestion resolves with the Get Location API like a Location suggestion does.

Options

Name Default Description Type
top 6 The number of places to return, 1–20. A query parameter. Number

Response Fields

Field Description
location / url / id As a Location suggestion.
distance Straight-line distance from the point to the place's centre, in whole metres.

Usage

  • A request that finds a place counts as 1 look-up against your plan's daily allowance.
  • A point with no Australian place within reach returns an empty list and costs nothing.
  • A latitude outside −90 to 90, or a longitude outside −180 to 180, returns 400.

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