Interactions Listing

Note

These functions are not enabled by default due to higher resource consumption. Contact support@recombee.com if you need to enable them, and please specify the types of interactions needed in your request.

NameDescriptionExample
user_interactions

Returns list of interactions by a particular user

user_interactions(context_user["userId"], {"purchases"})

Returns a list of interactions by a particular user.

These interactions are of given interaction_types and are ordered by timestamp from the oldest to the most recent.

Each interaction is a dictionary with the following fields:

{
  "userId": string,
  "itemId": string,
  "timestamp": timestamp,
  "type": string
}
user_interactions(user_id, interaction_types, num_interactions)
ArgumentTypeMeaning

user_id

string

Id of a user

interaction_types

set

Interaction types that should be returned

num_interactions

Non negative integer

Optional. Return only that number of latest interactions.

// Get IDs of items that the user purchased or viewed
map(lambda 'it': 'it'["itemId"], user_interactions(context_user["userId"], {"detail_views", "purchases"}))


// Returns true if the user consumed some content in French
exists(lambda 'it': item_values('it'["itemId"])["language"] == "FR",
			user_interactions(context_user["userId"], {"purchases"}))
© Copyright 2026, Recombee s.r.o
docs.recombee.com