# Retrieve autocomplete suggestions

Returns ranked suggestions based on the free-text query, destination popularity, and the provided context. This endpoint is designed for real-time "as-you-type" autocomplete experiences.\n\nSupports prefix matching with basic typo tolerance and is optimised for low-latency search.\n\nYou can optionally restrict results by destination type using filters.types.\n\nEach suggestion includes a destination identifier, localised name, and geographic context.

Endpoint: POST /common/autocomplete
Version: 3.2-Beta
Security: BearerAuth

## Header parameters:

  - `X-Affiliate-Id` (integer, required)
    Include here your Affiliate identifier number

## Request fields (application/json):

  - `query` (string, required)
    Free-text search query used to generate suggestions. Leading and trailing whitespace is ignored. Must contain between 3 and 200 characters.

  - `language` (string)
    Language code used to localise names in the response. Only one language can be specified per request.

  - `country` (string, required)
    ISO 3166-1 alpha-2 country code used as the primary search context for autocomplete ranking. This field is required.

  - `filters` (object)
    Restricts results to the specified destination types. If omitted, all types are included. It should not be an empty object.

  - `filters.types` (array)
    Restricts results to the specified destination types. If omitted, all destination types are considered.
    Enum: "airport", "hotel", "landmark", "city", "district", "region", "country"

## Response 200 fields (application/json):

  - `request_id` (string)
    Uniquely identifies the request. Please provide this identifier when contacting support.

  - `data` (array)

  - `data.type` (string)
    The type of destination.
    Enum: "airport", "hotel", "landmark", "city", "district", "region", "country"

  - `data.name` (object)
    Display name in the requested language. Only one language key is returned.

  - `data.name.^[a-z]{2}(-[a-z]{2})$` (string,null)
    The content localised in this language.

  - `data.id` (string)
    The identifier of the destination. The format depends on the destination type.

  - `data.location` (object)
    Geographic context of the suggestion, including city, country and coordinates.

  - `data.location.city` (integer)
    A signed integer number that uniquely identifies a city. The full list can be obtained by calling common/locations/cities.

  - `data.location.city_name` (object)
    A string localised in multiple languages.

  - `data.location.city_name.^[a-z]{2}(-[a-z]{2})$` (string,null)
    The content localised in this language.

  - `data.location.coordinates` (object)

  - `data.location.coordinates.latitude` (number)

  - `data.location.coordinates.longitude` (number)

  - `data.location.country` (string)
    A two-letter code that uniquely identifies a country. This code is defined by the ISO 3166-1 alpha-2 standard (ISO2) as described here: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2. The full list can be obtained by calling common/locations/countries.

  - `data.location.country_name` (object)
    A string localised in multiple languages.

  - `data.location.country_name.^[a-z]{2}(-[a-z]{2})$` (string,null)
    The content localised in this language.

## Response 400 fields (application/json):

  - `request_id` (string, required)
    Uniquely identifies the request. Please provide this identifier when contacting support.

  - `errors` (array, required)

  - `errors.id` (string, required)

  - `errors.message` (string, required)


## Response 500 fields
