The Lookup search type is designed to enable the user to enter a key search term to produce desired address information.
The user enters the search key and the service returns the relevant information for that match. If the search key matches multiple pieces of information, a list of suggestions is returned, from which the user can select the required one. When the user has entered the search key, they should start the search manually.
Lookup normally requires minimal user interaction. However, in some cases it is possible that the search key matches more than one address, in which case a flattened list of suggestions is returned.
This search type is only available for use with certain datasets that contain a logical reverse lookup search key.
Methods
This is a two-step process involving two endpoint methods:
Enter a search key.
POST /address/lookup/v1 looks for an address that matches the search key entered.
Format the selected address, using the 'global address key'. You can choose between:
GET /address/format/v1/{global_address_key}: Formats an address into the standard 7 line global layout, thereby creating a well formatted address for every country and territory.
POST /address/format/v1/{global_address_key}: Formats an address into one of your available custom layouts.
Recommended implementation
The user enters the search key and manually starts a search.
Select a full address from the results.
When a selection is made, the final address is displayed and any optional enrichment information shown per your website design i.e. a single text box or a multi-fielded layout.
The recommended workflow (as demonstrated by our sample code) is:
The relevant address and enrichment components can be stored in your database if required.
Lookup v2 adds the ability to determine locality information, including state, suburb, county and province using just a ZIP or postal code, and vice versa. Plus return up to 1000 addresses in the given locality/postal code.
Secondary search
The customer has the option to search on both city/town names and region/state/province names to perform more accurate searches.
It can also provide address suggestions using what3words, a popular proprietary geocoding system. User can enter a what3words value for any geographical location* and receive a list of all possible addresses within a 100m radius of that location. User will also receive a list of suggested alternatives using what3words powerful AutoSuggest function.
(* Please note that what3words are currently only supported for locations in the United Kingdom.)
POST /address/lookup/v2 finds all combinations of corresponding locality information for the value entered.
Use the returned suggestions to populate other locality fields on your form.
Optionally, set the Add-addresses header on the lookup request to retrieve a list of addresses that reside within the provided search key.
Format the selected address, using the 'global address key'. You can choose between:
GET /address/format/v1/{global_address_key}: Formats an address into the standard 7 line global layout, thereby creating a well formatted address for every country and territory.
POST /address/format/v1/{global_address_key}: Formats an address into one of your available custom layouts.
Enrichment data
You can include enrichment data by adding the relevant layout to the /format endpoint. Please contact us if you would like to purchase Enrichment data.
Recommended implementation
The user enters a single piece of locality information, a utility meter number, a full or partial what3words address and manually starts a search.
Either select a combination of locality information or a full address from the results. For what3words, the value from the AutoSuggest can be used to therefore make a search for addresses within 100m of the suggestion.
When the collection of locality information is selected, related fields are pre-filled on your website. Should a final address be selected, it is then displayed per your website design i.e. a single text box or a multi-fielded layout. For what3words, the final address can be formatted just as for the locality-based search.
The recommended workflow (as demonstrated by our sample code) is:
The relevant address and enrichment components can be stored in your database if required.