> For the complete documentation index, see [llms.txt](https://docs.whisk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.whisk.com/api/food-db/autocomplete.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
