Guide
Smart Category Merchandising
V1 (deprecated)
1 min
the v1 apis are now deprecated! if you are building a new implementation, we strongly recommend going through v2 by visiting overview docid 47rc6vwh1lnhqptjwuuw9 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 { "tab" "examples", "url" "https //\<cloudsearchurl>/cloud search/n search/search", "name" "record search", "method" "get", "request" { "pathparameters" \[], "queryparameters" \[ { "kind" "required", "name" "ticket", "type" "string", "description" "this is your klevu js api key " }, { "kind" "required", "name" "term", "type" "string", "description" "this should always be set to \\" \\" " }, { "kind" "required", "name" "iscategorynavigationrequest", "type" "boolean", "description" "this should always be set to true " }, { "kind" "required", "name" "category", "type" "integer", "description" "hierarchy of the category for which the query is being issued \n\ne g gifts;gifts for;gifts for him\nuse \\";\\" as a separator between a parent and its child category \n\nit is important that the complete hierarchy of a category is supplied this is to make sure the results from the correct heirarchy are retrieved " }, { "kind" "required", "name" "sv", "type" "number", "description" "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”" }, { "kind" "optional", "name" "paginationstartsfrom", "type" "integer", "description" "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 " }, { "kind" "optional", "name" "noofresults", "type" "integer", "description" "indicates the number of records to be fetched if for example, paginationstartsfrom is set to 0, it will obtain results from 0 " }, { "kind" "optional", "name" "enablefilters", "type" "boolean", "description" "if set to true, filters relevant to the search results are retrieved and included in the response the default value is false " }, { "kind" "optional", "name" "enablemultiselectfilters", "type" "boolean", "description" "if set to true, we treat different values of a filter as checkboxes otherwise, if set to false, they are treated as radio buttons \n\ne g color\ green;;color\ white;;brand\ nike\nwhen 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 " }, { "kind" "optional", "name" "applyfilters", "type" "string", "description" "tells klevu which filters to apply on the search results in case of multiple filters, please use the double semicolon (;;) as the delimiter \n\nvalues provided here should be the strings taken from the value attribute of the option element under the filters \n\ne g color\ green;;color\ white;;brand\ nike" }, { "kind" "optional", "name" "maxnoofvaluesinafilter", "type" "integer", "description" "number of values to return for each filter the default is 50 " }, { "kind" "optional", "name" "sortorder", "type" "string", "description" "if you want to sort results in certain order, please use one of the following values \n rel for relevance,\n lth for price low to high,\n htl for price high to low \nthe default value is rel " }, { "kind" "optional", "name" "showoutofstockproducts", "type" "boolean", "description" "true to include out of stock products in the search result set, false otherwise the default value is false " }, { "kind" "optional", "name" "fetchminmaxprice", "type" "boolean", "description" "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 " }, { "kind" "optional", "name" "pricefieldsuffix", "type" "string", "description" "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" }, { "kind" "optional", "name" "visibility", "type" "string", "description" "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 " }, { "kind" "optional", "name" "optionalfilters", "type" "string", "description" "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\n\nwith each filter value, one can assign a boost score \n\nfor 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 \n\ne g color\ green^10;;brand\ nike^3 0\n\nhere, use ;; as a delimiter between two filter values and a score between 1 and 100 to boost filter options \n\nvalues provided here should be the strings taken from the value attribute of the option element under the filters " }, { "kind" "optional", "name" "responsetype", "type" "string", "description" "type of response to be returned possible values are xml or json the default value is xml " }, { "kind" "optional", "name" "lsqt", "type" "string", "description" "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 " }, { "kind" "optional", "name" "fl", "type" "string", "description" "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 " } ], "headerparameters" \[], "bodydataparameters" \[], "formdataparameters" \[] }, "results" { "languages" \[ { "id" "ddxomvwnislr jx48ghqd", "code" "{\n \\"meta\\" {\n \\"layoutid\\" \\"\\",\n \\"layouttype\\" \\"\\",\n \\"noofresults\\" 2,\n \\"paginationstartfrom\\" 0,\n \\"powerdbylogo\\" \\"\\",\n \\"totalresultsfound\\" 9,\n \\"typeofquery\\" \\"wildcard and\\",\n \\"storebasecurrency\\" \\"gbp\\",\n \\"notificationcode\\" 1,\n \\"term\\" \\" \\",\n \\"excludeids\\" null,\n \\"ispersonalised\\" false,\n \\"idsusedforpersonalisation\\" null\n },\n \\"result\\" \[\n {\n \\"discount\\" \\"\\",\n \\"hidegroupprices\\" \\"\\",\n \\"type\\" \\"watches\\",\n \\"itemgroupid\\" \\"4384059195454\\",\n \\"freeshipping\\" \\"\\",\n \\"storebasecurrency\\" \\"gbp\\",\n \\"price\\" \\"49 00\\",\n \\"toprice\\" \\"\\",\n \\"imageurl\\" \\"https //cdn shopify com/s/files/1/0116/9457/1582/products/mg01 bk 0 34e7622a 503f 42f7 8e63 a57d758cf293 medium jpg?v=1575478386\\",\n \\"currency\\" \\"gbp\\",\n \\"instock\\" \\"yes\\",\n \\"id\\" \\"31366496419902\\",\n \\"imagehover\\" \\"https //cdn shopify com/s/files/1/0116/9457/1582/products/mg01 bk 0 1024x1024 f5db396b 312b 49e3 aa4d d6731e17d7b1 medium jpg?v=1575478386\\",\n \\"sku\\" \\"24 mg01\\",\n \\"brand\\" \\"kke\\",\n \\"startprice\\" \\"\\",\n \\"image\\" \\"https //cdn shopify com/s/files/1/0116/9457/1582/products/mg01 bk 0 34e7622a 503f 42f7 8e63 a57d758cf293 medium jpg?v=1575478386\\",\n \\"deliveryinfo\\" \\"\\",\n \\"hideaddtocart\\" \\"\\",\n \\"saleprice\\" \\"49 0\\",\n \\"oldprice\\" \\"49 0\\",\n \\"swatches\\" {\n \\"swatch\\" \[],\n \\"lowestprice\\" \\"\\",\n \\"numberofadditionalvariants\\" \\"\\"\n },\n \\"weight\\" \\"\\",\n \\"klevu category\\" \\"klevu product;products;;watches @ku\@kucategory\@ku@\\",\n \\"totalvariants\\" \\"0\\",\n \\"groupprices\\" \\"\\",\n \\"url\\" \\"https //jsv2 shopify demo ksearchmisc com/products/endurance watch\\",\n \\"tags\\" \\"digital, led, watch\\",\n \\"size\\" \\"free size\\",\n \\"name\\" \\"endurance watch\\",\n \\"shortdesc\\" \\"it's easy to track and monitor your training progress with the endurance watch you'll see standard info like time, date and day of the week, but it also functions for the serious high mileage athete lap counter, stopwatch, distance, heart rate,\\",\n \\"category\\" \\"watches\\",\n \\"typeofrecord\\" \\"klevu product\\"\n },\n {\n \\"discount\\" \\"\\",\n \\"hidegroupprices\\" \\"\\",\n \\"type\\" \\"watches\\",\n \\"itemgroupid\\" \\"4384058769470\\",\n \\"freeshipping\\" \\"\\",\n \\"storebasecurrency\\" \\"gbp\\",\n \\"price\\" \\"92 00\\",\n \\"toprice\\" \\"\\",\n \\"imageurl\\" \\"https //cdn shopify com/s/files/1/0116/9457/1582/products/mg02 bk 0 e6375bd6 e9b3 41ad ae00 b6ee4457023b medium jpg?v=1575478380\\",\n \\"currency\\" \\"gbp\\",\n \\"instock\\" \\"yes\\",\n \\"id\\" \\"31366495961150\\",\n \\"imagehover\\" \\"https //cdn shopify com/s/files/1/0116/9457/1582/products/mg02 bk 0 1024x1024 42c6e9b6 bf83 4bcc 825b f532eeda29a3 medium jpg?v=1575478380\\",\n \\"sku\\" \\"24 mg02\\",\n \\"brand\\" \\"kke\\",\n \\"startprice\\" \\"\\",\n \\"image\\" \\"https //cdn shopify com/s/files/1/0116/9457/1582/products/mg02 bk 0 e6375bd6 e9b3 41ad ae00 b6ee4457023b medium jpg?v=1575478380\\",\n \\"deliveryinfo\\" \\"\\",\n \\"hideaddtocart\\" \\"\\",\n \\"saleprice\\" \\"92 0\\",\n \\"oldprice\\" \\"92 0\\",\n \\"swatches\\" {\n \\"swatch\\" \[],\n \\"lowestprice\\" \\"\\",\n \\"numberofadditionalvariants\\" \\"\\"\n },\n \\"weight\\" \\"\\",\n \\"klevu category\\" \\"klevu product;products;;watches @ku\@kucategory\@ku@\\",\n \\"totalvariants\\" \\"0\\",\n \\"groupprices\\" \\"\\",\n \\"url\\" \\"https //jsv2 shopify demo ksearchmisc com/products/dash digital watch\\",\n \\"tags\\" \\"dash, digital, watch\\",\n \\"size\\" \\"free size\\",\n \\"name\\" \\"dash digital watch\\",\n \\"shortdesc\\" \\"the dash digital watch will challenge you to push harder and longer log workouts by date, average, and segment times, and recharge by setting hydration and nutrition alarms this watch is styled with a sleek, square face and durable rubber strap\\",\n \\"category\\" \\"watches\\",\n \\"typeofrecord\\" \\"klevu product\\"\n }\n ],\n \\"filters\\" \[],\n \\"price\\" {\n \\"min\\" \\"\\",\n \\"max\\" \\"\\",\n \\"start\\" \\"\\",\n \\"end\\" \\"\\"\n },\n \\"autocomplete\\" \[],\n \\"popularterm\\" \[],\n \\"pages\\" \[],\n \\"categories\\" \[],\n \\"popularproducts\\" \[],\n \\"recentlyviewedproducts\\" \[],\n \\"ranges\\" \[],\n \\"error\\" {\n \\"errormessage\\" \\"\\"\n }\n}", "language" "200", "customlabel" "" } ], "selectedlanguageid" "ddxomvwnislr jx48ghqd" }, "examples" { "languages" \[ { "id" "4udtvpbdc3i czd c qop", "code" "\<?php\n\n$curl = curl init();\n\ncurl setopt array($curl, array(\n curlopt url => 'https //eucs15 ksearchnet com/cloud search/n search/search?ticket=klevu 156925593843210765\&term= \&iscategorynavigationrequest=true\&category=klevu product%20watches\&sv=20 0 0\&paginationstartsfrom=0\&noofresults=2\&enablepartialsearch=false\&enablefilters=false\&enablemultiselectfilters=false\&showoutofstockproducts=true\&responsetype=json',\n curlopt returntransfer => true,\n curlopt encoding => '',\n curlopt maxredirs => 10,\n curlopt timeout => 0,\n curlopt followlocation => true,\n curlopt http version => curl http version 1 1,\n curlopt customrequest => 'post',\n));\n\n$response = curl exec($curl);\n\ncurl close($curl);\necho $response;\n", "language" "curl", "customlabel" "" } ], "selectedlanguageid" "4udtvpbdc3i czd c qop" }, "description" "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 \n", "currentnewparameter" { "label" "query parameter", "value" "queryparameters" } }