# RSS, Atom & Substack to Clean Markdown for RAG (`sequined_lacework/rss-article-markdown`) Actor

Turn RSS, Atom and Substack feeds into clean Markdown articles with metadata and optional RAG chunks. Fetches the full article when the feed only has a teaser, keeps code blocks. No browser, pay per article.

- **URL**: https://apify.com/sequined_lacework/rss-article-markdown.md
- **Developed by:** [Egor Kramskoy](https://apify.com/sequined_lacework) (community)
- **Categories:** AI, News
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 articles processed

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/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 & Substack to Clean Markdown for RAG

**RSS to Markdown** converter for AI pipelines. Give it RSS, Atom or Substack feed URLs and get one clean Markdown document per article, with title, author, date, source URL, word count, token estimate and optional RAG-ready chunks. When a feed only publishes teasers, the Actor downloads the article page and extracts the full text. Code blocks are preserved. No browser, no JavaScript rendering, pay per article.

Use it as a **Substack scraper for RAG**, an **Atom feed to Markdown** converter, or to turn any **blog into an LLM dataset**.

### What it does

- Reads RSS 2.0, Atom 1.0 and RSS 1.0 (RDF) feeds, including Substack (`https://<name>.substack.com/feed`).
- Uses the full content from the feed (`content:encoded`, Atom `content`) when it is complete.
- Fetches the article page when the feed has only a short teaser or a "Read more" excerpt, and extracts the main text (navigation, sidebars and footers are removed).
- Keeps code blocks as fenced Markdown with the language tag, including blocks from MkDocs, Docusaurus, Pygments and Starlight pages.
- Falls back to the feed text if the page cannot be downloaded, so you still get the article.
- Splits Markdown into overlapping chunks for vector databases when `chunkSize` is set.

### Input

```json
{
    "feedUrls": ["https://blog.python.org/feeds/posts/default?alt=rss"],
    "maxArticlesPerFeed": 3,
    "fetchFullArticle": true,
    "chunkSize": 0,
    "chunkOverlap": 200,
    "maxConcurrency": 5
}
```

| Field | Default | Description |
| --- | --- | --- |
| `feedUrls` | Python blog feed | RSS, Atom or Substack feed URLs |
| `maxArticlesPerFeed` | 20 | Newest N articles per feed (1-500) |
| `fetchFullArticle` | true | Download the article page when the feed has only a teaser |
| `chunkSize` | 0 | Characters per chunk; 0 disables chunking (max 16000) |
| `chunkOverlap` | 200 | Overlap between chunks |
| `maxConcurrency` | 5 | Parallel article downloads (1-20) |

### Output

One dataset item per article:

```json
{
    "feed_title": "Python Insider",
    "feed_url": "https://blog.python.org/feeds/posts/default?alt=rss",
    "article_title": "Python 3.13.0 is now available",
    "article_url": "https://blog.python.org/2024/10/python-3130-final-released.html",
    "author": "Thomas Wouters",
    "published_at": "2024-10-07T16:00:00Z",
    "markdown": "# Python 3.13.0 is now available\n\n**Author:** Thomas Wouters\n**Published:** 2024-10-07T16:00:00Z\n**Source:** https://blog.python.org/...\n\nThe newest release of Python ...",
    "chunks": [],
    "word_count": 640,
    "estimated_tokens": 910,
    "status": "ok",
    "error_message": null
}
```

A feed that cannot be downloaded or parsed produces one item with `status: "error"` and an `error_message`. Errors are not charged per article.

### Pricing

Pay per event: **$0.02 per run** (`run-started`) plus **$0.002 per article** (`article-processed`), charged only for articles converted successfully. Prices are set in Apify Console and may change.

### Limits

- No JavaScript rendering: pages that build their content in the browser may return little or no text.
- Paywalled or members-only articles return only the public teaser.
- Respect the publishers' terms of service and robots rules; use the data in line with the license of the content.
- Page downloads are limited to 10 MB, feeds to 20 MB.

### Use with Claude Desktop / Cursor (MCP)

Connect the Actor to any MCP client through the Apify MCP server: https://mcp.apify.com/?actors=sequined_lacework/rss-article-markdown

Add this to your Claude Desktop or Cursor MCP config (`mcpServers`):

```json
{
    "mcpServers": {
        "apify": {
            "url": "https://mcp.apify.com/?actors=sequined_lacework/rss-article-markdown",
            "headers": {
                "Authorization": "Bearer <YOUR_APIFY_TOKEN>"
            }
        }
    }
}
```

An AI agent can pass a blog, Atom or Substack feed URL and get full articles as clean Markdown, even when the feed only contains teasers, for example to monitor a newsletter or research a topic.

### Integrations: n8n and LangChain

#### n8n

Use the **Apify** node (operation: Run Actor, then Get Dataset Items) with the Actor ID `sequined_lacework/rss-article-markdown`, or an **HTTP Request** node (method `POST`, body type JSON) pointing at the synchronous endpoint, which returns the dataset items directly:

```
https://api.apify.com/v2/acts/sequined_lacework~rss-article-markdown/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>
```

Body:

```json
{
    "feedUrls": ["https://example.substack.com/feed"],
    "maxArticlesPerFeed": 10,
    "fetchFullArticle": true
}
```

Synchronous runs time out after 300 seconds, so use the regular run endpoint for large inputs.

#### LangChain (Python)

Install `langchain-apify` and `langchain-core`, and set the `APIFY_API_TOKEN` environment variable. The Markdown is in the `markdown` field and becomes the document `page_content`.

```python
from langchain_apify import ApifyWrapper
from langchain_core.documents import Document

apify = ApifyWrapper()
loader = apify.call_actor(
    actor_id="sequined_lacework/rss-article-markdown",
    run_input={"feedUrls": ["https://example.substack.com/feed"], "maxArticlesPerFeed": 10},
    dataset_mapping_function=lambda item: Document(
        page_content=item["markdown"] or "",
        metadata={"source": item["article_url"], "title": item["article_title"], "author": item["author"]},
    ),
)
docs = [d for d in loader.load() if d.page_content]
```

To load an existing run instead, use `ApifyDatasetLoader(dataset_id="<DATASET_ID>", dataset_mapping_function=...)` from `langchain_apify` with the same mapping function. If you set `chunkSize`, the `chunks` field already holds ready-to-embed pieces, so no extra text splitter is needed.

### Free plan limits

On the free Apify plan the Actor runs in demo mode:

- At most **10 articles** per run in total, across all feeds (the lower of 10 and `maxArticlesPerFeed` per feed).
- Remaining articles and feeds are skipped and not charged.

The run never fails because of these limits, and the log and status message say when something was skipped. Upgrade to a paid Apify plan to process the full input.

### FAQ

**How do I scrape a Substack newsletter?** Use `https://<name>.substack.com/feed`. Free posts come with full text in the feed; paid posts contain only the teaser.

**Does it work with Atom feeds?** Yes, RSS 2.0, Atom and RSS 1.0 are supported.

**Why is an article short?** The feed had only a teaser and the page could not be fetched, or the page is paywalled or rendered by JavaScript. The `error_message` field explains page download problems.

**Are code blocks kept?** Yes, as fenced blocks with a language tag when the page declares one.

**Can I get chunks for a vector database?** Set `chunkSize` (for example 1000) and `chunkOverlap`; chunks break at paragraph and sentence boundaries.

### Related Actors for RAG Pipelines

Build a complete RAG ingestion pipeline with the same clean Markdown output, chunking options and pay-per-event pricing:

- [PDF to Markdown for RAG & LLM](https://apify.com/sequined_lacework/pdf-to-markdown-rag): PDFs (arXiv, Google Drive, any URL) with tables preserved
- [Website & Sitemap to Markdown for RAG & LLM](https://apify.com/sequined_lacework/website-to-markdown-rag): docs sites, blogs and sitemaps, code blocks preserved
- [Podcast RSS & Transcript Extractor for AI/RAG](https://apify.com/sequined_lacework/podcast-transcript-rag): podcast episodes with publisher transcripts
- [GitHub Repository to Clean Markdown for LLM & RAG](https://apify.com/sequined_lacework/github-repo-to-markdown): whole codebases as one Markdown context with a file tree
- [RSS, Atom & Substack to Clean Markdown for RAG](https://apify.com/sequined_lacework/rss-article-markdown) *(this Actor)*: blogs and newsletters, full articles from teaser feeds

# Actor input Schema

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

RSS, Atom or Substack feed URLs (for Substack use https://<name>.substack.com/feed).

## `maxArticlesPerFeed` (type: `integer`):

How many of the newest articles to process for each feed (in feed order).

## `fetchFullArticle` (type: `boolean`):

When the feed only has a teaser, download the article page and extract the full text. Turn off to use only what the feed contains.

## `chunkSize` (type: `integer`):

If greater than 0, the article Markdown is also split into RAG-ready chunks of at most this many characters. 0 disables chunking.

## `chunkOverlap` (type: `integer`):

Approximate overlap between neighbouring chunks. Reduced automatically if not smaller than the chunk size.

## `maxConcurrency` (type: `integer`):

How many articles are processed in parallel.

## Actor input object example

```json
{
  "feedUrls": [
    "https://blog.python.org/feeds/posts/default?alt=rss"
  ],
  "maxArticlesPerFeed": 3,
  "fetchFullArticle": true,
  "chunkSize": 0,
  "chunkOverlap": 200,
  "maxConcurrency": 5
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset with one item per feed article: metadata, clean Markdown and optional RAG chunks.

# 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://blog.python.org/feeds/posts/default?alt=rss"
    ],
    "maxArticlesPerFeed": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("sequined_lacework/rss-article-markdown").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://blog.python.org/feeds/posts/default?alt=rss"],
    "maxArticlesPerFeed": 3,
}

# Run the Actor and wait for it to finish
run = client.actor("sequined_lacework/rss-article-markdown").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://blog.python.org/feeds/posts/default?alt=rss"
  ],
  "maxArticlesPerFeed": 3
}' |
apify call sequined_lacework/rss-article-markdown --silent --output-dataset

```

## MCP server setup

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

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/fKiVhdpvwcU8ij4yO/builds/7RWQxGpvp98hVV4Qf/openapi.json
