Autocomplete
Get intelligent autocomplete suggestions for search terms to enhance user experience and improve search discovery.
Endpoint
/autocomplete
https://search-api.atriai.chat/autocomplete
Authentication
Request Parameters
The request body should contain a JSON object with the following parameters:
Request Body Parameters
The partial search term to get autocomplete suggestions for
Optional identifier for the consumer making the request. Used for analytics and tracking
Maximum number of autocomplete suggestions to return
Number of suggestions to skip for pagination
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:
Array of autocomplete suggestions based on the input term
The processed autocomplete term that was used
Time taken to process the autocomplete request in milliseconds
Maximum number of suggestions returned (as requested)
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
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.