Autocomplete

Get intelligent autocomplete suggestions for search terms to enhance user experience and improve search discovery.

Endpoint

POST/autocomplete
Get autocomplete suggestions based on indexed content to help users discover relevant search terms.
https://search-api.atriai.chat/autocomplete

Authentication

Type:
Bearer Token
Header:
Authorization
Your project-specific Bearer token for authentication

Request Parameters

The request body should contain a JSON object with the following parameters:

Request Body Parameters

autocomplete_termstringREQUIRED

The partial search term to get autocomplete suggestions for

consumer_idstring

Optional identifier for the consumer making the request. Used for analytics and tracking

Default: null
limitinteger

Maximum number of autocomplete suggestions to return

Default: null
offsetinteger

Number of suggestions to skip for pagination

Default: null

Request Example

Example request body for autocomplete:

{
  "autocomplete_term": "gaming lap",
  "consumer_id": "user-12345",
  "limit": 5
}

Response Schema

The API returns a JSON object with autocomplete suggestions:

suggestionsarray[string]

Array of autocomplete suggestions based on the input term

querystring

The processed autocomplete term that was used

processingTimeMsinteger

Time taken to process the autocomplete request in milliseconds

limitinteger

Maximum number of suggestions returned (as requested)

offsetinteger

Number of suggestions skipped (as requested)

Response Example

Example response for a successful autocomplete request:

{
  "suggestions": [
    "gaming laptop",
    "gaming laptop pro",
    "gaming laptop elite",
    "gaming laptop budget",
    "gaming laptop accessories"
  ],
  "query": "gaming lap",
  "processingTimeMs": 12,
  "limit": 5,
  "offset": 0
}

Try it out

Select a language to see how to make a request to the AI Search API

C
cURL Request
curl -L 'https://search-api.atriai.chat/autocomplete' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_BEARER_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "autocomplete_term": "gaming lap",
    "limit": 5
  }'
!

Bearer Token Required

Replace YOUR_BEARER_TOKEN with your actual bearer token to authenticate requests.