# Autocomplete

### Description

[Swagger doc](https://api.whisk.com/spec/#/FoodAPI/FoodAPI_Autocomplete)

Autocomplete returns a set of products to be tracked based on incomplete user input. Usually autocomplete call comes before calling Search API. Most relevant suggestions are returned in the first place

### Parameters

<table><thead><tr><th>Name</th><th width="105">Optional</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>query</td><td>no</td><td>string</td><td>Max length is 255 chars</td></tr><tr><td>language</td><td>no</td><td>string</td><td>ISO 639-1 two letter language code</td></tr><tr><td>country</td><td>yes</td><td>string</td><td>ISO 3166-1 two letter country code</td></tr><tr><td>limit</td><td>yes</td><td>int</td><td>Number of suggestions. Max 10 suggestions.</td></tr></tbody></table>

#### Request example

```bash
curl -X GET "https://api.whisk.com/food/v2/autocomplete?query=app&language=en&country=gb&limit=5" -H  "accept: application/json" -H  "Authorization: Bearer %WHISK_TOKEN%"s
```

### Response

Data returned in JSON format. Empty strings, zero values, empty arrays and null values are not returned.

#### JSON response example

```json
{
  "suggestions": [
    {
      "name": "apple"
    },
    {
      "name": "apples"
    },
    {
      "name": "aperol"
    },
    {
      "name": "cox apple"
    },
    {
      "name": "red apple"
    }
  ]
}
```

#### Core attributes

<table><thead><tr><th>Name</th><th width="102">Optional</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>name</td><td>no</td><td>string</td><td>Localized suggestion text</td></tr></tbody></table>
