what3words API

AutoSuggest with Coordinates

Changed on

Similar to the AutoSuggest endpoint, but returns coordinates in the response. This endpoint requires special permissions.

get/autosuggest-with-coordinates

Request

  • Base URL
    https://api.what3words.com/v3
  • Auth
    • API key in query parameter key
    • or API key in header X-Api-Key

Query parameters

keystring

A valid API key. Provide it as query parameter key; X-Api-Key header is also supported.

inputstring required
Example:filled.count.s

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 (. 。 。 ・ ・ ︒ ។ ։ ။ ۔ ። ।).

focusstring
Example:51.521251,-0.203586

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.

n-focus-resultsstring
Example:5

Controls how many top suggestions are strongly biased towards the focus coordinate. Defaults to n-results when omitted. Non-numeric values return BadNFocusResults.

clip-to-countrystring
Example:GB,US

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.

clip-to-circlestring
Example:51.4243877,-0.3474524,10

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.

clip-to-bounding-boxstring
Example:51.515900,-0.212517,51.527649,-0.191746

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

clip-to-polygonstring
Example:51.521,-0.343,52.6,2.3324,54.234,8.343,51.521,-0.343

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.

languagestring

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).

localestring
Example:mn_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).

input-type'text' | 'vocon-hybrid' | 'nmdp-asr' | 'generic-voice' | 'speechmatics' | 'vin-big-data'

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.

n-resultsinteger

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.

prefer-landboolean

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.

format'json' | 'geojson'

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",
      "square": {
        "southwest": {
          "lat": 51.520847,
          "lng": -0.195521
        },
        "northeast": {
          "lat": 51.520847,
          "lng": -0.195521
        }
      },
      "nearestPlace": "Chillum, Maryland",
      "coordinates": {
        "lat": 51.520847,
        "lng": -0.195521
      },
      "language": "en",
      "locale": "mn_la",
      "rank": 1,
      "distanceToFocusKm": 1.2,
      "map": "https://w3w.co/filled.count.also"
    }
  ]
}

Changes

    • warning

      deleted the query request parameter locale

    • warning

      added the new BadInput enum value to the / response property for the response status

    • warning

      added the new BadInput enum value to the / response property for the response status

    • warning

      added the new BadNFocusResults enum value to the / response property for the response status

    • warning

      added the new BadNFocusResults enum value to the / response property for the response status

    • warning

      added the new BadNResults enum value to the / response property for the response status

    • warning

      added the new BadNResults enum value to the / response property for the response status

    • warning

      added the new DuplicateParameter enum value to the / response property for the response status

    • warning

      added the new DuplicateParameter enum value to the / response property for the response status

    • warning

      added the new MissingKey enum value to the / response property for the response status

    • warning

      added the new MissingKey enum value to the / response property for the response status

    • info

      the endpoint scheme security ApiKeyHeader was added to the API

    • info

      the query request parameter key became optional

    • info

      added the new enum value speechmatics to the query request parameter input-type

    • info

      added the new enum value vin-big-data to the query request parameter input-type

    • info

      added the optional property // to the response with the status

    • info

      removed the BadLocale enum value from the / response property for the response status

    • info

      removed the BadLocale enum value from the / response property for the response status

    • warning

      deleted the query request parameter locale

    • info

      added the new optional query request parameter locale

    • info

      added the new optional query request parameter n-focus-results