# Personalized News Feed

> Source: https://docs.recombee.com/recipes/news/homepage/personalized-feed

> For the complete documentation index, see [llms.txt](/llms.txt).

**Table of contents**

* [Introduction](#introduction)
* [Scenario Setup](#scenario-setup)
* [Logic](#logic)
* [Filters](#filters)  
   * [String Property](#string-property)  
   * [Set of Categories](#set-of-categories)
* [Boosters](#boosters)
* [Constraints](#constraints)
* [Requesting Recommendations](#requesting-recommendations)

# Personalized News Feed

![](/img/recipes/news/personalized-feed.png) 

## Introduction

The **Personalized News Feed** is a key feature of many modern news platforms, offering a continuous stream of articles tailored to each user's unique interests and preferences. The feed can serve as the main homepage of the app or website or complement other sections, such as the **[Homepage Top Stories Section](/recipes/news/homepage/top-stories)** or editorial content.

This recipe will guide you in setting up a personalized feed that dynamically loads relevant articles as the user scrolls, creating a seamless and engaging reading experience.

## Scenario Setup

In the Recombee Admin UI, navigate to the **[Scenarios](/scenarios)** section and select **Create Scenario**.

1. Enter a **Scenario ID**, such as _"personalized-feed"_.
2. Choose the **Recommendation type** \- _[Items to User](/api#recommend-items-to-user)_.

![Admin UI - Scenario Setup](/img/recipes/news/personalized-feed-create-scenario.png)

## Logic

The **[Logic](/recommendation_logics)** determines the behavior of the recommendation engine.

* Select the **[news:personal](/recommendation_logics#news-personal)** logic type from the **News** models. This logic delivers highly personalized recommendations based on each user's behavior and preferences.

![Admin UI - Logic](/img/recipes/news/personalized-feed-logic.png)

## Filters

You can apply [Filters](scenarios#filters) to fine-tune the recommendations in your feed. Below are examples of filters you might find useful.

Recent News Filter

To ensure the articles in the feed are fresh, you can restrict the recommendations to articles published within a certain timeframe (e.g., the last 3 days):

1. Navigate to the **[Filters](/scenarios#filters)** tab and **Add first filter**.
2. Find _Recent items_, and click **+**.
3. Specify the **property** in your item catalog that represents the **publish date**.
4. Define the maximum age of articles (e.g., 3 days).

![Admin UI - Filter - Recent Items](/img/recipes/news/recent-items-filter.png)

Excluding Articles From Other Boxes

If the homepage includes other content sections that are not powered by Recombee, such as editor-picked articles, and you want to exclude these from the recommended feed, you can do so dynamically using the **[filter parameter](/api#recommend-items-to-user-param-filter)** in the **[API request](/api#recommend-items-to-user)**.

For example, if you want to exclude articles with the IDs `article-42`, `article-77`, and `article-92`, you can use the following filter:

ReQL

```
'itemId' not in {"article-42", "article-77", "article-92"}
```

Tip: Category-Specific Feed

Personalized feeds can also be applied to category pages. For example, if the user navigates to the "Sports" category, only articles related to sports should be displayed in the feed.

Since the selected category is dynamic, you should send the category filter as part of the **[filter parameter](/api#recommend-items-to-user-param-filter)** in the **[API request](/api#recommend-items-to-user)**.

Depending on how you model the category/categories in your catalog, the filter (ReQL expression) may look like this:

##### String Property

ReQL

```
'category' == "<the particular category>"

'category' == "sport"
```

##### Set of Categories

ReQL

```
"<the particular category>" in 'categories'

"sport" in 'categories'
```

**Alternative Implementation:**

As an alternative to using a filter, you can utilize the **[Recommend Items to Item Segment endpoint](/api#recommend-items-to-item-segment)** for a specific category (= **[Item Segment](/segmentations)**). In this case, you don't need to provide a dynamic filter, as it is inferred from the given Item Segment.

To load subsequent articles when the user scrolls, use the **[Recommend Next Items endpoint](/api#recommend-next-items)** in the same way as with _Recommend Items to User_.

## Boosters

[Boosters](/scenarios#boosters) allow you to influence the recommendation engine to prioritize certain types of content. For example, you can boost promoted content or articles handpicked by editors to give them higher visibility.

Tip: Boost Editor's Picks

If editors mark certain articles as preferred, and this information is exported to the Items catalog as a property, you can set up a Booster to increase the visibility of these articles.

1. Navigate to the **[Boosters](/scenarios#boosters)** tab and **Add first booster**.
2. Find _Boost editors' picks_ and click **+**.
3. Specify the **property** in your item catalog that identifies **the picked articles** (the property should have a value of _true_ for these articles).
4. Use the _Preview_ tool to adjust the **Boosting coefficient** slider and find the optimal level of boosting for these articles.

![Admin UI - Booster - Editor's Picks](/img/recipes/news/editors-picks-boosters.png)

## Constraints

Using **[Constraints](/scenarios#constraints)**, you can enforce rules to maintain a certain level of diversity within the recommended content. For example, you can ensure that the personalized feed includes articles on various topics or categories.

Topics Diversity Constraint

If you want the personalized feed to always display articles from multiple topics or categories, follow these steps:

1. Navigate to the **[Constraints](/scenarios#constraints)** tab and **Create Constraint**.
2. Select the **[Segmentation](/segmentations)** that represents the topics or categories. If you don't have such Item Segmentation created yet, click the **Create** button and define the Segmentation by selecting the item property that contains the topic/category information.
3. Choose the **Limit Type**:  
   * **Absolute**: Specify a fixed limit (e.g., allow at most 3 articles from a single topic per request).  
   * **Relative**: Specify a percentage limit (e.g., ensure no more than 50% of the recommendations are from one topic).

![Admin UI - Constraints](/img/recipes/news/personalized-feed-constraints.png)

## Requesting Recommendations

There are three ways to integrate the Personalized News Feed.

1. **[No-Code Widget](/no-code-widgets)** – create a No-Code Widget using the **visual editor in the Admin UI** to embed an infinite scrolling news feed without writing code.
2. **[Widget SDKs](/widget-sdks#feed)** – use the [Feed](/widget-sdks#feed) component of the Widget SDKs to build a personalized scrolling experience. The widget is initialized using the [Recommend Items to User](/api#recommend-items-to-user) endpoint and automatically handles fetching more articles on scroll / clicking the _Show More_ button.
3. **[API SDK](/api_clients)** – implement the feed manually using the API:  
   * **[Recommend Items to User](/api#recommend-items-to-user)** – retrieves the initial set of articles for the feed.  
   * The response includes a unique `recommId` (e.g., _3f6ad2f2-a3f1-4ba1-a690-f4f01f76d4eb_).  
   * **[Recommend Next Items](/api#recommend-next-items)** – use this endpoint with the `recommId` to load additional articles as the user scrolls.

![Infinite Feed Handling using Recommend Next Items](/img/recipes/news/infinite-feed-next-recomms.png)

For more details, visit the **Integration** tab in the scenario configuration within the Admin UI.