AutoSuggest Component | what3words
We use cookies, including third party cookies, to improve your experience and for marketing purposes. By continuing to browse we assume you have consented to their use.Learn more
got it

AutoSuggest Component

To add a what3words field with AutoSuggest into your website (we call this the AutoSuggest Component), follow these simple instructions:

1
Get an API Key

You will need a valid API key in order to use this component within your website.

2
Add what3words.js script to your website header

Add this snippet of code between the <head></head> tags.

<script src="https://assets.what3words.com/sdk/v3.1/what3words.js?key=YOUR-API-KEY"></script>
Copied

3
Customise the AutoSuggest Component

Number of results
(n-results)
3
Language
(language)
Focus on coordinates
(autosuggest-focus)
Number of focused results
(n-focus-results)
0
Clip to bounding box
(clip-to-bounding-box)
Clip to polygon
(clip-to-polygon)
Clip to circle
(clip-to-circle)
1
Clip to country
(clip-to-country)
Placeholder
(placeholder)
Error message
(error-message)

4
Add this snippet of code into the site body where you would like the what3words field to appear:

<what3words-autosuggest  />
Copied

Using an e-commerce platform? Try one of our plugins instead…

Back to top