DEV Community

Daniel Igel
Daniel Igel

Posted on

Turn any RSS or Atom feed into clean JSON with a single HTTP request

RSS feeds are everywhere, but they're XML — and most edge runtimes don't ship an XML parser. Writing one means bundling a dependency you'd rather not carry.

One GET returns any RSS 2.0, Atom, or JSON feed as normalized JSON:

curl --request GET \
  --url 'https://rss-to-json-api2.p.rapidapi.com/api/v1/parse?url=https://hnrss.org/frontpage&limit=10' \
  --header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY' \
  --header 'x-rapidapi-host: rss-to-json-api2.p.rapidapi.com'
Enter fullscreen mode Exit fullscreen mode

Every item comes back with the same shape — title, link, summary, published, author, categories, and guid — regardless of whether the source was RSS 2.0 or Atom. Results are cached for 5 minutes, so repeated polls don't hammer the upstream feed.

const res = await fetch(
  `https://rss-to-json-api2.p.rapidapi.com/api/v1/parse?url=${encodeURIComponent(feedUrl)}&limit=20`,
  { headers: { 'x-rapidapi-key': process.env.RAPIDAPI_KEY, 'x-rapidapi-host': 'rss-to-json-api2.p.rapidapi.com' } }
);
const { feedType, title, items } = await res.json();
Enter fullscreen mode Exit fullscreen mode

Building a news aggregator? POST /api/v1/parse with { "urls": ["...", "..."], "limit": 5 } parses up to 10 feeds concurrently — each entry carries its own status field so partial failures don't silently break the batch.

Don't have the feed URL? GET /api/v1/discover?url=https://example.com crawls the page's <link> tags and common feed paths, returning every linked RSS, Atom, and JSON Feed URL with its type and title.

Free tier on RapidAPI: https://rapidapi.com/danieligel/api/rss-to-json-api2

What do you currently use to consume RSS feeds in production — roll your own XML parser, use a library, or delegate it to a service?

Top comments (0)