RSS feeds and sitemaps

Before you scrape a site for new content, check whether it already publishes a feed. Turn RSS and Atom into JSON, poll it properly, and generate the sitemap that tells search engines about your own pages.

Everything in the previous three lessons reads a page that was built for people and tries to recover the data from it. Feeds and sitemaps are the opposite: files that sites publish specifically so machines can find their content. When one exists, using it is cheaper, more stable and more polite than scraping. A redesign that breaks every scraper you wrote leaves the feed untouched, because the feed is a promise the publisher made to every reader app and aggregator that consumes it.

This lesson covers both directions. Reading other people's feeds to track new content, and generating a sitemap so search engines can find yours.

Feeds are the polite alternative

A typical "monitor these competitors' blogs" job, done by scraping, looks like this: fetch each blog's index page every hour, extract the post links with Link Scraper, diff against yesterday's list, then fetch and convert each new post. That is several calls per site per hour, a parser that breaks when the theme changes, and a crawler hitting someone's server more than it needs to.

The same job with a feed is one call per site per poll. The feed lists the recent posts with titles, dates, summaries and links, in a format that has not changed meaningfully in two decades. You only fetch the full article when a post is new and you actually need its text.

Feeds come in two formats, RSS and Atom. They differ in element names and date formats, and readers handle both. You can usually find a site's feed in one of three ways:

  • In the page head. Sites advertise feeds with <link rel="alternate" type="application/rss+xml" href="..."> (or application/atom+xml). View the source of the home page or blog index and search for alternate.
  • At a conventional path. /feed, /feed/, /rss, /rss.xml, /atom.xml, /index.xml and /blog/feed cover a large share of sites. WordPress sites almost always answer at /feed/.
  • From the platform. Many hosted platforms expose feeds per author, category or tag, which are often more useful than the main feed.

RSS to JSON

RSS to JSON takes a feed URL and returns source (the feed's host), articles (how many items were parsed), maxReached, and feed[], where each item has website, title, pubDate, description and link. It costs 10 credits.

Try it liveRSS to JSON10 credits
POSThttps://api.apiverve.com/v1/rsstojson
curl -X POST "https://api.apiverve.com/v1/rsstojson" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.nasa.gov/rss/dyn/breaking_news.rss"}'
Sign in or create a free account to run this with your own key.

Each item in feed has title, pubDate, description and link. pubDate is a string in whatever format the feed uses.

It reads Atom as well as RSS: The Verge's index.xml is an Atom feed and came back in the same shape. That is convenient, and it hides a difference you have to handle yourself.

pubDate is a string, not a date

The NASA feed (RSS) returned "pubDate": "Thu, 22 Oct 2026 16:20:37 +0000", the RFC 822 format RSS uses. The Verge feed (Atom) returned "pubDate": "2026-10-22T18:15:00.000Z", ISO 8601. Same field, two formats, depending on the source. Sorting them as strings puts Thursday after Wednesday only by luck. Parse every date into a real timestamp at the boundary.

In JavaScript, new Date(value) parses both of those formats. In Python, datetime.fromisoformat handles neither reliably on 3.9 (it rejects the trailing Z before 3.11), and email.utils.parsedate_to_datetime handles only RFC 822, so try one and fall back to the other. Always keep the timezone; a feed that publishes in -0700 and one that publishes in Z sort correctly only as aware datetimes.

description is usually a teaser

Most feeds publish a summary, not the full article. The GitHub changelog feed ends each description with … followed by "The post ... appeared first on The GitHub Blog." The Verge's descriptions stop mid-word with "… Read the full story at The Verge." Some descriptions contain leftover markup or tab characters. Treat description as a preview for display and triage. When you need the full text, follow link and use URL to Markdown from lesson one, and only for the items that pass your filter.

Check yourself

Your aggregator sorts items from many feeds by `pubDate` as strings and the order is visibly wrong. What is the cause?

Answer the check above to continue.

Run every example on your own key. Free plan, no card.

Scaling up?

Volume pricing, custom SLAs, and dedicated support for high-traffic teams.

Contact sales