- Request recommendations to display on your website, most commonly as Product Cards
- Send events for tracking user interaction with the recommendations.
Requesting recommendations
There are multiple endpoints available for different kinds of recommendations. We begin by showing how you get recommendations for a given Product ID, which is what you do when, for example, displaying recommendations on a product’s product page.Get recommendations for a single product
For displaying recommendations on a product’s product page use following endpoint:POST https://api.depict.ai/v2/recommend/products/product
Example request
TypeScript
product_id
for the product you want the recommendations to be based on, as well as the type
of recommendations to generate.
The available types depend on what Depict has configured for you. Common examples include “similar”, “cross_sell”, and “checkout”.
You must also include your store’s unique identifier in the tenant
field and the market name as market
.
In order to identify the user interacting with the recommendations you must send the session_id
parameter.
Response
The response contains a list of recommended products with everything you need to display the product cards. 💡 We can help you extend the fields that are returned if there is anything specific you need. For example, you may want the sustainability value as a field to show each recommended product’s sustainability score. Just make sure this field is available or can be computed from the data you have provided us.Example response
JSON