Recommendations
Krestor recommendations bring the same personalization graphs, conversion optimization and product data used to power browse and search to product recommendations.
Rather than offer fixed endpoints such as "Recently-viewed items" or "Complementary Items", Krestor implements recommendations using two related concepts: pods and strategies.
Pods represent a specific location on a page or set of pages (template) where recommendations may be rendered. A page may have one or more pods. You may have several pods on the homepage, a pod on the product detail page or in an email campaign.
Strategies represent a particular algorithm used to generate recommendations. Currently, a pod can be assigned a (single) strategy, but the capability is possible in the future to support multiple strategies in a single pod. Example strategies might be "Recently viewed," "Alternative items," etc.
Available strategies
Krestor provides several strategies that can be associated with a given pod. Currently the association is configured @ onboarding and upon request thereafter.
Recently Viewed Items
The simplest but often most-interacted-with strategy: Show a user’s most recently viewed items.
User Featured Items
Provide personalized recommendations to a user based on their entire search, view, click, add to cart and purchase history. This algorithm is particularly valuable on homepages and zero result pages -- anywhere outside the context of a particular product page.
Alternative Items
Show items a user might consider as an alternative to a particular item or set of items. For example, if a user is looking at toothpaste, this algorithm would most likely show other sizes or brands of toothpaste.
Complementary Items
Show items a user would purchase in addition to a particular item or set of items. For example, if a user is looking at toothpaste, this algorithm would tend to show toothbrushes and dental floss.
Query recommendations
Generally used to show items to users on a zero-result page based on the term and data on intent Krestor has collected. The strategy primarily leverages refinements data -- what other users have clicked, added to cart and/or purchased after encountering this zero-result page. Useful to quickly capture lost conversions on zero result pages. Will return zero or more items depending on behavior and available data.
Filtered items (Show more from given facet)
Show items from a provided filter expression, such as grade: 6th, or recommended use: fishing, and optionally focus these on items more similar to a given product. If you sell educational books to an audience of teachers, you could apply this strategy on product pages to show products most similar to the current product within a specific grade level.
The only requirement for this strategy is a filter
expression of the format filters[filter_name]=filter_value
, as you would provide in browse or search endpoints. You may include several facets, such as filters[grade]=6&filters[Size]=S
. Providing the optional item_id
will prioritize items more similar to a particular product, which product will not be returned as a recommendation (to avoid duplication).
Create pod
There is not yet a customer-facing API for pod creation and configuration. To define the pods for your app or web property, reach out to support@Krestor or in your dedicated Slack channel.
Retrieve recommendations
- Shell
- JavaScript
- Python
- Java
- iOS
- Android
- C#
curl -X GET -H "Content-Type: application/json" \
"https://ac.cnstrc.com/recommendations/v1/pods/[pod_id]?key=[your key]§ion=[section]&item_id=[item id]&num_results=[num results]`
// Client side Javascript
// Please refer to https://Krestor-io.github.io/Krestorio-client-javascript/module-recommendations.html#~getRecommendations
// Node
// Please refer to https://Krestor-io.github.io/Krestorio-node/module-recommendations.html#~getRecommendations
# Please refer to https://Krestor-io.github.io/Krestorio-python/Krestor_io.modules.html#module-Krestor_io.modules.recommendations
// Please refer to https://Krestor-io.github.io/Krestorio-java/io/Krestor/client/KrestorIO.html
// Please refer to https://Krestor-io.github.io/Krestorio-client-swift/
// Please refer to https://Krestor-io.github.io/Krestorio-client-android/library/io.Krestor.core/-Krestor-io/index.html#%5Bio.Krestor.core%2FKrestorIo%2FgetRecommendationResults%2F%23kotlin.String%23kotlin.collections.List%5Bkotlin.Pair%5Bkotlin.String%2Ckotlin.collections.List%5Bkotlin.String%5D%5D%5D%3F%23kotlin.Int%3F%23kotlin.String%3F%23kotlin.String%3F%23kotlin.String%3F%2FPointingToDeclaration%2F%5D%2FFunctions%2F-1632692142
// This method is not currently supported.
HTTP Request
GET https://ac.cnstrc.com/recommendations/v1/pods/[pod_id]?key=[your key]§ion=[section]&item_id=[item id]&num_results=[num results]
URL Parameters
Parameter | Description |
---|---|
pod_id | Pod identifier |
Query Parameters
Parameter | Required? | Description |
---|---|---|
key | Yes | The index from which you'd like to retrieve recommendations. |
section | Yes | The index section you'd like to retrieve recommendations from, this is typically Products . |
num_results | No | The number of recommendations to return. Defaults to 10. Generally you should request only the recommendations you intend to display to simplify tracking. The maximum value is 100. |
item_id | Yes, if strategy is alternative or complementary | Item id for which to retrieve recommendations. You can pass multiple item ids, e.g. &item_id=id1&item_id=id2 , which may be useful, for example, for cart page recommendations. |
ui | Yes, if strategy is user featured or recently viewed items | User id to retrieve recommendations for. |
filters | Yes, if strategy is filtered items | A filtering expression with which to retrieve results. |
System Status
To check the health of the system that serves /recommendations
requests, you can issue a GET /status/product/recommendations
, as shown below:
- Shell
- JavaScript
- Python
- Java
- iOS
- Android
- C#
curl -X GET "https://ac.cnstrc.com/status/product/recommendations"
// This method is not currently supported.
# This method is not currently supported.
// This method is not currently supported.
// This method is not currently supported.
// This method is not currently supported.
// This method is not currently supported.
A healthy system will reply with {"message": "OK"}