Recommendations

Recommend Users to User

Gets users similar to the given user, based on the user's past interactions (purchases, ratings, etc.) and values of properties.

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

The returned users are sorted by similarity (the first user being the most similar).

post/{databaseId}/recomms/users/{userId}/users/

Path parameters

databaseIdstring required

ID of your database.

userIdstring required

User to whom we find similar users

Request body

countinteger required

Number of users 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.

returnPropertiesboolean

With returnProperties=true, property values of the recommended users are returned along with their IDs in a JSON dictionary. The acquired property values can be used to easily display the recommended users.

Example response:

  {
    "recommId": "9cb9c55d-50ba-4478-84fd-ab456136156e",
    "recomms": 
      [
        {
          "id": "user-17",
          "values": {
            "country": "US",
            "sex": "F"
          }
        },
        {
          "id": "user-2",
          "values": {
            "country": "CAN",
            "sex": "M"
          }
        }
      ],
    "numberNextRecommsCalls": 0
  }
includedPropertiesstring[]

Allows specifying which properties should be returned when returnProperties=true is set. The properties are given as a comma-separated list.

Example response for includedProperties=country:

  {
    "recommId": "b326d82d-5d57-4b45-b362-c9d6f0895855",
    "recomms":
      [
        {
          "id": "user-17",
          "values": {
            "country": "US"
          }
        },
        {
          "id": "user-2",
          "values": {
            "country": "CAN"
          }
        }
      ],
    "numberNextRecommsCalls": 0
  }
filterstring

Boolean-returning ReQL expression, which allows you to filter recommended users based on the values of their attributes.

Filters can also be assigned to a scenario in the Admin UI.

boosterstring

Number-returning ReQL expression, which allows you to boost the recommendation rate of some users based on the values of their attributes.

Boosters can also be assigned to a scenario in the Admin UI.

reqlExpressionsobject

A dictionary of ReQL expressions that will be executed for each recommended user. This can be used to compute additional properties of the recommended users that are not stored in the database.

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

Example request:

{
  "reqlExpressions": {
    "isInUsersCity": "context_user[\"city\"] in 'cities'",
    "distanceToUser": "earth_distance('location', context_user[\"location\"])"
  }
}

Example response:

{
  "recommId": "ce52ada4-e4d9-4885-943c-407db2dee837",
  "recomms": 
    [
      {
        "id": "restaurant-178",
        "reqlEvaluations": {
          "isInUsersCity": true,
          "distanceToUser": 5200.2
        }
      },
      {
        "id": "bar-42",
        "reqlEvaluations": {
          "isInUsersCity": false,
          "distanceToUser": 2516.0
        }
      }
    ],
   "numberNextRecommsCalls": 0
}
diversitynumber double

Expert option: Real number from [0.0, 1.0], which determines how mutually dissimilar the recommended users should be. The default value is 0.0, i.e., no diversification. Value 1.0 means maximal diversification.

minRelevance'low' | 'medium' | 'high'

Expert option: Specifies the threshold of how relevant must the recommended users be. Possible values one of: "low", "medium", "high".

rotationRatenumber double

Expert option: If your users browse the system in real-time, it may easily happen that you wish to offer them recommendations multiple times. Here comes the question: how much should the recommendations change? Should they remain the same, or should they rotate? Recombee API allows you to control this per request in a backward fashion. You may penalize a user for being recommended in the near past. For the specific user, rotationRate=1 means maximal rotation, rotationRate=0 means absolutely no rotation. You may also use, for example, rotationRate=0.2 for only slight rotation of recommended users.

rotationTimenumber double

Expert option: Taking rotationRate into account, specifies how long it takes for a user to recover from the penalization. For example, rotationTime=7200.0 means that users recommended less than 2 hours ago are penalized.

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.

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.