Guide
Smart Category Merchandising

V1 (deprecated)

1min

The v1 APIs are now deprecated! If you are building a new implementation, we strongly recommend going through V2 by visiting Overview

Using Klevu’s category navigation API, you can now retrieve products for your individual categories, where the order of products is decided by Klevu’s trend-driven intelligent algorithms. If you have setup merchandising rules in the Klevu Merchant Center, all your settings are respected and the order of products is decided accordingly. The continuous learning in Klevu’s backend ensures regular updates on individual category pages reflecting the changing trends of your website.

Use this API method if you want not only the record IDs but also other details associated with the matching records. The method allows you to retrieve facets and autosuggestions as well.
GET
Request
Query Parameters
ticket
required
String
This is your Klevu JS API Key.
term
required
String
This should always be set to " * " .
isCategoryNavigationRequest
required
Boolean
This should always be set to true.
category
required
Integer
Hierarchy of the category for which the query is being issued. e.g. Gifts;Gifts For;Gifts for Him Use ";" as a separator between a parent and its child category. It is important that the complete hierarchy of a category is supplied. This is to make sure the results from the correct heirarchy are retrieved.
sv
required
Number
The sv parameter is used for indicating which version of the Klevu Magento plugin you are using (e.g. 1.2.5). In case of a non-magento store, please use the constant “20.0.0”
paginationStartsFrom
optional
Integer
Index of the first record to be fetched.If for example showing 12 results per page, use the index 12 for the second page and 24 for the third page and so on.
noOfResults
optional
Integer
Indicates the number of records to be fetched. If for example, paginationStartsFrom is set to 0, it will obtain results from 0.
enableFilters
optional
Boolean
If set to true, filters relevant to the search results are retrieved and included in the response. The default value is false.
enableMultiSelectFilters
optional
Boolean
If set to true, we treat different values of a filter as checkboxes. Otherwise, if set to false, they are treated as radio buttons. e.g. color:green;;color:white;;brand:nike When set to true, it finds products with either green OR white color with the brand nike. When set to false, it finds products with both green AND white color AND brand nike. Default value is false.
applyFilters
optional
String
Tells Klevu which filters to apply on the search results. In case of multiple filters, please use the double semicolon (;;) as the delimiter. Values provided here should be the strings taken from the value attribute of the option element under the filters. e.g. color:green;;color:white;;brand:nike
maxNoOfValuesInAFilter
optional
Integer
Number of values to return for each filter. The default is 50.
sortOrder
optional
String
If you want to sort results in certain order, please use one of the following values: - rel for Relevance, - lth for Price: Low to High, - htl for Price: High to Low. The default value is rel.
showOutOfStockProducts
optional
Boolean
True to include out of stock products in the search result set, false otherwise. The default value is false.
fetchMinMaxPrice
optional
Boolean
If set to true, it returns the minimum and maximum prices found for the obtained search results. This can be used, for example, for displaying price slider. If set to false, Klevu will return price ranges (e.g. 0-500, 500-1000 etc.). The price range intervals are dynamically generated by Klevu. The default value is false.
priceFieldSuffix
optional
String
If you are a shopify plus customer with the multicurrency feature enabled, you can now provide a currency (other than the base currency of your store), to fetch prices in that currency. If in case the prices are not available in the supplied currency, Klevu will return prices in the base currency of the store. e.g. priceFieldSuffix=USD
visibility
optional
String
Always set this parameter to search to include products with the visibility of search to be included in the result set. The default value is search.
optionalFilters
optional
String
A parameter to enable personalisation. It instructs Klevu to boost products with the filter values specified here. In case of multiple filters, please use the double semicolon (;;) as a delimiter With each filter value, one can assign a boost score. For example, if in past a user was seen preferring green color products over any other color and brand to be nike, one can specify the optionalFilters as the following: e.g. color:green^10;;brand:nike^3.0 Here, use ;; as a delimiter between two filter values and a score between 1 and 100 to boost filter options. Values provided here should be the strings taken from the value attribute of the option element under the filters.
responseType
optional
String
Type of response to be returned. Possible values are xml or json. The default value is xml.
lsqt
optional
String
When you receive a response for a search query, look at the value of the typeOfQuery element under the metaData section. When you fire a subsequent query (e.g. to apply additional filters, or to obtain results for the next page), pass this value as the value of the lsqt (last search query type) parameter. Possible values are WILDCARD_AND, FUZZY_AND, OR, FUZZY_OR.
fl
optional
String
When Klevu returns search results, the response has certain fields for each record included. If you like to retrieve only a set of selected filters, use a list of comma separated field names.
Curl
Responses
200