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 | Description | Test Value |
---|---|---|
key | Your unique licence 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 partial address being searched Type: string | |
format | The required format of the response. Default value: Type: json string | |
delivered | This filter determines if the results are either delivered or not delivered by NZ Post:
Type: string | |
post_box | This filter includes/excludes PO Box style addresses.
Type: string | |
rural | This filter includes/excludes rural/urban addresses:
Type: string | |
strict | Determines how closely matched the results should be to the
Default value: Type: 2 string | |
region_code | Only return addresses within the boundary of the selected region (Regional Authority):
Type: 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. Type: string | |
max | The maximum number of results to return. The default is 10 results. Default value: Type: 10 integer | |
highlight | Returns an additional attribute in the response called highlighted_a. This attribute wraps the matching terms in the address with
Type: string | |
ascii | Set to Type: string |
Responses
200 OK
Name | Description | Example |
---|---|---|
completions | The API response will contain all the addresses and associated IDs (pxid) in the format requested in the API request. Type: array | - |
a | Canonical address as supplied by Land Information New Zealand or NZ Post. Type: string | 184 Williams Street, Kaiapoi 7630 |
pxid | The unique address identifier. Type: string | 2-.3.1q.2.4G.4c |
v | This is a deprecated field and is only retained for backwards compatibility reasons. You should ignore this field. Type: integer | 0 |
highlighted_a | When highlighting is enabled, contains the full address string with highlighted matching terms. Type: string | 184 Williams Street, Kaiapoi 7630 |
success | Indicates if the request was successful or not. Type: boolean | true |
400 Bad request
Name | Description | Example |
---|---|---|
completions | An empty array will be returned due to the error Type: array | - |
error_code | A unique numerical value identifying the error that occured Type: string | 1004 |
message | An informative message describing the error that occured Type: string | Secret not provided |
success | Indicates if the request was successful or not Type: boolean | false |
See API Error Reference for details.