Show RSS Feeds in Your App
RSS is still the simplest way to pull posts, podcasts and news into an app. The catch is that browsers will not fetch most feeds for you. Here is the server-side setup.

Key takeaways
- Fetch feeds on a schedule from the server and store items in your database; the page reads your table, not the feed.
- Deduplicate on the item's guid (or link), because feeds repeat items on every fetch and sometimes edit them.
- Treat feed HTML as untrusted: strip scripts and styles before you render a single description.
To show an RSS feed in your app, fetch the feed on the server (not in the browser), parse its items, store them in a database table keyed by each item's guid, and have your page read that table. A scheduled job refreshes every 15 to 60 minutes. Browsers cannot reliably fetch other sites' feeds directly because most feeds do not send the CORS headers that allow it, and fetching on every page view would hammer the publisher anyway. Most public feeds need no account or key.
What you will build
A feed reader block for your site or app: a list of the latest items from one or more sources, each with a title, source name, date, short summary and link out. Good uses: a "From the blog" strip on a landing page pulling your own Substack or WordPress posts, a podcast page listing episodes from the show's feed, a niche news hub that combines ten industry blogs, or a community dashboard that shows updates from members' sites. You decide which feeds are allowed; users only see what you have approved, which keeps the content and the load under control.
What you need
- The feed URLs. Most blogs expose one at /feed, /rss, /feed.xml or /atom.xml, and many link it in the page head. Podcast feeds are listed on the show's website or hosting page. YouTube channels and many forums offer feeds too.
- A backend with server functions and scheduled jobs. On Startbase Cloud that is an edge function for the fetch and a job for the schedule.
- No key for public feeds. If a feed is private (a paid newsletter's member feed, for example), its secret is usually a token inside the URL. Treat that whole URL as a secret and store it in Secrets rather than in your code.
RSS and Atom in two minutes
Two XML formats cover nearly every feed. RSS 2.0 has a channel with items; each item has title, link, description, pubDate and usually a guid. Atom has a feed with entries; each entry has title, a link element with an href attribute, summary or content, updated or published, and an id. Some sites also publish JSON Feed, the same idea in JSON. A good parser library handles all three and gives you one shape, so do not hand-roll XML parsing.
Dates are where formats differ in practice: RSS uses the older email style ("Sat, 21 Nov 2026 09:30:00 GMT"), Atom uses ISO 8601 ("2026-11-21T09:30:00Z"). Normalize everything to a UTC timestamp when you store it. Podcasts add an enclosure element with the audio URL, its length in bytes and its type, plus iTunes tags for duration and episode art.
The data flow
- 01feeds table: id, url, title, site_url, last_fetched_at, etag, last_modified, error_count, active. One row per source you approve.
- 02Schedule: a job runs every 30 minutes and calls a fetch-feeds function.
- 03Polite fetch: for each active feed, the function sends the saved ETag and Last-Modified values as If-None-Match and If-Modified-Since headers. A 304 Not Modified response means nothing changed, costs almost nothing, and you move on.
- 04Parse and upsert: new content is parsed, each item becomes a row in feed_items (feed_id, guid, title, link, summary, published_at, image_url, enclosure_url) with a unique constraint on feed_id plus guid. Existing rows update, new rows insert, nothing duplicates.
- 05Trim: keep the latest 100 items per feed, or 90 days, so the table does not grow forever.
- 06Render: the page queries feed_items ordered by published_at, newest first, joined to feeds for the source name.
If an item has no guid (it happens), fall back to its link, and if the link is also missing, a hash of title plus date. Never deduplicate on title alone: publishers fix typos in titles all the time. Scheduled jobs explained covers the cron side if you have not set one up before.
A brief you can paste
Add a "Reading list" page that shows the latest posts from a set of RSS and Atom feeds. Create a feeds table I can manage from an admin screen (URL, display name, active toggle) and a feed_items table with a unique key on feed and guid. Write an edge function that fetches each active feed with If-None-Match and If-Modified-Since headers, parses RSS, Atom and JSON Feed into one shape (title, link, summary as plain text up to 280 characters, published date in UTC, image if present), and upserts the items. Schedule it every 30 minutes. Keep 100 items per feed. On the page, show items newest first with the source name and a relative date, open links in a new tab, and filter by source with chips. If a feed fails five times in a row, mark it inactive and show it in red on the admin screen.
Rendering feed content safely
Feed descriptions often contain HTML, and that HTML comes from someone else's server. Rendering it raw means any script, iframe or tracking pixel in it runs on your page. Pick one of two policies and stick to it:
- Plain text summaries (recommended for lists). Strip all tags, decode entities like &, collapse whitespace and cut at a word boundary around 200 to 300 characters. Fast, safe and consistent.
- Sanitized HTML (for full articles). Run content through a sanitizer with an allowlist: paragraphs, links, lists, emphasis, images. Remove scripts, styles, iframes, event attributes and javascript: links, and add rel="noopener nofollow" to outbound links.
Pitfalls
- Fetching from the browser. You will hit CORS errors on most feeds; public "CORS proxy" services are unreliable and see your traffic. Server-side fetching is the fix. What is CORS explains the rule you are running into.
- Polling too often. Every 5 minutes for a blog that posts weekly is rude and can get your server blocked. Respect the feed's ttl element if it has one, and use conditional requests.
- Broken feeds. Some feeds are malformed XML, redirect to a new address or vanish. Follow redirects, count consecutive failures, and pause a feed after a few rather than retrying forever.
- Relative links and images. Some feeds use links like /posts/hello. Resolve them against the feed's site URL before storing.
- Huge feeds. A feed with years of full-text posts can be several megabytes. Cap the response size and the number of items you read per fetch.
- Time zones. Store UTC, display in the viewer's zone. A post from "yesterday" in one zone can be "today" in another.
Want the other direction, a feed for your own site? If you are building a blog or newsletter, ask for an RSS feed at /feed.xml alongside the pages; the newsletter site guide covers what readers expect from it.
Frequently asked questions
Why do I get a CORS error when fetching an RSS feed?
Most feeds do not send the headers that allow other websites' scripts to read them, so the browser blocks the request. Fetch the feed from a server function instead and serve the items from your own backend.
Do I need an API key to read RSS feeds?
Not for public feeds. Private feeds usually embed a token in the URL; treat that URL as a secret and keep it in your backend.
How often should my app check an RSS feed?
Every 15 to 60 minutes is reasonable for most sources. Use conditional requests with ETag and Last-Modified so unchanged feeds cost almost nothing, and respect the feed's ttl if it sets one.
What is the difference between RSS and Atom?
Both are XML formats for publishing a list of updates. They name fields differently and format dates differently, but a good parser library turns both into the same shape.

