# Rss Keyword Filter (`eichan/rss-keyword-filter`) Actor

- **URL**: https://apify.com/eichan/rss-keyword-filter.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 Keyword Filter

**Small scheduled job:** Check up to five public RSS or Atom feeds, and save only articles containing your search terms in the **title** or **plain-text summary**. Results are merged, deduplicated by article link, sorted newest-first (undated entries last), and capped.

### Who is it for?

News monitoring, topic research, company-watch digests, and scheduled feed filtering without a login or scraping framework. Use an Apify schedule to get a new dataset for each run.

### Example input

The Store form starts with a working public BBC News RSS URL and deliberately broad sample terms to show matching results. Change these words to your topic for useful monitoring.

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

`feedUrls` accepts **1–5** RSS/Atom HTTP(S) URLs. `keywords` accepts **1–20** nonempty strings (100 characters maximum each); matching is case-insensitive substrings, including inside words. `maxItems` defaults to 20, with a maximum of 100. Duplicate keywords (ignoring letter case) are collapsed.

### Example output: one matching article

This is an illustrative record showing the schema, not a claim about the current live BBC feed.

```json
{
  "title": "The Moon and its next exploration mission",
  "link": "https://example.org/article/moon",
  "publishedAt": "2026-11-01T09:30:00Z",
  "sourceFeed": "https://feeds.bbci.co.uk/news/rss.xml",
  "summary": "The team describes its launch and mission goals.",
  "matchedKeywords": ["the", "and"],
  "status": "ok",
  "error": null,
  "checkedAt": "2026-11-01T09:31:00Z"
}
```

If a feed fails, **one error row per failed feed** is written with `sourceFeed`, `status: "error"`, a readable `error` message, `matchedKeywords: []`, and null article fields. Good feeds still contribute matches. Failed-feed error items are **additional** to `maxItems`. **Zero matches is successful:** no rows are added for a valid feed with no matches.

### Running locally

No install needed beyond Python 3.12+ (3.12 is used in the Dockerfile):

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

Results appear in `./storage/datasets/default/000000001.json`, etc. For a local file input instead of the environment variable, create `./storage/key_value_stores/default/INPUT.json`.

On Apify, the Actor reads `INPUT` via **GET** `https://api.apify.com/v2/key-value-stores/{APIFY_DEFAULT_KEY_VALUE_STORE_ID}/records/INPUT` using its run-scoped `APIFY_TOKEN`, and writes result rows to its default dataset through the Apify REST API. Explicit `ACTOR_INPUT_JSON` takes priority, even on Apify. No Apify SDK, extra dependency, account on source sites, or third-party API key is required.

### Limits & honest behavior

- Only **public**, directly accessible feeds are supported. Local/private addresses and URLs with embedded credentials are rejected; safe redirects are allowed. Feeds requiring authentication or rendered JavaScript are unsupported.
- Downloads are capped at 1.5 MB/feed and time out after 12 seconds. For politeness, each feed is fetched once, sequentially. Only the first 300 articles per feed are examined.
- HTML pages passed as feed URLs are reported explicitly as HTML, not RSS/Atom. Malformed HTTP, missing DNS, invalid XML, and HTTP errors use readable per-feed error rows, not tracebacks.
- Summary HTML is reduced to plain text (up to 2,000 characters); titles are limited to 500 characters. The Actor does not open article pages.
- Dates are UTC ISO 8601 or `null` if the feed's supplied date cannot be parsed. Undated articles sort last; duplicates are resolved by retaining the newest supplied date.
- These are current matching articles, **not new-since-previous-run alerts**. This Actor has no persistent state or notifications. A successful run with no matches saves zero items.

### Scheduled use case

Schedule the Actor every morning with `keywords: ["climate", "energy"]`. Consume that run's dataset in your automation. Treat each run as a new snapshot; use downstream storage if you need cross-run change alerts.

### Store information

**Category:** Automation (`AUTOMATION`), Developer Tools (`DEVELOPER_TOOLS`). **Suggested pricing:** `$0.006 per run` (advisory only; billing is not configured). The RSS content remains subject to each publisher's terms and attribution requirements.

# Actor input Schema

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

One to five public RSS/Atom feed addresses. The example uses a BBC News feed.

## `keywords` (type: `array`):

One to twenty case-insensitive words or phrases searched in titles and plain-text summaries. Example words are common enough to demonstrate matches.

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

Limit the number of unique matching articles; error rows are additional.

## Actor input object example

```json
{
  "feedUrls": [
    "https://feeds.bbci.co.uk/news/rss.xml"
  ],
  "keywords": [
    "the",
    "and"
  ],
  "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"
    ],
    "keywords": [
        "the",
        "and"
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("eichan/rss-keyword-filter").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"],
    "keywords": [
        "the",
        "and",
    ],
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("eichan/rss-keyword-filter").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"
  ],
  "keywords": [
    "the",
    "and"
  ],
  "maxItems": 20
}' |
apify call eichan/rss-keyword-filter --silent --output-dataset

```

## MCP server setup

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

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/ybNVmMzALkmclFrou/builds/N0BuXaJfAGMt6X935/openapi.json
