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 | Default | Description | Test Value |
---|---|---|---|
key |
| Your unique Addressfinder license key (find on Portal credentials). Required string | |
secret |
| Your unique secret key. You can also pass your secret key into the Optional string | |
q |
| The query string to be matched with the location. Required string | |
format | json | The format of the response. Required string | |
street |
| Set to 0 to exclude streets, 1 to include only streets. Optional string | |
suburb |
| Set to 0 to exclude suburbs, 1 to include only suburbs. Optional string | |
city |
| Set to 0 to exclude cities, 1 to include only cities. Optional string | |
region |
| Set to 0 to exclude regions, 1 to include only regions. Optional string | |
region_code |
| Restricts results to a region. Valid codes include: Auckland Optional string | |
strict | 0 | Match strictness: - Optional string | |
domain |
| Used to identify the calling service in the Addressfinder Portal. Must be a registered domain. Optional string | |
max | 10 | Max results to return (1–100). Optional integer | |
highlight |
| Set to 1 to return an attribute Optional integer |
Responses
200 A list of location autocomplete completions
Name | Type | Description | Example |
---|---|---|---|
completions | array | - | |
a | string | Canonical location as supplied by data sources. | Willcox Grove, Naenae, Lower Hutt |
pxid | string | Unique identifier for the location. | 1-.F.b.M.1C |
success | boolean | True if the request completed successfully. | true |
400 Invalid input or missing required parameters.
Name | Type | Description | Example |
---|---|---|---|
error | string | Missing required parameter 'key' |
See API Error Reference for details.