Recommendations

Recommend Item Segments to User

Recommends the top Segments from a Segmentation for a particular user, based on the user's past interactions.

Based on the used Segmentation, this endpoint can be used for example for:

  • Recommending the top categories for the user
  • Recommending the top genres for the user
  • Recommending the top brands for the user
  • Recommending the top artists for the user

You need to set the used Segmentation the Admin UI in the Scenario settings prior to using this endpoint.

The returned segments are sorted by relevance (first segment being the most relevant).

It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.

post/{databaseId}/recomms/users/{userId}/item-segments/

Path parameters

databaseIdstring required

ID of your database.

userIdstring required

ID of the user for whom personalized recommendations are to be generated.

Request body

countinteger required

Number of item segments to be recommended (N for the top-N recommendation).

scenariostring

Scenario defines a particular application of recommendations. It can be, for example, "homepage", "cart", or "emailing".

You can set various settings to the scenario in the Admin UI. You can also see the performance of each scenario in the Admin UI separately, so you can check how well each application performs.

The AI that optimizes models to get the best results may optimize different scenarios separately or even use different models in each of the scenarios.

cascadeCreateboolean

If the user does not exist in the database, returns a list of non-personalized recommendations and creates the user in the database. This allows, for example, rotations in the following recommendations for that user, as the user will be already known to the system.

filterstring

Boolean-returning ReQL expression which allows you to filter recommended segments based on the segmentationId.

boosterstring

Number-returning ReQL expression which allows you to boost recommendation rate of some segments based on the segmentationId.

expertSettingsobject

Dictionary of custom options.

returnAbGroupboolean

If there is a custom AB-testing running, return the name of the group to which the request belongs.

reqlExpressionsobject

A dictionary of ReQL expressions that will be executed for each recommended Item Segment. This can be used to compute additional properties of the recommended Item Segments.

The keys are the names of the expressions, and the values are the actual ReQL expressions.

Example request:

{
  "reqlExpressions": {
    "countItems": "size(segment_items(\"categories\", 'segmentId'))"
  }
}

Example response:

{
  "recommId": "a7ac55a4-8d6e-4f19-addc-abac4164d8a8",
  "recomms": 
    [
      {
        "id": "category-fantasy-books",
        "reqlEvaluations": {
          "countItems": 486
        }
      },
      {
        "id": "category-sci-fi-costumes",
        "reqlEvaluations": {
          "countItems": 19
        }
      }
    ],
   "numberNextRecommsCalls": 0
}

Response

successful operation

recommIdstring required

Id of the recommendation request

numberNextRecommsCallsinteger

How many times Recommend Next Items have been called for this recommId

abGroupstring

Name of AB-testing group to which the request belongs if there is a custom AB-testing running.

Changes

No recorded changes to this endpoint across all 1 revision of this API.