Overview
Use the Autocomplete API to power Quick Search on your website. It sends and collects user-typed queries and retrieves data based on the active sections configured in the Athena XAI Dashboard, such as products or categories.
The response is tailored to the specified sections. You can create custom sections and set their layouts, titles and display conditions.
You can also configure Autocomplete Banners in the dashboard. They are included in the API response under the banners section.
Endpoint
| Method | Path |
|---|---|
POST | /api/v1/autocomplete |
POST | /api/v2/autocomplete |
Request body
{
"q": "Yoga", //required
"token": "{{ website token }}" //required
"athenaUid": "550e8400-e29b-41d4-a716-446655440000" //required to use if you want to use Recent Searches Section
"autocomplete_tab" : "12" //required to use if you want to search with some search tab
}
Successful response
{
"data": {
"results": {
"product": {
"items": [
{
"id": 1780,
"name": "Maya Tunic",
"highlighted_name": "Maya Tunic",
"link": "https://example.com/maya-tunic.html",
"sku": "WT07",
"product_type_id": "configurable",
"image": "https://example.com/media/catalog/product/cache/eb76/w/t/main_1.jpg",
"price": {
"regular_price": 29,
"regular_price_with_currency": "$29.00",
"special_price": null,
"special_price_with_currency": null,
"loyalty_price": null,
"loyalty_price_with_currency": null,
"discount_percentage": 0
}
},
{
"id": 802,
"name": "Mithra Warmup Pant",
"highlighted_name": "Mithra Warm Pant",
"link": "https://example.com/mithra-warmup-pant.html",
"sku": "MP06",
"product_type_id": "configurable",
"image": "https://example.com/media/catalog/product/cache/eb76/w/t/main_1.jpg",
"price": {
"regular_price": 28,
"regular_price_with_currency": "$28.00",
"special_price": null,
"special_price_with_currency": null,
"loyalty_price": null,
"loyalty_price_with_currency": null,
"discount_percentage": 0
}
}
],
"title": "Product Matches"
},
"recent_searches": {
"items": [
{
"name": "M",
"highlighted_name": "M",
"link": "https://onboarding-magento.syncitgroup.com/athena/?q=m"
}
],
"title": "Recent Searches"
},
"category": {
"items": [
{
"id": "99999195",
"name": "Viktor Luma",
"highlighted_name": "Viktor Luma",
"link": "https://example.com/viktor-lumatech-trade-pant.html",
"image": "https://example.syncitgroup.com/media/catalog/product/main_2.jpg"
}
],
"title": "Popular Categories"
},
"section_b": {
"items": [],
"title": "Section B"
},
"popular": {
"items": [
{
"id": 31,
"name": "Mini",
"highlighted_name": "Mini",
"link": "https://onboarding-magento.syncitgroup.com/athena/?q=mini",
"name_urlencoded": "mini"
},
{
"id": 43,
"name": "Mollitia",
"highlighted_name": "Mollitia",
"link": "https://onboarding-magento.syncitgroup.com/athena/?q=mollitia",
"name_urlencoded": "mollitia"
}
],
"title": "Popular Searches"
},
"pdf_documents": {
"items": [],
"title": "Documents"
},
"blog_category": {
"items": [],
"title": "Blog Categories"
},
},
"true_autocomplete_keyword": "mach",
"tabs": {
"count": {
"11": 1,
"20": 1,
"3": 23,
"9": 1,
"37": 1
},
"preselected": 0
},
"banners": {
"top": [
{
"html": "{{ banner_content }}"
}
]
}
}
}