# 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>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.whisk.com/api/food-db/autocomplete.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
