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

# /autocomplete API (v0.2)

This document outlines the usage of the Autocomplete API route, which allows for suggesting search terms based on partial input.

Endpoint

| Method | URL                                                   |
| ------ | ----------------------------------------------------- |
| GET    | https\://{identifier}.search.abtasty.com/autocomplete |

Query Parameters

All request data is sent as URL query parameters.

| Parameter       | Type    | Description                                             | Required | Example |
| --------------- | ------- | ------------------------------------------------------- | -------- | ------- |
| query           | string  | The partial string for which suggestions are requested. | Yes      | a       |
| hits\_per\_page | integer | The maximum number of suggestions to return.            | No       | 5       |

Response Body

The response body is a JSON object with the following property:

| Property    | Type             | Description                                                        |
| ----------- | ---------------- | ------------------------------------------------------------------ |
| suggestions | array of objects | An array of objects, where each object contains a text suggestion. |

## Suggestions Object Structure

Each object in the suggestions array has the following structure:

| Property | Type   | Description                          |
| -------- | ------ | ------------------------------------ |
| text     | string | The text of the proposed suggestion. |

Example Request and Response

## Request

```http
GET https://search-api.abtasty.com/autocomplete?client_id={clientId}&query=a&hits_per_page=5
```

## Response

```json
{
  "suggestions": [
    {
      "text": "brosse a cheveux"
    },
    {
      "text": "baume à levre"
    },
    {
      "text": "rouge à lèvres"
    },
    {
      "text": "baume à lèvres"
    },
    {
      "text": "brosse a dent"
    }
  ]
}
```


---

# 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.abtasty.com/commerce/search/api/autocomplete-api-v0.2.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.
