Category Product Search
2 min
If you haven't gone through the prerequisites and the v2 structure, please have a look at Overview
Category search
This is an example how to fetch product from specific category.
POST
https://{{hostname}}/cs/v2/search
Body Parameters
- typeOfRequestStringrequiredDescription
- categoryPathStringrequiredDescription
- merchandisingVersionintegerDescription
Request Body (JSON)
{
"recordQueries": [
{
"id": "categoryProducts",
"typeOfRequest": "CATNAV",
"settings": {
"merchandisingVersion": 1739999922000,
"query": {
"categoryPath": "Jackets"
}
}
}
],
"context": {
"apiKeys": [
"klevu-156925593843210765"
]
}
}php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://eucs15v2.ksearchnet.com/cs/v2/search',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"recordQueries": [
{
"id": "categoryProducts",
"typeOfRequest": "CATNAV",
"settings": {
"merchandisingVersion": 1739999922000,
"query": {
"categoryPath": "Jackets"
}
}
}
],
"context": {
"apiKeys": [
"klevu-156925593843210765"
]
}
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;javascript
// WARNING: For POST requests, body is set to null by browsers.
var data = JSON.stringify({
"recordQueries": [
{
"id": "categoryProducts",
"typeOfRequest": "CATNAV",
"settings": {
"merchandisingVersion": 1739999922000,
"query": {
"categoryPath": "Jackets"
}
}
}
],
"context": {
"apiKeys": [
"klevu-156925593843210765"
]
}
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://eucs15v2.ksearchnet.com/cs/v2/search");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\r\n \"recordQueries\": [\r\n {\r\n \"id\": \"categoryProducts\",\r\n \"typeOfRequest\": \"CATNAV\",\r\n \"settings\": {\r\n \"merchandisingVersion\": 1739999922000,\r\n \"query\": {\r\n \"categoryPath\": \"Jackets\"\r\n }\r\n }\r\n }\r\n ],\r\n \"context\": {\r\n \"apiKeys\": [\r\n \"klevu-156925593843210765\"\r\n ]\r\n }\r\n}");
Request request = new Request.Builder()
.url("https://eucs15v2.ksearchnet.com/cs/v2/search")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();nodejs
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://eucs15v2.ksearchnet.com/cs/v2/search',
'headers': {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"recordQueries": [
{
"id": "categoryProducts",
"typeOfRequest": "CATNAV",
"settings": {
"merchandisingVersion": 1739999922000,
"query": {
"categoryPath": "Jackets"
}
}
}
],
"context": {
"apiKeys": [
"klevu-156925593843210765"
]
}
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});200
{
"meta": {
"qTime": 7,
"responseCode": 200
},
"queryResults": [
{
"id": "categoryProducts",
"meta": {
"qTime": 5,
"noOfResults": 12,
"totalResultsFound": 73,
"typeOfSearch": "WILDCARD_AND",
"offset": 0,
"debuggingInformation": {},
"notificationCode": 1,
"searchedTerm": "*",
"apiKey": "klevu-156925593843210765",
"isPersonalised": false
},
"records": [
{
"discount": "",
"hideGroupPrices": "",
"type": "Hoodies & Sweatshirts",
"itemGroupId": "4384033833022",
"freeShipping": "",
"storeBaseCurrency": "GBP",
"price": "75.00",
"toPrice": "",
"imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj01-red_main_c9193846-bc80-4537-b810-4f6ad82dd6fe_medium.jpg?v=1575478019",
"currency": "GBP",
"inStock": "yes",
"id": "31366456541246",
"imageHover": "",
"sku": "WJ01-S-Red",
"brand": "KSD",
"startPrice": "",
"image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj01-red_main_c9193846-bc80-4537-b810-4f6ad82dd6fe_medium.jpg?v=1575478019",
"deliveryInfo": "",
"hideAddToCart": "",
"salePrice": "75.0",
"swatchesInfo": "",
"weight": "",
"klevu_category": "KLEVU_PRODUCT;Products;;Jackets;;Hoodies & Sweatshirts @ku@kuCategory@ku@",
"totalVariants": 0,
"groupPrices": "",
"url": "https://jsv2-shopify-demo.ksearchmisc.com/products/stellar-solar-jacket-s-red",
"tags": "Cold-whether, comfortable, crewneck, Grayson, Hoodie, machine, Sweatshirt, winter, Wool",
"size": "Small",
"name": "Stellar Solar Jacket",
"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",
"category": "Jackets;;Hoodies & Sweatshirts"
},
{
"discount": "",
"hideGroupPrices": "",
"type": "Jackets",
"itemGroupId": "4384052215870",
"freeShipping": "",
"storeBaseCurrency": "GBP",
"price": "99.00",
"toPrice": "",
"imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mj08-blue_main_bb248254-73cc-4521-8105-fe2277267348_medium.jpg?v=1575478286",
"currency": "GBP",
"inStock": "yes",
"id": "31366487441470",
"imageHover": "",
"sku": "MJ08-XS-Blue",
"brand": "KSD",
"startPrice": "",
"image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mj08-blue_main_bb248254-73cc-4521-8105-fe2277267348_medium.jpg?v=1575478286",
"deliveryInfo": "",
"hideAddToCart": "",
"salePrice": "99.0",
"swatchesInfo": "",
"weight": "",
"klevu_category": "KLEVU_PRODUCT;Products;;Jackets @ku@kuCategory@ku@",
"totalVariants": 0,
"groupPrices": "",
"url": "https://jsv2-shopify-demo.ksearchmisc.com/products/lando-gym-jacket-blue",
"tags": "blue, machine, royal, zipped",
"size": "Small",
"name": "Lando Gym Jacket",
"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",
"category": "Jackets"
},
{
"discount": "",
"hideGroupPrices": "",
"type": "Jackets",
"itemGroupId": "4384033341502",
"freeShipping": "",
"storeBaseCurrency": "GBP",
"price": "84.00",
"toPrice": "",
"imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj04-orange_main_098af8fb-1cf2-473f-907a-10922e39beae_medium.jpg?v=1575478007",
"currency": "GBP",
"inStock": "yes",
"id": "31366455590974",
"imageHover": "",
"sku": "WJ04-XS-Orange",
"brand": "MNH",
"startPrice": "",
"image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj04-orange_main_098af8fb-1cf2-473f-907a-10922e39beae_medium.jpg?v=1575478007",
"deliveryInfo": "",
"hideAddToCart": "",
"salePrice": "84.0",
"swatchesInfo": "",
"weight": "",
"klevu_category": "KLEVU_PRODUCT;Products;;Jackets @ku@kuCategory@ku@",
"totalVariants": 0,
"groupPrices": "",
"url": "https://jsv2-shopify-demo.ksearchmisc.com/products/ingrid-running-jacket-orange",
"tags": "comfort, machine, royal, running, zipped",
"size": "Small",
"name": "Ingrid Running Jacket",
"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",
"category": "Jackets"
},
{
"discount": "",
"hideGroupPrices": "",
"type": "Jackets",
"itemGroupId": "4384031244350",
"freeShipping": "",
"storeBaseCurrency": "GBP",
"price": "77.00",
"toPrice": "",
"imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj06-green_main_30b7fa7f-a3ce-4513-9307-822bf013a89d_medium.jpg?v=1575477963",
"currency": "GBP",
"inStock": "yes",
"id": "31366453067838",
"imageHover": "",
"sku": "WJ06-XS-Green",
"brand": "KSD",
"startPrice": "",
"image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj06-green_main_30b7fa7f-a3ce-4513-9307-822bf013a89d_medium.jpg?v=1575477963",
"deliveryInfo": "",
"hideAddToCart": "",
"salePrice": "77.0",
"swatchesInfo": "",
"weight": "",
"klevu_category": "KLEVU_PRODUCT;Products;;Jackets @ku@kuCategory@ku@",
"totalVariants": 0,
"groupPrices": "",
"url": "https://jsv2-shopify-demo.ksearchmisc.com/products/juno-jacket-green",
"tags": "adjustable, comfort, machine, royal, running, zipped",
"size": "Large",
"name": "Juno Jacket",
"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",
"category": "Jackets"
},
{
"discount": "",
"hideGroupPrices": "",
"type": "Jackets",
"itemGroupId": "4384052084798",
"freeShipping": "",
"storeBaseCurrency": "GBP",
"price": "99.00",
"toPrice": "",
"imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mj08-green_main_7f692ff8-45b0-4d08-8371-a2044df82752_medium.jpg?v=1575478284",
"currency": "GBP",
"inStock": "yes",
"id": "31366487310398",
"imageHover": "",
"sku": "MJ08-XS-Green",
"brand": "MNH",
"startPrice": "",
"image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mj08-green_main_7f692ff8-45b0-4d08-8371-a2044df82752_medium.jpg?v=1575478284",
"deliveryInfo": "",
"hideAddToCart": "",
"salePrice": "99.0",
"swatchesInfo": "",
"weight": "",
"klevu_category": "KLEVU_PRODUCT;Products;;Jackets @ku@kuCategory@ku@",
"totalVariants": 0,
"groupPrices": "",
"url": "https://jsv2-shopify-demo.ksearchmisc.com/products/lando-gym-jacket-green",
"tags": "green, machine, royal, zipped",
"size": "Medium",
"name": "Lando Gym Jacket",
"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",
"category": "Jackets"
},
{
"discount": "",
"hideGroupPrices": "",
"type": "Jackets",
"itemGroupId": "4384051527742",
"freeShipping": "",
"storeBaseCurrency": "GBP",
"price": "66.00",
"toPrice": "",
"imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mj10-red_main_9e1898b9-9d4a-41df-8dc6-7d31cd23c34e_medium.jpg?v=1575478275",
"currency": "GBP",
"inStock": "yes",
"id": "31366485966910",
"imageHover": "",
"sku": "MJ10-XS-Red",
"brand": "MNH",
"startPrice": "",
"image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mj10-red_main_9e1898b9-9d4a-41df-8dc6-7d31cd23c34e_medium.jpg?v=1575478275",
"deliveryInfo": "",
"hideAddToCart": "",
"salePrice": "66.0",
"swatchesInfo": "",
"weight": "",
"klevu_category": "KLEVU_PRODUCT;Products;;Tops;;Jackets @ku@kuCategory@ku@",
"totalVariants": 0,
"groupPrices": "",
"url": "https://jsv2-shopify-demo.ksearchmisc.com/products/mars-heattech-trade-pullover-red",
"tags": "machine, red, royal, zipped",
"size": "Medium",
"name": "Mars HeatTech™ Pullover",
"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",
"category": "Tops;;Jackets"
},
{
"discount": "",
"hideGroupPrices": "",
"type": "Jackets",
"itemGroupId": "4384033603646",
"freeShipping": "",
"storeBaseCurrency": "GBP",
"price": "56.25",
"toPrice": "",
"imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj02-blue_main_8549c057-4567-4b63-ac2e-2068d345ff28_medium.jpg?v=1575478014",
"currency": "GBP",
"inStock": "yes",
"id": "31366456279102",
"imageHover": "",
"sku": "WJ02-XS-Blue",
"brand": "KSD",
"startPrice": "",
"image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj02-blue_main_8549c057-4567-4b63-ac2e-2068d345ff28_medium.jpg?v=1575478014",
"deliveryInfo": "",
"hideAddToCart": "",
"salePrice": "56.25",
"swatchesInfo": "",
"weight": "",
"klevu_category": "KLEVU_PRODUCT;Products;;Jackets @ku@kuCategory@ku@",
"totalVariants": 0,
"groupPrices": "",
"url": "https://jsv2-shopify-demo.ksearchmisc.com/products/josie-yoga-jacket-blue",
"tags": "comfort, machine, royal, running, zipped",
"size": "Small",
"name": "Josie Yoga Jacket",
"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",
"category": "Jackets"
},
{
"discount": "",
"hideGroupPrices": "",
"type": "Jackets",
"itemGroupId": "4384052150334",
"freeShipping": "",
"storeBaseCurrency": "GBP",
"price": "99.00",
"toPrice": "",
"imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mj08-gray_main_3787cf65-8e0a-4540-8f11-6d188980a6eb_medium.jpg?v=1575478285",
"currency": "GBP",
"inStock": "yes",
"id": "31366487375934",
"imageHover": "",
"sku": "MJ08-XS-Gray",
"brand": "KKE",
"startPrice": "",
"image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mj08-gray_main_3787cf65-8e0a-4540-8f11-6d188980a6eb_medium.jpg?v=1575478285",
"deliveryInfo": "",
"hideAddToCart": "",
"salePrice": "99.0",
"swatchesInfo": "",
"weight": "",
"klevu_category": "KLEVU_PRODUCT;Products;;Jackets @ku@kuCategory@ku@",
"totalVariants": 0,
"groupPrices": "",
"url": "https://jsv2-shopify-demo.ksearchmisc.com/products/lando-gym-jacket-gray",
"tags": "gray, machine, royal, zipped",
"size": "Large",
"name": "Lando Gym Jacket",
"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",
"category": "Jackets"
},
{
"discount": "",
"hideGroupPrices": "",
"type": "Jackets",
"itemGroupId": "4384033243198",
"freeShipping": "",
"storeBaseCurrency": "GBP",
"price": "84.00",
"toPrice": "",
"imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj04-white_main_d8fa2b03-08ff-485c-afd1-b3761e70e9ce_medium.jpg?v=1575478004",
"currency": "GBP",
"inStock": "yes",
"id": "31366455427134",
"imageHover": "",
"sku": "WJ04-XS-White",
"brand": "KKE",
"startPrice": "",
"image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj04-white_main_d8fa2b03-08ff-485c-afd1-b3761e70e9ce_medium.jpg?v=1575478004",
"deliveryInfo": "",
"hideAddToCart": "",
"salePrice": "84.0",
"swatchesInfo": "",
"weight": "",
"klevu_category": "KLEVU_PRODUCT;Products;;Jackets @ku@kuCategory@ku@",
"totalVariants": 0,
"groupPrices": "",
"url": "https://jsv2-shopify-demo.ksearchmisc.com/products/ingrid-running-jacket-white",
"tags": "comfort, machine, royal, running, zipped",
"size": "Medium",
"name": "Ingrid Running Jacket",
"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",
"category": "Jackets"
},
{
"discount": "",
"hideGroupPrices": "",
"type": "Jackets",
"itemGroupId": "4384033308734",
"freeShipping": "",
"storeBaseCurrency": "GBP",
"price": "84.00",
"toPrice": "",
"imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj04-red_main_5c76d8d8-ad1a-414f-b6b7-9edccc50b955_medium.jpg?v=1575478005",
"currency": "GBP",
"inStock": "yes",
"id": "31366455525438",
"imageHover": "",
"sku": "WJ04-XS-Red",
"brand": "KSD",
"startPrice": "",
"image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj04-red_main_5c76d8d8-ad1a-414f-b6b7-9edccc50b955_medium.jpg?v=1575478005",
"deliveryInfo": "",
"hideAddToCart": "",
"salePrice": "84.0",
"swatchesInfo": "",
"weight": "",
"klevu_category": "KLEVU_PRODUCT;Products;;Jackets @ku@kuCategory@ku@",
"totalVariants": 0,
"groupPrices": "",
"url": "https://jsv2-shopify-demo.ksearchmisc.com/products/ingrid-running-jacket-red",
"tags": "comfort, machine, royal, running, zipped",
"size": "Large",
"name": "Ingrid Running Jacket",
"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",
"category": "Jackets"
},
{
"discount": "",
"hideGroupPrices": "",
"type": "Hoodies & Sweatshirts",
"itemGroupId": "4384033964094",
"freeShipping": "",
"storeBaseCurrency": "GBP",
"price": "75.00",
"toPrice": "",
"imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj01-blue_main_d6ed0a23-7d18-42d4-921c-5669f65a7580_medium.jpg?v=1575478022",
"currency": "GBP",
"inStock": "yes",
"id": "31366456672318",
"imageHover": "",
"sku": "WJ01-S-Blue",
"brand": "MNH",
"startPrice": "",
"image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj01-blue_main_d6ed0a23-7d18-42d4-921c-5669f65a7580_medium.jpg?v=1575478022",
"deliveryInfo": "",
"hideAddToCart": "",
"salePrice": "75.0",
"swatchesInfo": "",
"weight": "",
"klevu_category": "KLEVU_PRODUCT;Products;;Jackets;;Hoodies & Sweatshirts @ku@kuCategory@ku@",
"totalVariants": 0,
"groupPrices": "",
"url": "https://jsv2-shopify-demo.ksearchmisc.com/products/stellar-solar-jacket-s-blue",
"tags": "Cold-whether, comfortable, crewneck, Grayson, Hoodie, machine, Sweatshirt, winter, Wool",
"size": "Small",
"name": "Stellar Solar Jacket",
"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",
"category": "Jackets;;Hoodies & Sweatshirts"
},
{
"discount": "",
"hideGroupPrices": "",
"type": "Jackets",
"itemGroupId": "4384052412478",
"freeShipping": "",
"storeBaseCurrency": "GBP",
"price": "72.00",
"toPrice": "",
"imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mj07-red_main_7fb57683-fddb-44a9-90aa-fc03536bbd90_medium.jpg?v=1575478289",
"currency": "GBP",
"inStock": "yes",
"id": "31366487769150",
"imageHover": "",
"sku": "MJ07-XS-Red",
"brand": "KKE",
"startPrice": "",
"image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mj07-red_main_7fb57683-fddb-44a9-90aa-fc03536bbd90_medium.jpg?v=1575478289",
"deliveryInfo": "",
"hideAddToCart": "",
"salePrice": "72.0",
"swatchesInfo": "",
"weight": "",
"klevu_category": "KLEVU_PRODUCT;Products;;Jackets @ku@kuCategory@ku@",
"totalVariants": 0,
"groupPrices": "",
"url": "https://jsv2-shopify-demo.ksearchmisc.com/products/orion-two-tone-fitted-jacket-red",
"tags": "machine, red, royal, zipped",
"size": "Large",
"name": "Orion Two-Tone Fitted Jacket",
"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",
"category": "Jackets"
}
],
"filters": []
}
]
}Try it here!