The User-Based algorithm recommends items by finding users similar to the current user. It generates recommendations based on user behavior and product popularity.
In this algorithm, product recommendations are based on the behavior of similar users (users with similar index scores who have viewed, purchased, or added the same or similar category products to their cart) to the current user. The algorithm recommends products that similar users have encountered in the past but that the current user has not visited. The user-based algorithm also takes the user-product-rating matrix as another input. For each product a user visits, the algorithm calculates a rating based on the number of visits, purchases, and add-to-carts within the last 30 days. This algorithm can be used on any page.
Closely related items
Set coherent=true to build each user's recommendations from their strongest interest: the category or brand that dominates their recommended items. Products outside this interest are removed and replaced with top sellers from the same category or brand, so the response stays focused on one interest. Result quality depends on how complete your catalog attributes are, such as category and brand.
Endpoint
Visit our Postman collection to test this request.
Query Parameters
Parameter | Sample Value | Description | Data Type | Required |
|---|---|---|---|---|
partnerName | mybrand | Partner Identifier assigned by Insider One. You can use PartnerID as well. | String | Yes |
locale | us_US | Locale of requested product catalog | String | Yes |
platform | web | Requested platform. Web comes by default. | Enum | No |
userId | a1b2c3d4 | User identifier that is assigned by Insider One | String | Yes |
currency | USD | Requested currency of the products. If no value is set, the default currency in your settings is used. | String | No |
size | 50 | Required number of items in response. Valid values are 0 to 100. | Integer | No |
categoryList | [“Clothes”, “Skirts”] | Category filter of the products | Array (of string) | No |
filter | Smart Recommender filtering. There can be more than one filter parameter. | String | No | |
details | true | Adds details to the products of the response | Boolean | No |
shuffle | false | Shuffles the products of the response | Boolean | No |
coherent | true | Builds the recommendations from the user's strongest interest (the dominant category or brand) and replaces products outside it with top sellers from the same category or brand. Accepts true or false; the default is false. | Boolean | No |
getGroupProducts | false | Shows variant products under the products of the response | Boolean | No |
groupProductsFields | Adds these fields to the variant products’ details | String | No | |
excludeVariants | true | Exclude variants from the response | Boolean | No |
excludeViewDay | 30 | After how many days should viewed products be excluded | Integer | No (Can be used only with userId) |
excludeViewItem | 100 | How many viewed products should be excluded | Integer | No (Can be used only with userId) |
excludePurchaseDay | 30 | After how many days should purchased products be excluded | Integer | No (Can be used only with userId) |
excludePurchaseItem | 100 | How many purchased products should be excluded | Integer | No (Can be used only with userId) |
hp | false | Makes affinities affect products of the response | Boolean | No |
dayLimit | 2 | If FMT is published_time, it adds a day limit filter | Integer | No |
productId | ABC123CBA | Current product ID | String | No |
Sample Request
The sample below displays a request to User Based, a personalized recommendation algorithm that finds users similar to the current user.
https://recommendation.api.useinsider.com/v2/user-based?partnerName={Partner_Name}&locale={Locale}¤cy=TRY&userId={User ID}The sample below requests closely related items for the same user:
https://recommendation.api.useinsider.com/v2/user-based?partnerName={Partner_Name}&locale={Locale}¤cy=TRY&userId={User ID}&coherent=trueSample Response
{
"success": true,
"total": 10,
"types": {
"mvop": 10
},
"data": [
"QAZ-7890",
"XYZ-1234",
"QAZ-7899",
"XYZ-1233",
"QAZ-7898",
"XYZ-1243",
"QAZ-7891",
"XYZ-1223",
"QAZ-7892",
"XYZ-1342"
]
}Fallback Algorithms
If the products from User Based are not enough to fill the response data, some fallback algorithms below fill it:
View-to-view of the last visited product
Most viewed of the category
Most viewed of the category without excluding the right-most item in the categoryList
Most viewed of the Partner
When you request recommendations through a saved recommendation strategy, the strategy's Recommend Closely Related Items setting applies. The coherent parameter is for direct User-Based requests.