Autocomplete First Click API

Show popular terms and products as soon as the user first clicks into the search field.

Last updated

On this page

Overview

Use the Autocomplete First Click API to improve Quick Search. It activates on the user’s first click and showcases popular terms and products.

You can customize it through the Athena Dashboard. The API returns sections based on the display conditions configured there.

Endpoint

MethodPath
POST/api/v1/autocomplete/first-click
POST/api/v2/autocomplete/first-click

Request body

JSON
{
   "q": "Yoga", //required
   "token": "{{ website token }}" //required
}

Successful response

JSON
{
    "data": {
        "results": {
            "product": {
                "items": [
                    {
                        "id": 694,
                        "name": "Argus All-Weather Tank",
                        "highlighted_name": null,
                        "link": "https://example.com/argus-all-weather-tank.html",
                        "sku": "MT07",
                        "product_type_id": "configurable",
                        "image": "https://example.com/media/catalog/product/main_1.jpg",
                        "price": {
                            "regular_price": 22,
                            "regular_price_with_currency": "$22.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": "Dd",
                        "highlighted_name": null, "section_a": {
                "items": [
                    {
                        "id": "99999138",
                        "name": "Women",
                        "highlighted_name": null,
                        "link": "https://onboarding-magento.syncitgroup.com/women.html",
                        "image": "https://example.com/media/wysiwyg/main.jpg"
                    }
                ],
                "title": "Section A"
            },

                        "link": "https://onboarding-magento.syncitgroup.com/athena/?q=dd"
                    }
                ],
                "title": "Recent Searches"
            },
            "section_a": {
                "items": [
                    {
                        "id": "99999138",
                        "name": "Women",
                        "highlighted_name": null,
                        "link": "https://onboarding-magento.syncitgroup.com/women.html",
                        "image": "https://example.com/media/wysiwyg/main.jpg"
                    }
                ],
                "title": "Section A"
            },
            "popular": {
                "items": [
                    {
                        "id": 1,
                        "name": "Et",
                        "highlighted_name": null,
                        "link": "https://example.com/athena/?q=et",
                        "name_urlencoded": "et"
                    }
                ],
                "title": "Popular Searches"
            },
            "pdf_documents": {
                "items": [],
                "title": "Documents"
            }
        },
        "banners": {
            "top": [
                {
                    "html": "{{ banner_content }}"
                }
            ]
        }
    }
}