Visually Similar
3 min
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.
Visually Similar Product Recommendations
The end-point is used for retrieving visually similar product recommendations.
POST
https://eucs19v2.ksearchnet.com/cs/v2/search
var 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"}]}]}}}]});
var xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://eucs28v2.ksearchnet.com/cs/v2/search");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);Try it here!