This site is not affiliated with or endorsed by Cloudflare, Inc. It simply showcases experiments built using Cloudflare services.
Cloudflare Experiments
Web Scraping & Parsing

RSS / Atom Feed Parser

Parse RSS or Atom feeds into normalized JSON from the edge

Fetch an RSS or Atom feed URL and return a normalized JSON representation of the channel and items from Cloudflare's edge.

Features

  • Supports RSS 2.0 and Atom
  • Normalizes title, link, id, published date, summary, and author
  • Caps results at 50 items
  • Stateless; no bindings required

API Reference

GET /parse

Fetches the feed URL and returns a normalized channel + items payload.

Prop

Type

Example Request

curl "https://your-worker.workers.dev/parse?url=https://blog.cloudflare.com/rss/"

Success Response

url string

Final feed URL after redirects

format string

"rss", "atom", or "unknown"

title string

Feed/channel title when present

description string

Feed description or Atom subtitle when present

link string

Feed homepage / self link when present

itemCount number

Number of items returned (max 50)

items array

Normalized items with title, optional link, id, published, summary, author

{
  "url": "https://blog.cloudflare.com/rss/",
  "format": "rss",
  "title": "The Cloudflare Blog",
  "description": "Cloudflare Blog",
  "link": "https://blog.cloudflare.com/",
  "itemCount": 2,
  "items": [
    {
      "title": "Example post",
      "link": "https://blog.cloudflare.com/example/",
      "id": "https://blog.cloudflare.com/example/",
      "published": "Mon, 01 Jan 2024 00:00:00 GMT",
      "summary": "Post summary…"
    }
  ]
}

Error Response

{
  "error": "URL did not return a recognizable RSS or Atom feed",
  "code": "NOT_FEED"
}

Error Codes

  • 400 - Missing or invalid url (INVALID_URL)
  • 400 - Response was not a recognizable feed (NOT_FEED)
  • 502 - Fetch failed (FETCH_ERROR)

Use Cases

  • Power newsletter or digest pipelines
  • Normalize third-party feeds for dashboards
  • Convert blog/changelog feeds into structured JSON APIs
  • Poll product update feeds from Workers cron jobs

Limitations

  • Heuristic XML parsing (not a full XML DOM)
  • Does not follow pagination or feed hubs
  • Large feeds are truncated to 50 items
  • Does not execute JavaScript-generated feeds

Use in your project

Copy these files into an existing Worker. Prefer Deployment to try the full experiment first. Source: apps/experiments/rss-atom-feed-parser.

DependenciesNoneBindingsNonePlatformFetch API
import { FETCH_TIMEOUT_MS, USER_AGENT } from "../constants/defaults";export type FeedFetchResult =  | { ok: true; url: string; body: string }  | { ok: false; error: string };export async function fetchFeed(url: string): Promise<FeedFetchResult> {  const controller = new AbortController();  const timeoutId = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS);  try {    const res = await fetch(url, {      method: "GET",      redirect: "follow",      signal: controller.signal,      headers: {        "User-Agent": USER_AGENT,        Accept: "application/rss+xml, application/atom+xml, application/xml, text/xml, */*",      },    });    clearTimeout(timeoutId);    if (!res.ok) {      return { ok: false, error: `HTTP ${res.status}` };    }    return { ok: true, url: res.url || url, body: await res.text() };  } catch (e) {    clearTimeout(timeoutId);    return { ok: false, error: e instanceof Error ? e.message : "Unknown error" };  }}

Deployment

Click the deploy button

Deploy to Cloudflare Workers

Deploy

Follow the deployment wizard. No bindings or secrets required.

Test your deployment

curl "https://your-worker.workers.dev/parse?url=https://blog.cloudflare.com/rss/"

Local Development

cd apps/experiments/rss-atom-feed-parser
npm install
npm run dev

Test locally:

curl "http://localhost:8787/parse?url=https://blog.cloudflare.com/rss/"

Cloudflare Features Used

Next Steps

On this page