Guide
Smart Category Merchandising
Category Product Search
2min
If you haven't gone through the prerequisites and the v2 structure, please have a look at Overview
This is an example how to fetch product from specific category.
POST
Request
Body Parameters
typeOfRequest
required
String
This parameter defines the type of request it is, which should be 'CATNAV' for category merchandising queries. There are other values available, detailed elsewhere in the documentation.
categoryPath
required
String
Specify the name of the category to retrieve results from, in the same case and format as it is indexed with Klevu.
For nested categories, use the ; character to separate the hierarchy. For example, for 'Mens > Shoes > Trainers and Sneakers' you would specify: Mens;Shoes;Trainers and Sneakers.
Request Body (JSON)
PHP
JS
Java
Node.js
1var data = JSON.stringify({"recordQueries":[{"id":"categoryProducts","typeOfRequest":"CATNAV","settings":{"query":{"categoryPath":"Jackets"}}}],"context":{"apiKeys":["klevu-156925593843210765"]}});
2
3var xhr = new XMLHttpRequest();
4xhr.withCredentials = false;
5
6xhr.addEventListener("readystatechange", function() {
7 if(this.readyState === 4) {
8 console.log(this.responseText);
9 }
10});
11
12xhr.open("POST", "https://eucs15v2.ksearchnet.com/cs/v2/search");
13xhr.setRequestHeader("Content-Type", "application/json");
14
15xhr.send(data);
Responses
200
1{
2 "meta": {
3 "qTime": 7,
4 "responseCode": 200
5 },
6 "queryResults": [
7 {
8 "id": "categoryProducts",
9 "meta": {
10 "qTime": 5,
11 "noOfResults": 12,
12 "totalResultsFound": 73,
13 "typeOfSearch": "WILDCARD_AND",
14 "offset": 0,
15 "debuggingInformation": {},
16 "notificationCode": 1,
17 "searchedTerm": "*",
18 "apiKey": "klevu-156925593843210765",
19 "isPersonalised": false
20 },
21 "records": [
22 {
23 "discount": "",
24 "hideGroupPrices": "",
25 "type": "Hoodies & Sweatshirts",
26 "itemGroupId": "4384033833022",
27 "freeShipping": "",
28 "storeBaseCurrency": "GBP",
29 "price": "75.00",
30 "toPrice": "",
31 "imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj01-red_main_c9193846-bc80-4537-b810-4f6ad82dd6fe_medium.jpg?v=1575478019",
32 "currency": "GBP",
33 "inStock": "yes",
34 "id": "31366456541246",
35 "imageHover": "",
36 "sku": "WJ01-S-Red",
37 "brand": "KSD",
38 "startPrice": "",
39 "image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj01-red_main_c9193846-bc80-4537-b810-4f6ad82dd6fe_medium.jpg?v=1575478019",
40 "deliveryInfo": "",
41 "hideAddToCart": "",
42 "salePrice": "75.0",
43 "swatchesInfo": "",
44 "weight": "",
45 "klevu_category": "KLEVU_PRODUCT;Products;;Jackets;;Hoodies & Sweatshirts @ku@kuCategory@ku@",
46 "totalVariants": 0,
47 "groupPrices": "",
48 "url": "https://jsv2-shopify-demo.ksearchmisc.com/products/stellar-solar-jacket-s-red",
49 "tags": "Cold-whether, comfortable, crewneck, Grayson, Hoodie, machine, Sweatshirt, winter, Wool",
50 "size": "Small",
51 "name": "Stellar Solar Jacket",
52 "shortDesc": "Beat the heat and protect yourself from sunrays with the Stellar Solar Jacket. It's loaded with all the engineered features you need for an intense, safe outdoor workout: 100% UV protection, a breathable perforated construction, and advanced moist",
53 "category": "Jackets;;Hoodies & Sweatshirts"
54 },
55 {
56 "discount": "",
57 "hideGroupPrices": "",
58 "type": "Jackets",
59 "itemGroupId": "4384052215870",
60 "freeShipping": "",
61 "storeBaseCurrency": "GBP",
62 "price": "99.00",
63 "toPrice": "",
64 "imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mj08-blue_main_bb248254-73cc-4521-8105-fe2277267348_medium.jpg?v=1575478286",
65 "currency": "GBP",
66 "inStock": "yes",
67 "id": "31366487441470",
68 "imageHover": "",
69 "sku": "MJ08-XS-Blue",
70 "brand": "KSD",
71 "startPrice": "",
72 "image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mj08-blue_main_bb248254-73cc-4521-8105-fe2277267348_medium.jpg?v=1575478286",
73 "deliveryInfo": "",
74 "hideAddToCart": "",
75 "salePrice": "99.0",
76 "swatchesInfo": "",
77 "weight": "",
78 "klevu_category": "KLEVU_PRODUCT;Products;;Jackets @ku@kuCategory@ku@",
79 "totalVariants": 0,
80 "groupPrices": "",
81 "url": "https://jsv2-shopify-demo.ksearchmisc.com/products/lando-gym-jacket-blue",
82 "tags": "blue, machine, royal, zipped",
83 "size": "Small",
84 "name": "Lando Gym Jacket",
85 "shortDesc": "The Lando Gym Jacket offers strategic ventilation at perspiration-prone areas, while moisture-wicking technology helps you stay dry. Side-seam pockets house your favorite media device, so you're plugged in when working out. • Gray polyester",
86 "category": "Jackets"
87 },
88 {
89 "discount": "",
90 "hideGroupPrices": "",
91 "type": "Jackets",
92 "itemGroupId": "4384033341502",
93 "freeShipping": "",
94 "storeBaseCurrency": "GBP",
95 "price": "84.00",
96 "toPrice": "",
97 "imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj04-orange_main_098af8fb-1cf2-473f-907a-10922e39beae_medium.jpg?v=1575478007",
98 "currency": "GBP",
99 "inStock": "yes",
100 "id": "31366455590974",
101 "imageHover": "",
102 "sku": "WJ04-XS-Orange",
103 "brand": "MNH",
104 "startPrice": "",
105 "image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj04-orange_main_098af8fb-1cf2-473f-907a-10922e39beae_medium.jpg?v=1575478007",
106 "deliveryInfo": "",
107 "hideAddToCart": "",
108 "salePrice": "84.0",
109 "swatchesInfo": "",
110 "weight": "",
111 "klevu_category": "KLEVU_PRODUCT;Products;;Jackets @ku@kuCategory@ku@",
112 "totalVariants": 0,
113 "groupPrices": "",
114 "url": "https://jsv2-shopify-demo.ksearchmisc.com/products/ingrid-running-jacket-orange",
115 "tags": "comfort, machine, royal, running, zipped",
116 "size": "Small",
117 "name": "Ingrid Running Jacket",
118 "shortDesc": "The Ingrid Running Jacket combines sleek design and high performance with slim, contoured fit and moisture-wicking fabric. It features a full-zip construction and a collared neck to keep the elements out and body heat in. • Slim fit. • Moi",
119 "category": "Jackets"
120 },
121 {
122 "discount": "",
123 "hideGroupPrices": "",
124 "type": "Jackets",
125 "itemGroupId": "4384031244350",
126 "freeShipping": "",
127 "storeBaseCurrency": "GBP",
128 "price": "77.00",
129 "toPrice": "",
130 "imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj06-green_main_30b7fa7f-a3ce-4513-9307-822bf013a89d_medium.jpg?v=1575477963",
131 "currency": "GBP",
132 "inStock": "yes",
133 "id": "31366453067838",
134 "imageHover": "",
135 "sku": "WJ06-XS-Green",
136 "brand": "KSD",
137 "startPrice": "",
138 "image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj06-green_main_30b7fa7f-a3ce-4513-9307-822bf013a89d_medium.jpg?v=1575477963",
139 "deliveryInfo": "",
140 "hideAddToCart": "",
141 "salePrice": "77.0",
142 "swatchesInfo": "",
143 "weight": "",
144 "klevu_category": "KLEVU_PRODUCT;Products;;Jackets @ku@kuCategory@ku@",
145 "totalVariants": 0,
146 "groupPrices": "",
147 "url": "https://jsv2-shopify-demo.ksearchmisc.com/products/juno-jacket-green",
148 "tags": "adjustable, comfort, machine, royal, running, zipped",
149 "size": "Large",
150 "name": "Juno Jacket",
151 "shortDesc": "On colder-than-comfortable mornings, you'll love warming up in the Juno All-Ways Performanc Jacket, designed to compete with wind and chill. Built-in Cocona® technology aids evaporation, while a special zip placket and stand-up collar keep your ne",
152 "category": "Jackets"
153 },
154 {
155 "discount": "",
156 "hideGroupPrices": "",
157 "type": "Jackets",
158 "itemGroupId": "4384052084798",
159 "freeShipping": "",
160 "storeBaseCurrency": "GBP",
161 "price": "99.00",
162 "toPrice": "",
163 "imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mj08-green_main_7f692ff8-45b0-4d08-8371-a2044df82752_medium.jpg?v=1575478284",
164 "currency": "GBP",
165 "inStock": "yes",
166 "id": "31366487310398",
167 "imageHover": "",
168 "sku": "MJ08-XS-Green",
169 "brand": "MNH",
170 "startPrice": "",
171 "image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mj08-green_main_7f692ff8-45b0-4d08-8371-a2044df82752_medium.jpg?v=1575478284",
172 "deliveryInfo": "",
173 "hideAddToCart": "",
174 "salePrice": "99.0",
175 "swatchesInfo": "",
176 "weight": "",
177 "klevu_category": "KLEVU_PRODUCT;Products;;Jackets @ku@kuCategory@ku@",
178 "totalVariants": 0,
179 "groupPrices": "",
180 "url": "https://jsv2-shopify-demo.ksearchmisc.com/products/lando-gym-jacket-green",
181 "tags": "green, machine, royal, zipped",
182 "size": "Medium",
183 "name": "Lando Gym Jacket",
184 "shortDesc": "The Lando Gym Jacket offers strategic ventilation at perspiration-prone areas, while moisture-wicking technology helps you stay dry. Side-seam pockets house your favorite media device, so you're plugged in when working out. • Gray polyester",
185 "category": "Jackets"
186 },
187 {
188 "discount": "",
189 "hideGroupPrices": "",
190 "type": "Jackets",
191 "itemGroupId": "4384051527742",
192 "freeShipping": "",
193 "storeBaseCurrency": "GBP",
194 "price": "66.00",
195 "toPrice": "",
196 "imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mj10-red_main_9e1898b9-9d4a-41df-8dc6-7d31cd23c34e_medium.jpg?v=1575478275",
197 "currency": "GBP",
198 "inStock": "yes",
199 "id": "31366485966910",
200 "imageHover": "",
201 "sku": "MJ10-XS-Red",
202 "brand": "MNH",
203 "startPrice": "",
204 "image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mj10-red_main_9e1898b9-9d4a-41df-8dc6-7d31cd23c34e_medium.jpg?v=1575478275",
205 "deliveryInfo": "",
206 "hideAddToCart": "",
207 "salePrice": "66.0",
208 "swatchesInfo": "",
209 "weight": "",
210 "klevu_category": "KLEVU_PRODUCT;Products;;Tops;;Jackets @ku@kuCategory@ku@",
211 "totalVariants": 0,
212 "groupPrices": "",
213 "url": "https://jsv2-shopify-demo.ksearchmisc.com/products/mars-heattech-trade-pullover-red",
214 "tags": "machine, red, royal, zipped",
215 "size": "Medium",
216 "name": "Mars HeatTech™ Pullover",
217 "shortDesc": "The Mars HeatTech™ Jacket defense against winter climes so you can play offense in the park, on the trail or in the deck chair. Great for the ski lodge or stadium, it features a wind- and water-resistant outer shell with a draw-cord hood and deep",
218 "category": "Tops;;Jackets"
219 },
220 {
221 "discount": "",
222 "hideGroupPrices": "",
223 "type": "Jackets",
224 "itemGroupId": "4384033603646",
225 "freeShipping": "",
226 "storeBaseCurrency": "GBP",
227 "price": "56.25",
228 "toPrice": "",
229 "imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj02-blue_main_8549c057-4567-4b63-ac2e-2068d345ff28_medium.jpg?v=1575478014",
230 "currency": "GBP",
231 "inStock": "yes",
232 "id": "31366456279102",
233 "imageHover": "",
234 "sku": "WJ02-XS-Blue",
235 "brand": "KSD",
236 "startPrice": "",
237 "image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj02-blue_main_8549c057-4567-4b63-ac2e-2068d345ff28_medium.jpg?v=1575478014",
238 "deliveryInfo": "",
239 "hideAddToCart": "",
240 "salePrice": "56.25",
241 "swatchesInfo": "",
242 "weight": "",
243 "klevu_category": "KLEVU_PRODUCT;Products;;Jackets @ku@kuCategory@ku@",
244 "totalVariants": 0,
245 "groupPrices": "",
246 "url": "https://jsv2-shopify-demo.ksearchmisc.com/products/josie-yoga-jacket-blue",
247 "tags": "comfort, machine, royal, running, zipped",
248 "size": "Small",
249 "name": "Josie Yoga Jacket",
250 "shortDesc": "When your near future includes yoga, the cozy comfort of the Josie Yoga Jacket gets your mind and body ready. Stretchy CoolTech™ fabric with zipper pockets makes this jacket the right gear for studio time or teatime after. • Slate rouched n",
251 "category": "Jackets"
252 },
253 {
254 "discount": "",
255 "hideGroupPrices": "",
256 "type": "Jackets",
257 "itemGroupId": "4384052150334",
258 "freeShipping": "",
259 "storeBaseCurrency": "GBP",
260 "price": "99.00",
261 "toPrice": "",
262 "imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mj08-gray_main_3787cf65-8e0a-4540-8f11-6d188980a6eb_medium.jpg?v=1575478285",
263 "currency": "GBP",
264 "inStock": "yes",
265 "id": "31366487375934",
266 "imageHover": "",
267 "sku": "MJ08-XS-Gray",
268 "brand": "KKE",
269 "startPrice": "",
270 "image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mj08-gray_main_3787cf65-8e0a-4540-8f11-6d188980a6eb_medium.jpg?v=1575478285",
271 "deliveryInfo": "",
272 "hideAddToCart": "",
273 "salePrice": "99.0",
274 "swatchesInfo": "",
275 "weight": "",
276 "klevu_category": "KLEVU_PRODUCT;Products;;Jackets @ku@kuCategory@ku@",
277 "totalVariants": 0,
278 "groupPrices": "",
279 "url": "https://jsv2-shopify-demo.ksearchmisc.com/products/lando-gym-jacket-gray",
280 "tags": "gray, machine, royal, zipped",
281 "size": "Large",
282 "name": "Lando Gym Jacket",
283 "shortDesc": "The Lando Gym Jacket offers strategic ventilation at perspiration-prone areas, while moisture-wicking technology helps you stay dry. Side-seam pockets house your favorite media device, so you're plugged in when working out. • Gray polyester",
284 "category": "Jackets"
285 },
286 {
287 "discount": "",
288 "hideGroupPrices": "",
289 "type": "Jackets",
290 "itemGroupId": "4384033243198",
291 "freeShipping": "",
292 "storeBaseCurrency": "GBP",
293 "price": "84.00",
294 "toPrice": "",
295 "imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj04-white_main_d8fa2b03-08ff-485c-afd1-b3761e70e9ce_medium.jpg?v=1575478004",
296 "currency": "GBP",
297 "inStock": "yes",
298 "id": "31366455427134",
299 "imageHover": "",
300 "sku": "WJ04-XS-White",
301 "brand": "KKE",
302 "startPrice": "",
303 "image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj04-white_main_d8fa2b03-08ff-485c-afd1-b3761e70e9ce_medium.jpg?v=1575478004",
304 "deliveryInfo": "",
305 "hideAddToCart": "",
306 "salePrice": "84.0",
307 "swatchesInfo": "",
308 "weight": "",
309 "klevu_category": "KLEVU_PRODUCT;Products;;Jackets @ku@kuCategory@ku@",
310 "totalVariants": 0,
311 "groupPrices": "",
312 "url": "https://jsv2-shopify-demo.ksearchmisc.com/products/ingrid-running-jacket-white",
313 "tags": "comfort, machine, royal, running, zipped",
314 "size": "Medium",
315 "name": "Ingrid Running Jacket",
316 "shortDesc": "The Ingrid Running Jacket combines sleek design and high performance with slim, contoured fit and moisture-wicking fabric. It features a full-zip construction and a collared neck to keep the elements out and body heat in. • Slim fit. • Moi",
317 "category": "Jackets"
318 },
319 {
320 "discount": "",
321 "hideGroupPrices": "",
322 "type": "Jackets",
323 "itemGroupId": "4384033308734",
324 "freeShipping": "",
325 "storeBaseCurrency": "GBP",
326 "price": "84.00",
327 "toPrice": "",
328 "imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj04-red_main_5c76d8d8-ad1a-414f-b6b7-9edccc50b955_medium.jpg?v=1575478005",
329 "currency": "GBP",
330 "inStock": "yes",
331 "id": "31366455525438",
332 "imageHover": "",
333 "sku": "WJ04-XS-Red",
334 "brand": "KSD",
335 "startPrice": "",
336 "image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj04-red_main_5c76d8d8-ad1a-414f-b6b7-9edccc50b955_medium.jpg?v=1575478005",
337 "deliveryInfo": "",
338 "hideAddToCart": "",
339 "salePrice": "84.0",
340 "swatchesInfo": "",
341 "weight": "",
342 "klevu_category": "KLEVU_PRODUCT;Products;;Jackets @ku@kuCategory@ku@",
343 "totalVariants": 0,
344 "groupPrices": "",
345 "url": "https://jsv2-shopify-demo.ksearchmisc.com/products/ingrid-running-jacket-red",
346 "tags": "comfort, machine, royal, running, zipped",
347 "size": "Large",
348 "name": "Ingrid Running Jacket",
349 "shortDesc": "The Ingrid Running Jacket combines sleek design and high performance with slim, contoured fit and moisture-wicking fabric. It features a full-zip construction and a collared neck to keep the elements out and body heat in. • Slim fit. • Moi",
350 "category": "Jackets"
351 },
352 {
353 "discount": "",
354 "hideGroupPrices": "",
355 "type": "Hoodies & Sweatshirts",
356 "itemGroupId": "4384033964094",
357 "freeShipping": "",
358 "storeBaseCurrency": "GBP",
359 "price": "75.00",
360 "toPrice": "",
361 "imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj01-blue_main_d6ed0a23-7d18-42d4-921c-5669f65a7580_medium.jpg?v=1575478022",
362 "currency": "GBP",
363 "inStock": "yes",
364 "id": "31366456672318",
365 "imageHover": "",
366 "sku": "WJ01-S-Blue",
367 "brand": "MNH",
368 "startPrice": "",
369 "image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj01-blue_main_d6ed0a23-7d18-42d4-921c-5669f65a7580_medium.jpg?v=1575478022",
370 "deliveryInfo": "",
371 "hideAddToCart": "",
372 "salePrice": "75.0",
373 "swatchesInfo": "",
374 "weight": "",
375 "klevu_category": "KLEVU_PRODUCT;Products;;Jackets;;Hoodies & Sweatshirts @ku@kuCategory@ku@",
376 "totalVariants": 0,
377 "groupPrices": "",
378 "url": "https://jsv2-shopify-demo.ksearchmisc.com/products/stellar-solar-jacket-s-blue",
379 "tags": "Cold-whether, comfortable, crewneck, Grayson, Hoodie, machine, Sweatshirt, winter, Wool",
380 "size": "Small",
381 "name": "Stellar Solar Jacket",
382 "shortDesc": "Beat the heat and protect yourself from sunrays with the Stellar Solar Jacket. It's loaded with all the engineered features you need for an intense, safe outdoor workout: 100% UV protection, a breathable perforated construction, and advanced moist",
383 "category": "Jackets;;Hoodies & Sweatshirts"
384 },
385 {
386 "discount": "",
387 "hideGroupPrices": "",
388 "type": "Jackets",
389 "itemGroupId": "4384052412478",
390 "freeShipping": "",
391 "storeBaseCurrency": "GBP",
392 "price": "72.00",
393 "toPrice": "",
394 "imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mj07-red_main_7fb57683-fddb-44a9-90aa-fc03536bbd90_medium.jpg?v=1575478289",
395 "currency": "GBP",
396 "inStock": "yes",
397 "id": "31366487769150",
398 "imageHover": "",
399 "sku": "MJ07-XS-Red",
400 "brand": "KKE",
401 "startPrice": "",
402 "image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mj07-red_main_7fb57683-fddb-44a9-90aa-fc03536bbd90_medium.jpg?v=1575478289",
403 "deliveryInfo": "",
404 "hideAddToCart": "",
405 "salePrice": "72.0",
406 "swatchesInfo": "",
407 "weight": "",
408 "klevu_category": "KLEVU_PRODUCT;Products;;Jackets @ku@kuCategory@ku@",
409 "totalVariants": 0,
410 "groupPrices": "",
411 "url": "https://jsv2-shopify-demo.ksearchmisc.com/products/orion-two-tone-fitted-jacket-red",
412 "tags": "machine, red, royal, zipped",
413 "size": "Large",
414 "name": "Orion Two-Tone Fitted Jacket",
415 "shortDesc": "While you're getting fit, you need a fitted jacket to match. Striking color blocking patterns on hood, shoulders and arms are hallmarks of the Orion Two-Tone Fitted Jacket. They provide eye-catching contrast against the rich, torso tones of this 1",
416 "category": "Jackets"
417 }
418 ],
419 "filters": []
420 }
421 ]
422}
1<iframe src="https://codesandbox.io/embed/klevu-api-sendbox-4ktfrp?fontsize=14&hidenavigation=0&theme=dark&view=preview&initialpath=?payload=categorySearch"
2 style="width:100%; height:550px; border:0; border-radius: 4px; overflow:hidden;"
3 title="klevu_api sendbox"
4 allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
5 sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
6
7 ></iframe>