RSS to JSON Convertor

This script is capable of taking an RSS (or Atom) feed and converting it into a valid JSON object. I currently cache feed requests once per hour, to save on bandwidth – so keep that in mind when developing an application.

You can use the interface that I have setup, below, or you can download the script itself (written in Perl) and run it on your own server (which is preferable).


This script currently has a REST interface, accessible via a GET request. The full request would look something like this:
the URL parameter would contain the URL of the RSS/Atom feed which you are attempting to convert. The optional Callback parameter would reference a callback function that you wish to have called, with the new data.

You can test this out by visiting the following URL:

Sample Code and Demo

A simple, sample, program would look something like this:

getRSS("", handleRSS);

function handleRSS(rss) {
  alert( "Dowloaded: " + rss.title );

function getRSS(url, callback) {
  feedLoaded = callback;
  var script = document.createElement('script');
  script.type = 'text/javascript';
  script.src = "" + url 
    + "&callback=feedLoaded&t=" + (new Date()).getTime();

I’ve also setup a more advanced demo, which uses some tweaked code from the JSON page.

Also, the popular widget that I made using the Google Homepage API also uses the RSS to JSON convertor. Taking a quick peak at the source code shows it in use.


If you wish to run your own copy of the RSS to JSON script, you can download it from here. It’s a Perl-based CGI script which requires that the following modules be installed: LWP and XML::Feed.

This work is licensed under a Creative Commons Attribution 2.5 License.

Posted: December 17th, 2005

Subscribe for email updates

16 Comments (Show Comments)

Comments are closed.
Comments are automatically turned off two weeks after the original post. If you have a question concerning the content of this post, please feel free to contact me.

Secrets of the JavaScript Ninja

Secrets of the JS Ninja

Secret techniques of top JavaScript programmers. Published by Manning.

John Resig Twitter Updates

@jeresig / Mastodon

Infrequent, short, updates and links.