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
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.
Record search
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
https://<cloudSearchURL>/cloud-search/n-search/search
Query Parameters
- ticketstringrequiredDescription
- termstringrequiredDescription
- isCategoryNavigationRequestBooleanrequiredDescription
- categoryIntegerrequiredDescription
- svNumberrequiredDescription
- paginationStartsFromIntegerDescription
- noOfResultsIntegerDescription
- enableFiltersBooleanDescription
- enableMultiSelectFiltersBooleanDescription
- applyFiltersstringDescription
- maxNoOfValuesInAFilterIntegerDescription
- sortOrderstringDescription
- showOutOfStockProductsBooleanDescription
- fetchMinMaxPriceBooleanDescription
- priceFieldSuffixstringDescription
- visibilitystringDescription
- optionalFiltersstringDescription
- responseTypestringDescription
- lsqtstringDescription
- flstringDescription
curl
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
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',
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',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
200
{
"meta": {
"layoutId": "",
"layoutType": "",
"noOfResults": 2,
"paginationStartFrom": 0,
"powerdByLogo": "",
"totalResultsFound": 9,
"typeOfQuery": "WILDCARD_AND",
"storeBaseCurrency": "GBP",
"notificationCode": 1,
"term": "*",
"excludeIds": null,
"isPersonalised": false,
"idsUsedForPersonalisation": null
},
"result": [
{
"discount": "",
"hideGroupPrices": "",
"type": "Watches",
"itemGroupId": "4384059195454",
"freeShipping": "",
"storeBaseCurrency": "GBP",
"price": "49.00",
"toPrice": "",
"imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mg01-bk-0_34e7622a-503f-42f7-8e63-a57d758cf293_medium.jpg?v=1575478386",
"currency": "GBP",
"inStock": "yes",
"id": "31366496419902",
"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",
"sku": "24-MG01",
"brand": "KKE",
"startPrice": "",
"image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mg01-bk-0_34e7622a-503f-42f7-8e63-a57d758cf293_medium.jpg?v=1575478386",
"deliveryInfo": "",
"hideAddToCart": "",
"salePrice": "49.0",
"oldPrice": "49.0",
"swatches": {
"swatch": [],
"lowestPrice": "",
"numberOfAdditionalVariants": ""
},
"weight": "",
"klevu_category": "KLEVU_PRODUCT;Products;;Watches @ku@kuCategory@ku@",
"totalVariants": "0",
"groupPrices": "",
"url": "https://jsv2-shopify-demo.ksearchmisc.com/products/endurance-watch",
"tags": "Digital, LED, watch",
"size": "Free Size",
"name": "Endurance Watch",
"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,",
"category": "Watches",
"typeOfRecord": "KLEVU_PRODUCT"
},
{
"discount": "",
"hideGroupPrices": "",
"type": "Watches",
"itemGroupId": "4384058769470",
"freeShipping": "",
"storeBaseCurrency": "GBP",
"price": "92.00",
"toPrice": "",
"imageUrl": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mg02-bk-0_e6375bd6-e9b3-41ad-ae00-b6ee4457023b_medium.jpg?v=1575478380",
"currency": "GBP",
"inStock": "yes",
"id": "31366495961150",
"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",
"sku": "24-MG02",
"brand": "KKE",
"startPrice": "",
"image": "https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mg02-bk-0_e6375bd6-e9b3-41ad-ae00-b6ee4457023b_medium.jpg?v=1575478380",
"deliveryInfo": "",
"hideAddToCart": "",
"salePrice": "92.0",
"oldPrice": "92.0",
"swatches": {
"swatch": [],
"lowestPrice": "",
"numberOfAdditionalVariants": ""
},
"weight": "",
"klevu_category": "KLEVU_PRODUCT;Products;;Watches @ku@kuCategory@ku@",
"totalVariants": "0",
"groupPrices": "",
"url": "https://jsv2-shopify-demo.ksearchmisc.com/products/dash-digital-watch",
"tags": "dash, digital, watch",
"size": "Free Size",
"name": "Dash Digital Watch",
"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",
"category": "Watches",
"typeOfRecord": "KLEVU_PRODUCT"
}
],
"filters": [],
"price": {
"min": "",
"max": "",
"start": "",
"end": ""
},
"autoComplete": [],
"popularTerm": [],
"pages": [],
"categories": [],
"popularProducts": [],
"recentlyViewedProducts": [],
"ranges": [],
"error": {
"errorMessage": ""
}
}