Reading a RSS Feed using Google Ajax Feed API


In the project I’m currently working we had a requirement to display some news that comes from a External RSS Feed. At the beginning we choose an Server side approach, using the Rome framework to read the RSS Feed, but we faced some problems with proxy settings. So we needed to change our approach from server side to  client side.

For a client side approach we needed to use ajax, but using ajax we faced another problem when we tried to make a request to another domain.  So a guy from our team found the Google Ajax Feed API, a javascript API that allow us to read RSS Feeds in a very simple way.

Below there is a simple example got from the API page.

    <script type="text/javascript" src="<em>YOUR_KEY_HERE</em>"></script>
    <script type="text/javascript">

    google.load("feeds", "1");

    function initialize() {
      var feed = new google.feeds.Feed("");
      feed.load(function(result) {
        if (!result.error) {
          var container = document.getElementById("feed");
          for (var i = 0; i < result.feed.entries.length; i++) {
            var entry = result.feed.entries[i];
            var div = document.createElement("div");


    <div id="feed"></div>

You can find other examples in the API page.

Enjoy it!