Skip to main content

Search

The Search API can be used to display predictive search results for queries.

All Ajax API requests should use locale-aware URLs to give visitors a consistent experience.

Search products by keyword

GET /{locale}/api/search

The following example requests the predictive products for a specific keyword:

curl
GET /{locale}/api/search?keyword={query}&page={page}&limit={limit}

Example request

Example request using Fetch
fetch(window.SHOPLAZZA.routes.root + '/api/search?keyword=hu&page=0&limit=4')
.then((response) => response.json())
.then((data) => {
// do something...
});

Request parameters

    keywordstring

    The search query.

    pagenumber

    The base-0 page number of results.

    limitnumber

    Limits the number of results.

Response

    data object

    The response payload.

    cache_secondsnumber

    How long the result can be cached, in seconds.

    filtersundefined[]

    Filters available for the results.

    has_morenumber

    Whether more records are available.

    keywordstring

    Search keyword used for the query.

    limitnumber

    Maximum number of records returned per page.

    pagenumber

    Current page number.

    productsundefined[]

    List of products.

    scmstring
    sortundefined[]
    sortsundefined[]

    Sort options available for the results.

    sspstring
    totalnumber

    Total number of products matched.

    msgstring

    Result message returned with the response.

    statenumber

    Request result flag; success or 0 means the request succeeded.