The Recommendations API allows users to promote and recommend items to their customers. Users can get item recommendations from catalogs on their site using algorithms provided by installed apps.
Note: Currently, the Recommendations API is for use with Wix Stores only.
With the Recommendations API, you can:
Algorithms are programs that identify and return a set of item recommendations based on a catalog. There are different types of algorithms, identified by their algorithmType
that calculate different kinds of recommendations. For example, Algorithms with the algorithmType
of RELATED_ITEMS
also take a list of items as input and use those to calculate recommendations.
For example, Wix Stores provides the following algorithms:
Name | Description | Algorithm Type |
---|---|---|
“From the same categories” | Returns items that share the most categories with items in the list provided. | RELATED_ITEMS |
“Frequently bought together” | Returns items that are frequently bought together with the first item in the list provided. | RELATED_ITEMS |
“Frequently viewed together” | Returns items that are frequently viewed together with the first item in the list provided. | RELATED_ITEMS |
“Best sellers” | Returns the items from the catalog with the highest number of sales. | GLOBAL |
Show bestselling products from a Wix site in your app.
This article shares a possible use case your app could support, as well as an example flow that could support the use case. You're certainly not limited to this use case, but it may be a helpful jumping-off point as you plan your app's implementation.
In this scenario, you are selling products through multiple channels, one of which is a website using Wix Stores. You want your app to showcase the bestselling items from each of your channels. To show the bestselling items from the Wix Stores catalog in your app, follow this basic flow:
List Available Algorithms
to get the algorithmId
of the "Best sellers" algorithm.Get Recommendation
with the algorithmId
from step 1. Use the Wix Stores app ID (215238eb-22a5-4c36-9e7b-e7c08025e04e
) in the algorithm object.Get Recommendation
, call Get Product
in the Wix Stores Catalog API using the recommended item’s catalogItemId
.Get Product
, display the bestselling items in your app.Recommended items.
The algorithm used to provide the recommendation.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with Get Recommendation to provide item recommendations to the customer.
Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.
The app which provides an algorithm is referenced by that algorithm’s appId
.
The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s catalogAppIds
array.
For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:
appId
must match the ID of an installed Wix app.catalogAppIds
must match the ID of an installed Wix app.Wix app IDs are listed here.
Algorithms available for use on your Wix site or project. See the method description for more information.
curl GET 'www.wixapis.com/ecom/v1/recommendations/algorithms' \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Authorization: <AUTH>'
{
"availableAlgorithms": [
{
"config": {
"id": "e33f5e32-d1a2-4944-b38f-d29b7d5ef4ef",
"name": "Frequently bought together",
"description": "This gallery works best when added to the product page, cart and thank you page. \n\nIf there’s not enough data about products frequently bought together, we’ll display other related products instead.",
"algorithmType": "RELATED_ITEMS"
},
"appId": "72454cb3-90b5-4cef-bbff-cc61aea02584",
"catalogAppIds": [
"d4bc3347-5a0a-4303-81d9-27293be54aa3",
"8fb80dea-fcd5-410b-a0f3-af553d0bd85e"
]
},
{
"config": {
"id": "6768b44a-6130-46b8-89af-4222e15ba765",
"name": "Frequently viewed together",
"description": "This gallery works best when added to the product page, cart and thank you page.\n\nIf there’s not enough data about products frequently viewed together, we’ll display other related products instead.",
"algorithmType": "RELATED_ITEMS"
},
"appId": "72454cb3-90b5-4cef-bbff-cc61aea02584",
"catalogAppIds": [
"d4bc3347-5a0a-4303-81d9-27293be54aa3",
"8fb80dea-fcd5-410b-a0f3-af553d0bd85e"
]
},
{
"config": {
"id": "115518d6-3dbb-41cd-86fd-7b6841433da2",
"name": "Best sellers",
"description": "We’ll automatically display your store’s best selling products.\n\nIf there’s not enough data about your best selling products, we’ll show related products or your All Products collection.",
"algorithmType": "GLOBAL"
},
"appId": "72454cb3-90b5-4cef-bbff-cc61aea02584",
"catalogAppIds": [
"d4bc3347-5a0a-4303-81d9-27293be54aa3",
"8fb80dea-fcd5-410b-a0f3-af553d0bd85e"
]
},
{
"config": {
"id": "17635deb-6a7d-412f-aeb6-3f8c8507800a",
"name": "From the same collections",
"description": "This gallery works best when added to the product page, cart and thank you page.\n\nIf there’s not enough data about products that share the same collections, we’ll display your All Products collection instead.",
"additionalInfo": "We’ll display products that share the most collections with the existing products on the page.",
"algorithmType": "RELATED_ITEMS"
},
"appId": "72454cb3-90b5-4cef-bbff-cc61aea02584",
"catalogAppIds": [
"d4bc3347-5a0a-4303-81d9-27293be54aa3",
"8fb80dea-fcd5-410b-a0f3-af553d0bd85e"
]
}
]
}
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Returns a recommendation object containing a list of items to recommend to the customer.
Get Recommendation determines which items to recommend based on the given recommendation algorithms.
Get Recommendation doesn’t run the algorithms. It calls the installed apps that provide them.
Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps. For example, Wix Stores provides algorithms that can only be used on its own catalogs. To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed. For more information and to see which algorithms are available on your site or project, call List Available Algorithms.
Get Recommendation operates as follows:
appId
of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.algorithms
array) that meets the minimum number of recommendations. At that point Get Recommendation stops calling other apps.appId
(an ID of an app that has not yet been called), and repeats the process.algorithms
array recommend at least the minimum recommended items, Get Recommendations returns an empty array.The set of items for which to get recommendations. Required if the algorithmType
is RELATED_ITEMS
.
A list of algorithms checked in a specific order determined by their appID
and their position in the algorithms
array.
See the method description for more information.
If no algorithm is able to return at least minimumRecommendedItems
items, an empty array is returned.
The minimum number of items that must be recommended by the algorithm for those items to be returned in the response.
Max: 100
An object containing a list of items recommended by 1 of the specified algorithms. The recommendation is empty if none of the specified algorithms recommended enough items.
curl POST 'www.wixapis.com/ecom/v1/recommendations/get' \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Authorization: <AUTH>' \
--data-binary '{
"items": [
{
"catalogItemId": "ec7914e8-208b-0069-5850-1a965643508d",
"appId": "f29c9b39-1090-4d9b-8e3a-a3a681a57970"
}
],
"algorithms": [
{
"id": "e33f5e32-d1a2-4944-b38f-d29b7d5ef4ef",
"appId": "72454cb3-90b5-4cef-bbff-cc61aea02584"
},
{
"id": "09dc98e8-8696-49f7-833a-bab57f516f88",
"appId": "b0933968-e643-4835-a403-de8e1eb4d33c"
}
],
"minimumRelatedItems": 1
}'
{
"recommendation": {
"items": [
{
"catalogItemId": "1ce6198f-5fad-5ac9-5b36-ecb2175929ef",
"appId": "f29c9b39-1090-4d9b-8e3a-a3a681a57970"
},
{
"catalogItemId": "efd0b233-8f8e-b6b8-b5f3-66903caa8558",
"appId": "f29c9b39-1090-4d9b-8e3a-a3a681a57970"
},
{
"catalogItemId": "58a7ab15-5c65-d836-7934-86f78b17996b",
"appId": "f29c9b39-1090-4d9b-8e3a-a3a681a57970"
},
{
"catalogItemId": "040528a7-7256-7875-c8e4-8976d949f66b",
"appId": "f29c9b39-1090-4d9b-8e3a-a3a681a57970"
},
{
"catalogItemId": "11e2ffb7-2520-3c21-051e-1f05486b9061",
"appId": "f29c9b39-1090-4d9b-8e3a-a3a681a57970"
},
{
"catalogItemId": "e8f9c6d5-4ddd-36dd-f595-fe7bfd7891e2",
"appId": "f29c9b39-1090-4d9b-8e3a-a3a681a57970"
},
{
"catalogItemId": "16694dd9-ab43-7c5b-974e-e15a4297f235",
"appId": "f29c9b39-1090-4d9b-8e3a-a3a681a57970"
},
{
"catalogItemId": "593c5cd0-4996-2a8a-ad34-7669f266c42e",
"appId": "f29c9b39-1090-4d9b-8e3a-a3a681a57970"
},
{
"catalogItemId": "51c819a7-9380-1748-d761-b0bb25d175c2",
"appId": "f29c9b39-1090-4d9b-8e3a-a3a681a57970"
}
],
"algorithm": {
"id": "e33f5e32-d1a2-4944-b38f-d29b7d5ef4ef",
"appId": "72454cb3-90b5-4cef-bbff-cc61aea02584"
}
}
}
There are 2 errors with this status code:
There is 1 error with this status code:
See the entire list and learn more about Wix errors.