# RSS Feed API - RSS, Atom, RDF & JSON Feed to JSON (`stas_k/rss-feed-api`) Actor

Your reader goes blind on half the feeds: JSON Feed, RDF and podcast enclosures come back empty. This actor parses RSS 2.0, Atom, RSS 1.0 and JSON Feed into one schema: title, link, author, ISO date, categories, media and items. A 404, a 304 and an empty feed cost nothing.

- **URL**: https://apify.com/stas_k/rss-feed-api.md
- **Developed by:** [Stas K](https://apify.com/stas_k) (community)
- **Categories:** Developer tools, Automation, AI
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.50 / 1,000 feeds

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 Feed API: RSS, Atom, RDF and JSON Feed into one JSON schema

Most feed readers are written for RSS 2.0 and quietly lose the rest: Atom entries come back
without a date, RSS 1.0 (RDF) comes back empty, JSON Feed is not read at all, and a podcast
audio enclosure is dropped. This actor reads all four dialects and returns the same fields for
every one of them, so a monitoring job does not need a special case per publisher.

### What you get

One dataset row per feed that was really parsed:

| field | meaning |
|---|---|
| `feedUrl`, `finalUrl`, `feedType` | the address you sent, the address that really answered after redirects, and the dialect found: `rss2`, `atom`, `rdf` or `json` |
| `feedTitle`, `siteUrl`, `contentType`, `httpStatus` | what the feed says about itself |
| `itemsInFeed`, `itemsReturned`, `itemsCutByLimit`, `maxItemsPerFeed` | how many entries the feed carried and how many were returned |
| `etag`, `lastModified` | what the source sent, so you can skip unchanged feeds yourself |
| `items` | the entries, each with `itemKey`, `guid`, `title`, `link`, `author`, `publishedAt`, `updatedAt`, `summary`, `contentHtml`, `categories`, `imageUrl`, `enclosureUrl`, `enclosureType`, `enclosureLength` |
| `fetchedAt` | when the feed was read |

Every date is ISO 8601 in UTC, whatever the feed wrote (`RFC 822`, `ISO 8601`, `dc:date`).
`itemKey` is a stable hash of the entry guid or id, then of its link, so the same post keeps
the same key between runs and a rewritten title does not turn one entry into two.

### What is free, and why

A request is not a delivery. These come back as free status rows with a plain reason and are
never charged:

- `NOT_FOUND`: the address answers 404 or 410, so it carries no feed.
- `NOT_MODIFIED`: the feed answers 304 Not Modified, so there is nothing new to deliver.
- `EMPTY`: the feed parsed but carried no entries.
- `INVALID_INPUT`: not an `http(s)` address, a private host, a loopback address, or an address
  with credentials.
- `NOT_CHECKED_ERROR`: the host does not resolve right now, could not be reached, refused the
  reader, or the document is not a feed (a site page instead of a feed is named as such). A
  host that does not resolve is the state of the source, not a mistake in your address, so it
  is named that way.
- `NOT_CHECKED_CAP`, `NOT_CHECKED_TIME`: the run hit `maxFeeds` or its time budget.
- `DUPLICATE`: the same feed was already paid for earlier in the same run. Identity is the
  address that really answered: the same feed written with a trailing fragment, a different
  letter case in the host, `http` instead of `https`, or a short link that redirects to it,
  is one document and one sale.

### Price

Pay per event: `Feed`. One parsed feed that carries entries is one event, whatever the number
of entries inside it (up to `maxItemsPerFeed`). Free rows above cost nothing.

### Input

- `feeds`: feed addresses, one per line.
- `maxItemsPerFeed`: how many entries one feed may return, 1 to 500, default 50. A feed with
  more entries is cut at this number and the row says `itemsCutByLimit: true`.
- `maxFeeds`: how many addresses the run reads, 1 to 200, default 25. A run that sends 30
  addresses without this field reads 25 and names the other five free `NOT_CHECKED_CAP`.

### What this actor does not do

- It does not guess a feed from a site address. A page that is not a feed is refused with a
  reason instead of being searched for a `<link rel="alternate">` tag.
- It does not follow a feed into full articles: `contentHtml` is what the feed itself carries.
- It does not store history between runs. Send the same feed again and you get the current
  entries, not a diff; use `itemKey` to deduplicate on your side.
- It does not read private feeds: credentials in the address are refused, and a host that
  resolves to a private address is refused before any request. Redirects are followed by
  hand, at most three, and every hop passes that same check, so a public link cannot walk
  the reader into `127.0.0.1` or a private network. The hop that fails is free and named.

### Politeness and limits

One request per feed (a redirect hop is one more request), `User-Agent: apify-rss-feed-api/0.1`.
One retry on `429`, `500`, `502`, `503` and `504`. A `429` is retried after the source's
`Retry-After` (seconds or an HTTP date, at most 10 s and never more than half of the remaining
budget); without the header the pause is 2 s. A second failure becomes a free
`NOT_CHECKED_ERROR` row. Memory 256 MB is
enough: the actor parses text and never renders a page. A feed of 500 entries is trimmed to
`maxItemsPerFeed`, so a runaway feed cannot blow up the run.

# Actor input Schema

## `feeds` (type: `array`):

Feed addresses, one per line: RSS 2.0, Atom, RSS 1.0 (RDF) or JSON Feed. The address has to be the feed itself, not the site page: a site page is refused with a reason and costs nothing. The last line of the default list is a site page, so it comes back free.

## `maxItemsPerFeed` (type: `integer`):

How many entries one feed may return, newest first as the feed orders them. A feed with more entries is cut at this number and the row says itemsCutByLimit true, so the cut is visible and never silent.

## `maxFeeds` (type: `integer`):

How many addresses this run reads. Lines beyond the number come back as free NOT_CHECKED_CAP rows with a reason.

## Actor input object example

```json
{
  "feeds": [
    "https://news.ycombinator.com/rss",
    "https://www.theverge.com/rss/index.xml",
    "https://slashdot.org/slashdot.rdf",
    "https://daringfireball.net/feeds/json",
    "https://example.com"
  ],
  "maxItemsPerFeed": 50,
  "maxFeeds": 25
}
```

# Actor output Schema

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

One row per feed. A paid row carries feedUrl (what you sent), finalUrl (what really answered after at most three checked redirects), feedType (rss2, atom, rdf or json), feedTitle, siteUrl, httpStatus, itemsInFeed, itemsReturned, itemsCutByLimit, maxItemsPerFeed, etag, lastModified, contentType, fetchedAt (when the feed was read, ISO 8601 UTC) and items: a list where every entry has itemKey, guid, title, link, author, publishedAt, updatedAt, summary, contentHtml, categories, imageUrl, enclosureUrl, enclosureType and enclosureLength. Dates are ISO 8601 in UTC. A feed that answers 404, 304, an empty body or an unreadable document is never a paid row: it comes back as a free NOT_FOUND, NOT_MODIFIED, EMPTY or NOT_CHECKED\_\* row with a reason and no items. Status rows are written in batches, so sort by actorIndex to get the input order back. A value the feed does not publish is an empty string or null, never invented.

## `summary` (type: `string`):

Counters of the run: requested, attempted, delivered, rowsWritten, chargedEvents, itemsDelivered, deliveredUncharged, deliveredUnverified, chargeUncertain, writeErrors, cappedNotCharged, feedsNotFound, feedsNotModified, feedsEmpty, feedsInvalid, feedsDuplicate, feedsCutByItemCap, cutByDeadline, cutByStop, cutByLimit, byStatus, counterMismatch, stopReason, datasetNote, firstFailure, billingActive, priceNote, eventName, maxItemsPerFeed, maxFeeds, source, startedAt, finishedAt and runId. The bare RUN_SUMMARY lives in the default store of the run; a copy under RUN_SUMMARY-<runId> is kept in the named store rss-feed-summary, so two runs do not overwrite each other.

# 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 = {
    "feeds": [
        "https://news.ycombinator.com/rss",
        "https://www.theverge.com/rss/index.xml",
        "https://slashdot.org/slashdot.rdf",
        "https://daringfireball.net/feeds/json",
        "https://example.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("stas_k/rss-feed-api").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 = { "feeds": [
        "https://news.ycombinator.com/rss",
        "https://www.theverge.com/rss/index.xml",
        "https://slashdot.org/slashdot.rdf",
        "https://daringfireball.net/feeds/json",
        "https://example.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("stas_k/rss-feed-api").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 '{
  "feeds": [
    "https://news.ycombinator.com/rss",
    "https://www.theverge.com/rss/index.xml",
    "https://slashdot.org/slashdot.rdf",
    "https://daringfireball.net/feeds/json",
    "https://example.com"
  ]
}' |
apify call stas_k/rss-feed-api --silent --output-dataset

```

## MCP server setup

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

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/Pu2XdjqfDkRXmUAaO/builds/2mp8AN9TpxmpvVXfg/openapi.json
