Address Autocomplete API
The Address Autocomplete API is used to search the Addressfinder database to return closely matching addresses which can then be selected from by the user. This API works in tandem with the Address Metadata API which is used to load the metadata associated with the selected address.
Endpoint
New Zealand
https://api.addressfinder.io/api/nz/address/autocomplete
Parameters
Parameter | Default | Description | Test Value |
---|---|---|---|
key |
| Your unique licence key (find on Portal credentials) Required string | |
secret |
| Your unique secret key (find on Portal credentials). This is required when calling API endpoints without a referer. Optional string | |
q |
| The partial address being searched Optional string | |
format | json | The required format of the response. Optional string | |
delivered |
| This filter determines if the results are either delivered or not delivered by NZ Post:
Optional string | |
post_box |
| This filter includes/excludes PO Box style addresses.
Optional string | |
rural |
| This filter includes/excludes rural/urban addresses:
Optional string | |
strict | 2 | Determines how closely matched the results should be to the
Optional string | |
region_code |
| Only return addresses within the boundary of the selected region (Regional Authority):
Optional string | |
domain |
| Used to identify which of your services is calling the API for activity monitoring purposes. This domain needs to be registered in the portal. Optional string | |
max | 10 | The maximum number of results to return. The default is 10 results. Optional integer | |
highlight |
| Returns an additional attribute in the response called highlighted_a. This attribute wraps the matching terms in the address with
Optional string | |
ascii |
| Set to Optional string |
Responses
200 OK
Name | Type | Description | Example |
---|---|---|---|
completions | array | The API response will contain all the addresses and associated IDs (pxid) in the format requested in the API request. | - |
a | string | Canonical address as supplied by Land Information New Zealand or NZ Post. | 184 Williams Street, Kaiapoi 7630 |
pxid | string | The unique address identifier. | 2-.3.1q.2.4G.4c |
v | integer | This is a deprecated field and is only retained for backwards compatibility reasons. You should ignore this field. | 0 |
highlighted_a | string | When highlighting is enabled, contains the full address string with highlighted matching terms. | 184 Williams Street, Kaiapoi 7630 |
success | boolean | Indicates if the request was successful or not. | true |
400 Bad request
Name | Type | Description | Example |
---|---|---|---|
completions | array | An empty array will be returned due to the error | - |
error_code | string | A unique numerical value identifying the error that occured | 1004 |
message | string | An informative message describing the error that occured | Secret not provided |
success | boolean | Indicates if the request was successful or not | false |
See API Error Reference for details.