Location Autocomplete API
This API lets you search for streets, suburbs, cities, and/or regions — collectively called "locations".
The filters (like street
, suburb
, city
, region
) are applied additively. To return multiple location types, exclude the location types you don’t want.
Example: To search for suburbs and cities only, set street=0
and region=0
.
This API works in tandem with the Location Metadata API.
Endpoint
New Zealand
https://api.addressfinder.io/api/nz/location/autocomplete
Parameters
Parameter | Description | Test Value |
---|---|---|
key | Your unique Addressfinder license key (find on Portal credentials). Type: string required | |
secret | Your unique secret key from Portal Credentials. You can also pass your secret key into the Type: string | |
q | The query string to be matched with the location. Type: string required | |
format | The format of the response. Default value: Type: json string required | |
street | Set to 0 to exclude streets, 1 to include only streets. Type: string | |
suburb | Set to 0 to exclude suburbs, 1 to include only suburbs. Type: string | |
city | Set to 0 to exclude cities, 1 to include only cities. Type: string | |
region | Set to 0 to exclude regions, 1 to include only regions. Type: string | |
region_code | Restricts results to a region. Valid codes include: Auckland Type: string | |
strict | Match strictness: - Default value: Type: 0 string | |
domain | Used to identify the calling service in the Addressfinder Portal. Must be a registered domain. Type: string | |
max | Max results to return (1–100). Default value: Type: 10 integer | |
highlight | Set to 1 to return an attribute Type: integer |
Responses
200 A list of location autocomplete completions
Name | Description | Example |
---|---|---|
completions | Type: array | - |
a | Canonical location as supplied by data sources. Type: string | Willcox Grove, Naenae, Lower Hutt |
pxid | Unique identifier for the location. Type: string | 1-.F.b.M.1C |
success | True if the request completed successfully. Type: boolean | true |
400 Invalid input or missing required parameters.
Name | Description | Example |
---|---|---|
error | Type: string | Missing required parameter 'key' |
See API Error Reference for details.