Google Feed API alternative


Google effectively terminated its Feed API a few days ago, any attempt to call the api will return the response below :

{"responseData": null, "responseDetails": "This API is no longer available.", "responseStatus": 403}

If you are looking for a simple and free alternative to Google Feed API for your rss widget rss2json.com could be a suitable solution for that.

Integrating rss2json.com api into your widget or application

If your widget uses the script provided by google (aka <script type="text/javascript" src="https://www.google.com/jsapi"></script>) you don't need to change anything in your widget's code just replace google's script by this shim https://rss2json.com/gfapi.js

Below is google's "Hello World" of Feed demonstrated in their documentation using rss2json.com api :

<html>
  <head>
    <!--
        === Remove google's feed script ===
        <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    -->

    <!-- === Add this script === -->
    <script type="text/javascript" src="https://rss2json.com/gfapi.js"></script>

    <script type="text/javascript">

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

    function initialize() {
      var feed = new google.feeds.Feed("https://news.ycombinator.com/rss");
      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.appendChild(document.createTextNode(entry.title));
            container.appendChild(div);
          }
        }
      });
    }
    google.setOnLoadCallback(initialize);

    </script>
  </head>
  <body>
    <div id="feed"></div>
  </body>
</html>
See it in action !

Also you can use all the extra parameters listed in our documentation page by passing them as a second parameter when initializing a new google.feeds.Feed object.

var feed = new google.feeds.Feed("https://news.ycombinator.com/rss",{
        api_key : '0000000000000000000000000000000000000000',
        count : 5,
        order_by : 'title',
        order_dir : 'asc'
});

Feel free to contact us if you have any issue using this service or you want to request a feature.

Published 22 Jan 2017