Guide
Smart Recommendations
Hand Picked
2min
If you haven't gone through the prerequisites and the v2 structure, please have a look at Overview
Klevu can power a recommendation banner showcasing any products which you, the merchant, has manually curated. The most common placements for this banner type are:
Homepage: Our Recommended Products Show a recommendation banner with products you would like all customers to see.
The end-point is used for retrieving hand picked product recommendations.
POST
Request
Body Parameters
typeOfRequest
required
String
For this recommendation type, please specify SEARCH.
customANDQuery
required
String
Here we make a custom query to Klevu, since we know exactly which records we expect in the response. Specify the IDs of all of the products you would like your customers to see, separated by OR
topIds
required
Array
Use this field to specify the order the results should be returned, with the ones you would like to be more prominent coming first.
Request Body (JSON)
PHP
JS
Java
Node.js
1{
2 "recordQueries": [
3 {
4 "id": "recsHandPicked",
5 "typeOfRequest": "SEARCH",
6 "settings": {
7 "customANDQuery":"(id:\"34322453430403\" OR id:\"34322423840899\")",
8 "topIds": [
9 {
10 "key": "id",
11 "value": "34322453430403"
12 },
13 {
14 "key": "id",
15 "value": "34322423840899"
16 }
17 ],
18 "typeOfRecords": [
19 "KLEVU_PRODUCT"
20 ]
21 }
22 }
23 ],
24 "context": {
25 "apiKeys": [
26 "klevu-158755634955912036"
27 ]
28 }
29}
Responses
200
1{
2 "meta": {
3 "qTime": 7,
4 "responseCode": 200
5 },
6 "queryResults": [
7 {
8 "id": "recsHandPicked",
9 "meta": {
10 "qTime": 4,
11 "noOfResults": 12,
12 "totalResultsFound": 2,
13 "typeOfSearch": "WILDCARD_AND",
14 "offset": 0,
15 "debuggingInformation": {},
16 "notificationCode": 1,
17 "searchedTerm": "*",
18 "apiKey": "klevu-158755634955912036",
19 "isPersonalised": false
20 },
21 "records": [
22 {
23 "color": "White Hoodie thick",
24 "discount": "",
25 "hideGroupPrices": "",
26 "itemGroupId": "5192753152131",
27 "freeShipping": "",
28 "storeBaseCurrency": "EUR",
29 "price": "56.68",
30 "toPrice": "",
31 "imageUrl": "https://cdn.shopify.com/s/files/1/0386/6653/5043/products/product-image-1664797420_medium.jpg?v=1611184206&vid=34322452512899,34322452971651,34322453430403,34322471256195,34322471551107,34322471846019,34322472173699",
32 "currency": "EUR",
33 "inStock": "yes",
34 "id": "34322453430403",
35 "imageHover": "https://cdn.shopify.com/s/files/1/0386/6653/5043/products/product-image-1664797422_medium.jpg?v=1611184206&vid=34322466177155,34322466603139,34322466930819,34322467192963,34322467586179,34322467946627,34322468339843",
36 "sku": "30504298-white-hoodie-thick-asian-m",
37 "brand": "klevu-personalisation-demo",
38 "startPrice": "48.48",
39 "image": "https://cdn.shopify.com/s/files/1/0386/6653/5043/products/product-image-1664797420_medium.jpg?v=1611184206&vid=34322452512899,34322452971651,34322453430403,34322471256195,34322471551107,34322471846019,34322472173699",
40 "deliveryInfo": "",
41 "hideAddToCart": "",
42 "salePrice": "56.68",
43 "swatchesInfo": "variantColor1:Black Hoodie thin ;;;; variantColor3:Blue Hoodie thick ;;;; variantColor2:White Hoodie thick ;;;; variantColor5:White Hoodie thin ;;;; variantColor4:Black Hoodie thick ;;;; variantColor6:Yellow Hoodie thin ;;;; variantImage6:https://cdn.shopify.com/s/files/1/0386/6653/5043/products/product-image-1664797423_medium.jpg?v=1611184258&vid=16847225487491 ;;;; variantImage3:https://cdn.shopify.com/s/files/1/0386/6653/5043/products/product-image-1664797419_medium.jpg?v=1611184206&vid=16847185313923 ;;;; variantId6:34322463555715 ;;;; variantImage2:https://cdn.shopify.com/s/files/1/0386/6653/5043/products/product-image-1664797420_medium.jpg?v=1611184206&vid=16847185510531 ;;;; variantImage5:https://cdn.shopify.com/s/files/1/0386/6653/5043/products/product-image-1664797424_medium.jpg?v=1611184206&vid=16847190851715 ;;;; variantId4:34322456838275 ;;;; variantImage4:https://cdn.shopify.com/s/files/1/0386/6653/5043/products/product-image-1664797418_medium.jpg?v=1611184250&vid=16847223521411 ;;;; variantId5:34322460016771 ;;;; variantId2:34322452512899 ;;;; variantId3:34322453889155 ;;;; variantImage1:https://cdn.shopify.com/s/files/1/0386/6653/5043/products/product-image-1664797425_medium.jpg?v=1611184240&vid=16847221883011 ;;;; variantId1:34322448646275 ;;;;",
44 "weight": "",
45 "klevu_category": "KLEVU_PRODUCT;Products;;All;;Women Sweatshirts @ku@kuCategory@ku@",
46 "totalVariants": 0,
47 "groupPrices": "",
48 "url": "https://klevu-personalisation-demo.myshopify.com/products/singleroad-mens-hoodies-men-women-2021-spring-sweatshirt-male-japanese-streetwear-oversized-yellow-anime-hoodie-men-sweatshirts",
49 "size": "Asian-M",
50 "name": "Singleroad Men's Hoodies Men Women 2021 Sweatshirt Male Japanese Streetwear Oversized Anime Hoodie Men Sweatshirts",
51 "shortDesc": "gender:gender:men; closure:closure:none; ;;;; Brand Name: Single Road Origin: CN(Origin) Sleeve Length(cm): Full Gender:",
52 "category": "All;;Women Sweatshirts",
53 "typeOfRecord": "KLEVU_PRODUCT"
54 },
55 {
56 "discount": "",
57 "hideGroupPrices": "",
58 "itemGroupId": "5192749842563",
59 "freeShipping": "",
60 "storeBaseCurrency": "EUR",
61 "price": "50.00",
62 "toPrice": "",
63 "imageUrl": "https://cdn.shopify.com/s/files/1/0386/6653/5043/products/product-image-1665231658_medium.jpg?v=1611183787",
64 "currency": "EUR",
65 "inStock": "yes",
66 "id": "34322423840899",
67 "imageHover": "",
68 "sku": "42882422-xl",
69 "brand": "klevu-personalisation-demo",
70 "startPrice": "",
71 "image": "https://cdn.shopify.com/s/files/1/0386/6653/5043/products/product-image-1665231658_medium.jpg?v=1611183787",
72 "deliveryInfo": "",
73 "hideAddToCart": "",
74 "salePrice": "50.0",
75 "swatchesInfo": "",
76 "weight": "",
77 "klevu_category": "KLEVU_PRODUCT;Products;;All;;Women Sweatshirts @ku@kuCategory@ku@",
78 "totalVariants": 0,
79 "groupPrices": "",
80 "url": "https://klevu-personalisation-demo.myshopify.com/products/womens-white-printed-hooded-oversize-knitted-sweatshirt",
81 "name": "WoMen's Printed Hooded Oversize Knitted Sweatshirt",
82 "shortDesc": ";;;; Brand Name: FASHİON ROOM Material: Cotton Origin: CN(Origin)",
83 "category": "All;;Women Sweatshirts",
84 "typeOfRecord": "KLEVU_PRODUCT"
85 }
86 ],
87 "filters": []
88 }
89 ]
90}
1<iframe src="https://codesandbox.io/embed/klevu-api-sendbox-4ktfrp?fontsize=14&hidenavigation=0&theme=dark&view=preview&initialpath=?payload=handPicked"
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>
Updated 30 Oct 2023
Did this page help you?