The Autocomplete search type is optimized to search as a user types. Users can enter addresses quickly and easily, using a real-time suggestions list and fuzzy matching, along with Location-biasing in certain countries, while delimiters such as commas and dashes are handled accurately and transparently.

As your end user starts typing an address into a single text box, our API will attempt to autocomplete by providing a list of addresses that match the current input. Each keystroke will update the list with more accurate suggestions.

Methods

This is a two-step process involving two endpoint methods:

  1. Search for an address. Autocomplete is optimised to provide suggestions as you type, but also works with addresses entered in full.
    • POST /address/search/v1: Setting any additional options is not required - Autocomplete is the default search type.
  2. Format the selected address, using the 'global address key'.
    • 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.

Recommended implementation

There are several ways this can be implemented into your solution. Here we will describe the way we recommend.

  1. The user starts to type into the single text box. Suggestions will be displayed in a drop-down.
  2. The end user can then either:
    • Continue to type for a more accurate selection in the drop-down
    • Select from the results in the drop-down
  3. When a selection is made, the final address is displayed per your website design i.e. a single text box or a multi-fielded layout.

Autocomplete sequence diagram

The recommended workflow (as demonstrated by our sample code) is:

Autocomplete developer workflow

The relevant address components can be stored in your database if required.