Recommend Products Based on Product Name

You can get product recommendations based on a product name by sending a request to the Cataloglake method using the following code:

Python

try:
      catalog_recommend_data = catalog.recommend(catalog_object)
      print("catalog_recommend_data----", catalog_recommend_data)
except Exception as e:
    print(f"Error fetching recommendations: {e}")

Example Product Name String

"product_name" = "show me pink and blue saree with matching blouse under Rs 500"

Example App Code

catalog_object = {
    "cataloglake_id": "groclake_products_81skstvyw3",
    "product_name":"Headphone",
    "num_items":"1",
     "filters":{}

}

catalog_recommend_data = catalog.recommend(catalog_object)
print("catalog_recommend_data----", catalog_recommend_data)



#RESPONSE FROM CATALOG RECOMMEND

# {
#     "items": [
#         {
#             "product_name": "Foxin 306 Big Bass Wired Headphone Headphone Foxin  ",
#             "product_id": 2116465766.0,
#             "provider_id": "27086",
#             "provider_url": "",
#             "image_link1": "",
#             "image_link2": "",
#             "image_link3": "",
#             "product_url": "",
#             "brand": "",
#             "category_name": "Headphone",
#             "price": 1500.0,
#             "sale_price": 599.0,
#             "rating": "",
#             "weight": "0",
#             "score": 1.5418848
#         }
#     ]
# }

Last updated