Guide
Smart Recommendations
Visually Similar
3min
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 other products from the catalog which are visually similar to the product currently being viewed. This type of recommendation can be used on:
Visually Similar recommendation is currently only available for Furniture domain.
Product Page: Visually Similar Products Show a recommendation banner with products that are visually similar to the primary image of the product currently being viewed.
The end-point is used for retrieving visually similar product recommendations.
POST
Request
Body Parameters
typeOfRequest
required
String
For this recommendation type, please specify RECS_SIMILAR_IMAGES.
sourceObjects
required
Object
The Klevu ID of the product you will use for context. Klevu will find other visually similar products to the primary image of the product specified in this field.
Request Body (JSON)
PHP
JS
Java
Node.js
1var data = JSON.stringify({"context":{"apiKeys":["klevu-164270249063714699"]},"recordQueries":[{"id":"klevuRECSItemList","typeOfRequest":"RECS_SIMILAR_IMAGES","settings":{"typeOfRecords":["KLEVU_PRODUCT"],"limit":10,"excludeIds":[{"key":"itemGroupId","value":"6920771731501"}],"context":{"sourceObjects":[{"typeOfRecord":"KLEVU_PRODUCT","records":[{"itemGroupId":"6920771731501"},{"id":"40225093124141"}]}]}}}]});
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://eucs28v2.ksearchnet.com/cs/v2/search");
13xhr.setRequestHeader("Content-Type", "application/json");
14
15xhr.send(data);
Responses
200
1{
2 "meta": {
3 "qTime": 529,
4 "responseCode": 200
5 },
6 "queryResults": [
7 {
8 "id": "klevuRECSItemList",
9 "meta": {
10 "qTime": 125,
11 "noOfResults": 10,
12 "totalResultsFound": 16,
13 "typeOfSearch": "WILDCARD_AND",
14 "offset": 0,
15 "debuggingInformation": {},
16 "notificationCode": 1,
17 "searchedTerm": "*",
18 "apiKey": "klevu-164270249063714699",
19 "isPersonalised": false
20 },
21 "records": [
22 {
23 "discount": "",
24 "hideGroupPrices": "",
25 "type": "Furniture",
26 "itemGroupId": "6920770322477",
27 "freeShipping": "",
28 "storeBaseCurrency": "USD",
29 "price": "2099.00",
30 "toPrice": "",
31 "imageUrl": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/226507-001_FRT_1_medium.jpg?v=1642666285",
32 "currency": "USD",
33 "inStock": "yes",
34 "id": "40225085521965",
35 "imageHover": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/226507-001_PRM_1_medium.jpg?v=1642666285",
36 "sku": "L0461529",
37 "brand": "Lulu and Georgia",
38 "startPrice": "",
39 "image": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/226507-001_FRT_1_medium.jpg?v=1642666285",
40 "deliveryInfo": "",
41 "hideAddToCart": "",
42 "salePrice": "2099.0",
43 "swatchesInfo": "",
44 "weight": "",
45 "klevu_category": "KLEVU_PRODUCT;Products;;Furniture - Dressers;;Furniture - All @ku@kuCategory@ku@",
46 "totalVariants": 0,
47 "groupPrices": "",
48 "url": "https://danish-store-livetest3.myshopify.com/products/maeve-dresser",
49 "name": "Maeve Dresser",
50 "shortDesc": "Simply inspired, this solid dry-washed poplar dresser combines clean lines with dovetail joints in a Shaker-inspired design. This wood dresser is finished in a light neutral tone and fitted with iron and leather hardware and six spacious drawers i",
51 "category": "Furniture - Dressers;;Furniture - All",
52 "typeOfRecord": "KLEVU_PRODUCT"
53 },
54 {
55 "discount": "",
56 "hideGroupPrices": "",
57 "type": "Furniture",
58 "itemGroupId": "6967619584045",
59 "freeShipping": "",
60 "storeBaseCurrency": "USD",
61 "price": "9140.00",
62 "toPrice": "",
63 "imageUrl": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/McQueen-8-drawer-chest-by-Matthew-Hilton_medium.jpg?v=1646906983",
64 "model": "12 Drawers",
65 "currency": "USD",
66 "inStock": "yes",
67 "id": "40412686188589",
68 "imageHover": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/368McQueenLargeChestbyMatthewHiltoninDanishoiledwalnut-whitebkgrnd_medium.png?v=1646906983",
69 "sku": "HA159951-1",
70 "brand": "De La Espada",
71 "startPrice": "6020.0",
72 "image": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/McQueen-8-drawer-chest-by-Matthew-Hilton_medium.jpg?v=1646906983",
73 "deliveryInfo": "",
74 "hideAddToCart": "",
75 "salePrice": "9140.0",
76 "wood_finish": "Walnut/White Oiled",
77 "swatchesInfo": "",
78 "weight": "",
79 "klevu_category": "KLEVU_PRODUCT;Products;;Furniture - All @ku@kuCategory@ku@",
80 "totalVariants": 19,
81 "groupPrices": "",
82 "url": "https://danish-store-livetest3.myshopify.com/products/mcqueen-chests-by-matthew-hilton",
83 "tags": "designed-by-Matthew Hilton, made-to-order-12",
84 "name": "McQueen Chest by Matthew Hilton",
85 "shortDesc": "McQueen Chests are strong, elegant and down-to-earth and their wide body and numerous drawers provide maximum storage space. The drawers are detailed with dovetail joinery, cast iron handles, and soft-closing piston action. Details",
86 "category": "Furniture - All",
87 "typeOfRecord": "KLEVU_PRODUCT"
88 },
89 {
90 "discount": "",
91 "hideGroupPrices": "",
92 "type": "Furniture",
93 "itemGroupId": "6967621287981",
94 "freeShipping": "",
95 "storeBaseCurrency": "USD",
96 "price": "2745.00",
97 "toPrice": "",
98 "imageUrl": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/McQueen-Bedside-chest-by-Matthew-Hilton_medium.jpg?v=1646907007",
99 "finish": "Walnut/Oiled",
100 "currency": "USD",
101 "inStock": "yes",
102 "id": "40412689137709",
103 "imageHover": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/McQueen-Bedside_Hepburn-Bed.hs_medium.jpg?v=1646907007",
104 "sku": "HA102487",
105 "brand": "De La Espada",
106 "startPrice": "2285.0",
107 "image": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/McQueen-Bedside-chest-by-Matthew-Hilton_medium.jpg?v=1646907007",
108 "deliveryInfo": "",
109 "hideAddToCart": "",
110 "salePrice": "2745.0",
111 "swatchesInfo": "",
112 "weight": "",
113 "klevu_category": "KLEVU_PRODUCT;Products;;Furniture - Beds;;Furniture - All @ku@kuCategory@ku@",
114 "totalVariants": 6,
115 "groupPrices": "",
116 "url": "https://danish-store-livetest3.myshopify.com/products/mcqueen-bedside-chest-by-matthew-hilton",
117 "tags": "designed-by-Matthew Hilton, made-to-order-12",
118 "name": "McQueen Bedside Chest by Matthew Hilton",
119 "shortDesc": "McQueen Bedside Chest is strong, elegant and down-to-earth, its two drawers provide the ideal space for objects needed close to the bed. Drawers are detailed with dovetail joinery, cast iron handles, and soft-closing piston action. Manufact",
120 "category": "Furniture - Beds;;Furniture - All",
121 "typeOfRecord": "KLEVU_PRODUCT"
122 },
123 {
124 "discount": "",
125 "hideGroupPrices": "",
126 "type": "Furniture",
127 "itemGroupId": "6968498618413",
128 "freeShipping": "",
129 "storeBaseCurrency": "USD",
130 "price": "1486.00",
131 "toPrice": "",
132 "imageUrl": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/Square-Website-Haus-London-Montana-Carry3_medium.jpg?v=1646947879",
133 "finish": "New White",
134 "currency": "USD",
135 "inStock": "yes",
136 "id": "40415995920429",
137 "imageHover": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/Square-Website-Haus-London-Montana-Carry4_medium.jpg?v=1646947879",
138 "sku": "",
139 "brand": "Montana Furniture",
140 "startPrice": "",
141 "image": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/Square-Website-Haus-London-Montana-Carry3_medium.jpg?v=1646947879",
142 "deliveryInfo": "",
143 "hideAddToCart": "",
144 "salePrice": "1486.0",
145 "swatchesInfo": "",
146 "weight": "",
147 "klevu_category": "KLEVU_PRODUCT;Products;;Furniture - All @ku@kuCategory@ku@",
148 "totalVariants": 4,
149 "groupPrices": "",
150 "url": "https://danish-store-livetest3.myshopify.com/products/carry-chest-of-drawers-by-montana-furniture",
151 "tags": "designed-by-Peter J. Lassen, lead-time-5, new-arrivals",
152 "mounting_type": "Free Standing - Legs",
153 "name": "Carry Chest of Drawers by Montana Furniture",
154 "shortDesc": "Carry is a modern and timeless chest of three drawers providing the ideal storage solution for the living room, the home office or the bedroom. Carry is a chest that consists of three drawers in one row. We have listed the free-standing uni",
155 "category": "Furniture - All",
156 "typeOfRecord": "KLEVU_PRODUCT"
157 },
158 {
159 "discount": "",
160 "hideGroupPrices": "",
161 "type": "Furniture",
162 "itemGroupId": "6967750656045",
163 "freeShipping": "",
164 "storeBaseCurrency": "USD",
165 "price": "5280.00",
166 "toPrice": "",
167 "imageUrl": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/Mc_Queen_low_chest.hs_medium.jpg?v=1646909088",
168 "currency": "USD",
169 "inStock": "yes",
170 "id": "40412936536109",
171 "imageHover": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/Mc_Queen_low_chest2.hs_medium.jpg?v=1646909088",
172 "sku": "HA112590",
173 "brand": "De La Espada",
174 "startPrice": "5280.0",
175 "image": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/Mc_Queen_low_chest.hs_medium.jpg?v=1646909088",
176 "deliveryInfo": "",
177 "hideAddToCart": "",
178 "salePrice": "5280.0",
179 "swatchesInfo": "",
180 "weight": "",
181 "klevu_category": "KLEVU_PRODUCT;Products;;Furniture - All @ku@kuCategory@ku@",
182 "totalVariants": 2,
183 "groupPrices": "",
184 "url": "https://danish-store-livetest3.myshopify.com/products/mcqueen-low-chest-by-matthew-hilton",
185 "tags": "designed-by-Matthew Hilton, made-to-order-12",
186 "name": "McQueen Low Chest by Matthew Hilton",
187 "shortDesc": "McQueen Chests provide ample storage in classic forms with a beautiful contrast of materials. The solid wood body is punctuated with cast iron drawer pulls and feet. Each drawer front is made from a single plank of timber, carefully chosen for its",
188 "category": "Furniture - All",
189 "typeOfRecord": "KLEVU_PRODUCT"
190 },
191 {
192 "discount": "",
193 "hideGroupPrices": "",
194 "type": "Furniture",
195 "itemGroupId": "6967620894765",
196 "freeShipping": "",
197 "storeBaseCurrency": "USD",
198 "price": "5020.00",
199 "toPrice": "",
200 "imageUrl": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/369McQueenTallChestbyMatthewHiltoninDanishoiledwalnut-front-whitebkgrnd_medium.png?v=1646907003",
201 "wood": "Ash/Oiled",
202 "currency": "USD",
203 "inStock": "yes",
204 "id": "40412687990829",
205 "imageHover": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/369McQueenTallChestbyMatthewHiltoninDanishoiledwalnut-whitebkgrnd_medium.png?v=1646907003",
206 "sku": "HA112591",
207 "brand": "De La Espada",
208 "startPrice": "5020.0",
209 "image": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/369McQueenTallChestbyMatthewHiltoninDanishoiledwalnut-front-whitebkgrnd_medium.png?v=1646907003",
210 "deliveryInfo": "",
211 "hideAddToCart": "",
212 "salePrice": "5020.0",
213 "swatchesInfo": "",
214 "weight": "",
215 "klevu_category": "KLEVU_PRODUCT;Products;;Furniture - All @ku@kuCategory@ku@",
216 "totalVariants": 0,
217 "groupPrices": "",
218 "url": "https://danish-store-livetest3.myshopify.com/products/mcqueen-tall-chest-by-matthew-hilton",
219 "tags": "designed-by-Matthew Hilton, made-to-order-12",
220 "name": "McQueen Tall Chest by Matthew Hilton",
221 "shortDesc": "McQueen Chests are strong, elegant and down-to-earth and their wide body and numerous drawers provide maximum storage space. The drawers are detailed with dovetail joinery, cast iron handles, and soft-closing piston action. Details",
222 "category": "Furniture - All",
223 "typeOfRecord": "KLEVU_PRODUCT"
224 },
225 {
226 "discount": "",
227 "hideGroupPrices": "",
228 "type": "Furniture",
229 "itemGroupId": "6968496259117",
230 "freeShipping": "",
231 "storeBaseCurrency": "USD",
232 "price": "2237.00",
233 "toPrice": "",
234 "imageUrl": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/Square-Website-Haus-London-Montana-Keep5_medium.jpg?v=1646947657",
235 "finish": "Nordic",
236 "currency": "USD",
237 "inStock": "yes",
238 "id": "40415972720685",
239 "imageHover": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/Square-Website-Haus-London-Montana-Keep4_medium.jpg?v=1646947657",
240 "sku": "",
241 "brand": "Montana Furniture",
242 "startPrice": "",
243 "image": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/Square-Website-Haus-London-Montana-Keep5_medium.jpg?v=1646947657",
244 "deliveryInfo": "",
245 "hideAddToCart": "",
246 "salePrice": "2237.0",
247 "swatchesInfo": "",
248 "weight": "",
249 "klevu_category": "KLEVU_PRODUCT;Products;;Furniture - All @ku@kuCategory@ku@",
250 "totalVariants": 5,
251 "groupPrices": "",
252 "url": "https://danish-store-livetest3.myshopify.com/products/keep-chest-of-drawers-by-montana-furniture",
253 "tags": "designed-by-Peter J. Lassen, lead-time-5, new-arrivals",
254 "mounting_type": "Free Standing - Legs",
255 "name": "Keep Chest of Drawers by Montana Furniture",
256 "shortDesc": "This chest of drawers is ideal to keep everything in order in the bedroom, living room or in the hall. It is comprised of one large module with four drawers and a",
257 "category": "Furniture - All",
258 "typeOfRecord": "KLEVU_PRODUCT"
259 },
260 {
261 "discount": "",
262 "hideGroupPrices": "",
263 "type": "Furniture",
264 "itemGroupId": "6968494555181",
265 "freeShipping": "",
266 "storeBaseCurrency": "USD",
267 "price": "1399.00",
268 "toPrice": "",
269 "imageUrl": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/Haus-London-String-Workspace-Bundle-E2_medium.jpg?v=1646947513&vid=40415958007853",
270 "finish": "Black / Black",
271 "currency": "USD",
272 "inStock": "yes",
273 "id": "40415958007853",
274 "imageHover": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/Haus-London-String-Workspace-Bundle-E2_medium.jpg?v=1646947513&vid=40415958007853",
275 "sku": "",
276 "brand": "String Furniture",
277 "startPrice": "1277.0",
278 "image": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/Haus-London-String-Workspace-Bundle-E2_medium.jpg?v=1646947513&vid=40415958007853",
279 "deliveryInfo": "",
280 "hideAddToCart": "",
281 "salePrice": "1399.0",
282 "swatchesInfo": "",
283 "weight": "",
284 "klevu_category": "KLEVU_PRODUCT;Products;;Furniture - All @ku@kuCategory@ku@",
285 "totalVariants": 0,
286 "groupPrices": "",
287 "url": "https://danish-store-livetest3.myshopify.com/products/string-office-bundle-we",
288 "tags": "designed-by-Nils Strinning, lead-time-4-6, new-arrivals, r-STRING, string-bundle",
289 "product_type": "Furniture",
290 "name": "String - Workspace Bundle E",
291 "shortDesc": "String Bundles are ready-made combinations using components from the String Storage System. Whether your works",
292 "category": "Furniture - All",
293 "typeOfRecord": "KLEVU_PRODUCT"
294 },
295 {
296 "discount": "",
297 "hideGroupPrices": "",
298 "type": "Furniture",
299 "itemGroupId": "6967875895341",
300 "freeShipping": "",
301 "storeBaseCurrency": "USD",
302 "price": "3195.00",
303 "toPrice": "",
304 "imageUrl": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/matthew_hilton_mcqueen_bedside_medium.jpg?v=1646915437",
305 "currency": "USD",
306 "inStock": "yes",
307 "id": "40413446602797",
308 "imageHover": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/matthew_hilton_mcqueen_bedside_angle_medium.jpg?v=1646915437",
309 "sku": "HA112511",
310 "brand": "De La Espada",
311 "startPrice": "2660.0",
312 "drawer_unit": "Left Hand Side",
313 "image": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/matthew_hilton_mcqueen_bedside_medium.jpg?v=1646915437",
314 "deliveryInfo": "",
315 "hideAddToCart": "",
316 "salePrice": "3195.0",
317 "wood_finish": "Walnut/Oiled",
318 "swatchesInfo": "",
319 "weight": "",
320 "klevu_category": "KLEVU_PRODUCT;Products;;Furniture - Beds;;Furniture - All @ku@kuCategory@ku@",
321 "totalVariants": 1,
322 "groupPrices": "",
323 "url": "https://danish-store-livetest3.myshopify.com/products/mcqueen-bedside-by-matthew-hilton",
324 "tags": "designed-by-Matthew Hilton, made-to-order-12",
325 "name": "McQueen Bedside Unit by Matthew Hilton",
326 "shortDesc": "McQueen bedside unit has a generous storage capacity including shelving and two drawers. It is available as a left or right hand unit, to allow the drawers to be nearest to each side of the bed. McQueen bedside's drawers are detailed with dovetail jo",
327 "category": "Furniture - Beds;;Furniture - All",
328 "typeOfRecord": "KLEVU_PRODUCT"
329 },
330 {
331 "discount": "",
332 "hideGroupPrices": "",
333 "type": "Furniture",
334 "itemGroupId": "6967988191277",
335 "freeShipping": "",
336 "storeBaseCurrency": "USD",
337 "price": "414.00",
338 "toPrice": "",
339 "imageUrl": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/string_chest_drawers_oak.hs_medium.jpg?v=1646921585&vid=40413964927021",
340 "finish": "Oak",
341 "currency": "USD",
342 "inStock": "yes",
343 "id": "40413964927021",
344 "imageHover": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/string_chest_drawers_white.hs_medium.jpg?v=1646921585&vid=40413964763181",
345 "sku": "LH7830-05-1",
346 "brand": "String Furniture",
347 "startPrice": "356.0",
348 "image": "https://cdn.shopify.com/s/files/1/0564/3730/9485/products/string_chest_drawers_oak.hs_medium.jpg?v=1646921585&vid=40413964927021",
349 "deliveryInfo": "",
350 "hideAddToCart": "",
351 "salePrice": "414.0",
352 "swatchesInfo": "",
353 "weight": "",
354 "klevu_category": "KLEVU_PRODUCT;Products;;Furniture - All @ku@kuCategory@ku@",
355 "totalVariants": 0,
356 "groupPrices": "",
357 "url": "https://danish-store-livetest3.myshopify.com/products/string-shelving-system-chest-with-drawers",
358 "tags": "designed-by-Nils Strinning, lead-time-4-6, r-STRING, string-component",
359 "product_type": "Furniture",
360 "size": "78cm Wide Chest",
361 "name": "String - Chest with Drawers",
362 "shortDesc": "String is the original component shelving system. The structure is light weight, yet stable.",
363 "category": "Furniture - All",
364 "typeOfRecord": "KLEVU_PRODUCT"
365 }
366 ],
367 "filters": []
368 }
369 ]
370}
1<iframe src="https://codesandbox.io/embed/klevu-api-sendbox-4ktfrp?fontsize=14&hidenavigation=0&theme=dark&view=preview&initialpath=?payload=visuallySimilar"
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?