Skip to content

Recommendations

Example showing how to get personalized item recommendations for a user.

This example assumes using Recombee; is in scope and apiKey contains your Recombee API key.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
// Create an authenticated client
using var client = new RecombeeClient(apiKey);
var databaseId = GetDatabaseId();

// Get personalized recommendations for a user
var response = await client.Recommendations.CreateByDatabaseIdRecommsUsersByUserIdItemsAsync(
    databaseId: databaseId,
    userId: "test-user-1",
    count: 5,
    cascadeCreate: true,
    returnProperties: true);

// The response contains a recommendation ID and list of recommended items