# Rss Feed Merger (`eichan/rss-feed-merger`) Actor

- **URL**: https://apify.com/eichan/rss-feed-merger.md
- **Developed by:** [Eichan Jolly](https://apify.com/eichan) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.01 / actor start

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## RSS / Atom Feed Merger & Deduplicator

Combine 2–5 public RSS or Atom feeds into **one newest-first list of unique links**. Each run is a standalone snapshot; schedule it for a fresh dashboard, daily topic roundup, or a no-code export workflow. You do not need a login, API key, or any Python packages.

### Who this is for

News curators, analysts, newsletter editors, and small teams who want one dataset instead of checking several public feeds manually. No feed accounts are accessed; use only feeds that allow your intended use.

### Input — ready to run

```json
{
  "feedUrls": [
    "https://feeds.bbci.co.uk/news/rss.xml",
    "https://feeds.bbci.co.uk/news/world/rss.xml"
  ],
  "maxItems": 20
}
```

Use **2–5 public HTTP(S) RSS/Atom feed addresses**. `maxItems` defaults to **20**, with a range of 1–100. The cap applies to successful, merged entries; there is *one extra error item for every failed feed*. Input feeds are downloaded once per run, using a 12-second timeout per feed and a 1.5 MB response cap. HTTP redirects must stay on public addresses.

### Dataset output

Each successful entry has these consistent fields:

```json
{
  "title": "Example headline",
  "link": "https://news.example.org/article/1",
  "publishedAt": "2026-11-01T09:00:00Z",
  "sourceFeed": "https://feeds.bbci.co.uk/news/rss.xml",
  "summary": "A short plain-text feed summary.",
  "status": "ok",
  "error": null,
  "checkedAt": "2026-11-01T09:05:00Z"
}
```

If one feed fails, its error **does not stop the other feeds**. The dataset includes an additional error row:

```json
{
  "title": null,
  "link": null,
  "publishedAt": null,
  "sourceFeed": "https://example.org/feed.xml",
  "summary": null,
  "status": "error",
  "error": "Feed https://example.org/feed.xml: Download error: the server returned HTTP 404.",
  "checkedAt": "2026-11-01T09:05:00Z"
}
```

`publishedAt` is UTC ISO 8601 when parseable, otherwise `null`. Dates without a timezone are treated as UTC. Entries with missing links are skipped because deduplication requires a link. Duplicates are identified by the resolved link (fragment removed); the entry with the latest parseable publication date is kept. Entries without dates sort last. For ties, earlier input feed wins. `sourceFeed` is the original user-provided feed URL. HTML tags are stripped from summaries, which are limited to 1,200 characters; titles are plain text up to 500 characters. `checkedAt` is the current UTC time of this run.

### Scheduling idea

Schedule hourly for a compact monitoring dataset, or daily before preparing a newsletter. **Each run is independent**; it does not remember already seen entries from previous runs, does not email you, and does not create alerts. A saved external baseline or automation is required for across-run new-item detection.

### Honest limits

- Public XML feeds only. Passing a regular HTML page causes an explicit feed-format error.
- Only RSS `<item>` or Atom `<entry>` items are used; no crawling of linked articles and no full-text scraping.
- Publisher content, availability, rate limits, and reuse permissions vary. Respect publisher terms and avoid overly frequent schedules.
- A malformed or unreachable feed creates an error item, not a Python traceback. If *all* feeds fail, the dataset contains only error items.
- JSON-backed feeds, JavaScript-only feeds, paywalls, logins, private URLs, and authentication are not supported. No external API key is needed.

### Local execution

Python 3.12+; standard library only:

```sh
ACTOR_INPUT_JSON='{"feedUrls":["https://feeds.bbci.co.uk/news/rss.xml","https://feeds.bbci.co.uk/news/world/rss.xml"],"maxItems":20}' python src/main.py
```

Or write input to `storage/key_value_stores/default/INPUT.json` and execute `python src/main.py`. Local results appear as numbered JSON files under `storage/datasets/default/`. On the Apify platform, input is fetched as the `INPUT` record from the default Key-Value Store via REST, and results are appended to the default Dataset via REST, using only Apify-provided run credentials. No Apify SDK is installed.

### Store configuration / pricing proposal

Store categories: **AUTOMATION**, **DEVELOPER_TOOLS** (primary: AUTOMATION). Suggested pricing: **USD $0.006 per run**. Advisory suggestion only; the code does **not** charge for usage or implement billing. `store_metadata.json` contains the same proposal.

### Verification

Run `python -m unittest discover -s tests -p 'test_*.py' -v` and `python tests/smoke_run.py`. Reproducible script-mode smoke tests use a local HTTP fixture to avoid relying on changing live feeds; `tests/smoke_evidence.txt` contains literal subprocess stdout/stderr and a complete produced dataset item. The test-only loopback setting is rejected on the Apify platform. Real public-feed execution and Apify cloud builds require separate deployment verification.

# Actor input Schema

## `feedUrls` (type: `array`):

Supply 2–5 accessible RSS or Atom feed URLs. Prefilled with two BBC feeds.

## `maxItems` (type: `integer`):

Keep at most this many unique feed entries (error items are additional).

## Actor input object example

```json
{
  "feedUrls": [
    "https://feeds.bbci.co.uk/news/rss.xml",
    "https://feeds.bbci.co.uk/news/world/rss.xml"
  ],
  "maxItems": 20
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing the Actor's result items

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "feedUrls": [
        "https://feeds.bbci.co.uk/news/rss.xml",
        "https://feeds.bbci.co.uk/news/world/rss.xml"
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("eichan/rss-feed-merger").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "feedUrls": [
        "https://feeds.bbci.co.uk/news/rss.xml",
        "https://feeds.bbci.co.uk/news/world/rss.xml",
    ],
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("eichan/rss-feed-merger").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "feedUrls": [
    "https://feeds.bbci.co.uk/news/rss.xml",
    "https://feeds.bbci.co.uk/news/world/rss.xml"
  ],
  "maxItems": 20
}' |
apify call eichan/rss-feed-merger --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,eichan/rss-feed-merger"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/svPBY2qeqoyshDm21/builds/dCiC5m6bWld7DOMef/openapi.json
