AutoSuggest
Changed onAutoSuggest can take a slightly incorrect what3words address and suggest a list of valid what3words addresses. It has powerful features that can, for example, optionally limit results to a country or area, and prioritize results that are near the user.
Request
- Base URLhttps://api.what3words.com/v3
- Auth
- API key in query parameter key
- or API key in header X-Api-Key
Query parameters
A valid API key. Provide it as query parameter key; X-Api-Key header is also supported.
The full or partial what3words address to obtain suggestions for. At minimum this must be the first two complete words plus at least one character from the third word. Input parsing is case-insensitive, accepts an optional leading ///, and accepts supported dot-like delimiters (. 。 。 ・ ・ ︒ ។ ։ ။ ۔ ። ।).
This is a location, specified as latitude,longitude (often where the user making the query is). If specified, the results will be weighted to give preference to those near the focus. For convenience, longitude is allowed to wrap around the 180 line, so 361 is equivalent to 1.
Controls how many top suggestions are strongly biased towards the focus coordinate. Defaults to n-results when omitted. Non-numeric values return BadNFocusResults.
Restricts results to the specified country or countries, specified as comma-separated ISO 3166-1 alpha-2 country codes (for example GB,US). Parsing is case-insensitive, though uppercase is recommended.
Restricts results to a circle, specified by latitude,longitude,kilometres. For example, 51.4243877,-0.3474524,10 constrains results to those within 10 km of the point 51.4243877,-0.3474524.
Restricts results to a bounding box, specified by southwest latitude,southwest longitude,northeast latitude,northeast longitude. Latitudes and longitudes should be specified in order of increasing size. Longitude is allowed to wrap, so that you can specify bounding boxes which cross the ante-meridian, e.g., -4,178.2,22,195.4
Restricts results to a polygon, specified by a comma-separated list of lat,lng pairs. The polygon should be closed, i.e. the first element should be repeated as the last element; also the list should contain at least 4 entries. The API is currently limited to accepting up to 25 pairs.
For text input, adds a preferred language or locale to the set Autosuggest considers. Exact whole-word matches in the input can also add languages or locales. If omitted for text input, English is added as the default backstop. For voice input (input-type != text), this must be provided. Use a supported what3words code from /available-languages, including locale/script-specific codes where available (for example mn_la, zh_tr, oo_la).
Optional locale/script-specific code. Can be passed on its own. If provided with language, both values must be identical strings (for example language=mn_la&locale=mn_la).
For power users, used to specify voice input mode. Can be text (default), vocon-hybrid, nmdp-asr, generic-voice, speechmatics, or vin-big-data. Voice modes require language. If input is not in the expected format for a selected voice mode, the API may return BadInput.
The number of AutoSuggest results to return. Non-numeric values return BadNResults. Values greater than 100 are truncated to 100. Values less than or equal to 0 return an empty suggestions list. The default is 3.
Makes AutoSuggest prefer results on land to those in the sea. This setting is on by default. Use false to disable this setting and receive more suggestions in the sea.
Return data format type; can be either json (the default) or geojson
Response
Successful autosuggest results
Example response
{
"suggestions": [
{
"words": "filled.count.also",
"country": "US",
"nearestPlace": "Chillum, Maryland",
"language": "en",
"locale": "mn_la",
"rank": 1,
"distanceToFocusKm": 1.2
}
]
}Changes
- warning
deleted the
queryrequest parameterlocale - warning
removed the optional property
//from the response with the status - warning
removed the optional property
//from the response with the status - warning
added the new
BadInputenum value to the/response property for the response status - warning
added the new
BadInputenum value to the/response property for the response status - warning
added the new
BadNFocusResultsenum value to the/response property for the response status - warning
added the new
BadNFocusResultsenum value to the/response property for the response status - warning
added the new
BadNResultsenum value to the/response property for the response status - warning
added the new
BadNResultsenum value to the/response property for the response status - warning
added the new
DuplicateParameterenum value to the/response property for the response status - warning
added the new
DuplicateParameterenum value to the/response property for the response status - warning
added the new
MissingKeyenum value to the/response property for the response status - warning
added the new
MissingKeyenum value to the/response property for the response status - info
the endpoint scheme security
ApiKeyHeaderwas added to the API - info
the
queryrequest parameterkeybecame optional - info
added the new enum value
speechmaticsto thequeryrequest parameterinput-type - info
added the new enum value
vin-big-datato thequeryrequest parameterinput-type - info
removed the
BadLocaleenum value from the/response property for the response status - info
removed the
BadLocaleenum value from the/response property for the response status
- warning
- warning
deleted the
queryrequest parameterlocale - info
added the new optional
queryrequest parameterlocale - info
added the new optional
queryrequest parametern-focus-results
- warning