18

I've been using the Google Feed API to load RSS feeds, but it looks like Google has shut down the API. For instance, when I try to load the New York Times RSS feed at http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=1000&q=http%3A%2F%2Frss.nytimes.com%2Fservices%2Fxml%2Frss%2Fnyt%2FHomePage.xml, I get this response:

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

Are there any viable alternatives?

Joe Mornin
  • 8,766
  • 18
  • 57
  • 82

5 Answers5

26

Use Yahoo's YQL API:

select * from xml where url = 'https://news.ycombinator.com/rss'

You can request a JSONP feed by adding a callback parameter to the url

https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url%20%3D%20'https%3A%2F%2Fnews.ycombinator.com%2Frss'&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=mycallback
Tony
  • 1,811
  • 1
  • 20
  • 27
  • I hate to ask but could you provide a fiddle for this to show how it works? I would really appreciate and am not sure how your solution works or what will be displayed and how the HTML will look on the page. – Aaron Dec 03 '15 at 14:42
  • 2
    @Aaron Here's a basic example to get you going: https://gist.github.com/anonymous/7f79807bc6abb00024df – Tony Dec 03 '15 at 16:47
  • Awesome! This really helps! – Aaron Dec 07 '15 at 14:06
  • awesome! What about Google Feed API for finding rss page (http://ajax.googleapis.com/ajax/services/feed/find), anyone can help me with this. I can't find the way to handle it with YQL – meaholik Mar 23 '16 at 04:20
  • @meaholik I think Google discontinued Feed Find API too. – Tony Oct 01 '16 at 19:03
  • This doesn't work, the YQL API is deprecated and deactivated. – JamesWilson Oct 02 '20 at 16:14
3

Deprecated

My plugin, $.jQRSS uses Google Feed and seems to work just fine, given your exact RSS link:

var rss = 'http://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml';
$.jQRSS(rss, { count: 8 }, function (feed, entries) {
 console.log([feed, entries]);
 $.each(entries, function(i) {
  if (this['content']) {
   var fieldset = $('<fieldset/>', { title: this.contentSnippet }).appendTo('body'),
    legend = $('<legend/>').appendTo(fieldset),
    $link = $('<a />', { href: this.link, html: this.title, target: '_blank' }).appendTo(legend),
    $date = $('<h5 />', { html: this.publishedDate }).appendTo(fieldset),
    $content = $('<div />', { html: this.content }).appendTo(fieldset);
   $content.find('br').remove();
  }
 });
});
fieldset > h5 { float: right; margin-top: 0; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="http://rawgit.com/JDMcKinstry/jQRSS/master/jQRSS.js"></script>
SpYk3HH
  • 22,272
  • 11
  • 70
  • 81
  • That's weird. It's working again for me too, but the API is still officially deprecated: https://developers.google.com/feed/ – Joe Mornin Mar 08 '16 at 23:45
  • Please don't rollback objectively good edits. You do not own your posts, the community does, and we are all free to edit and improve them. If you are not comfortable with this, you cannot post to Stack Overflow. – user229044 Jun 12 '16 at 17:19
  • 2
    This doesn't work, the API is deprecated and deactivated. – Angelo Feb 04 '17 at 19:00
1

You can use the script feedburner:

<script src="http://feeds.feedburner.com/feeduri?format=sigpro&nItems=10" type="text/javascript"></script>

All information:

https://support.google.com/feedburner/answer/78991?hl=en

jmacuna
  • 11
  • 2
1

One addition to Tony's solution for using YQL - I needed to change the callback value to JSON_CALLBACK to parse the response properly:

'https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url%20%3D%20\'' + encodeURIComponent(url) + '\'&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=JSON_CALLBACK'
Community
  • 1
  • 1
Dave B
  • 27
  • 1
1

You can use PHP to grab a copy of whatever RSS feed you wish to display, then use client side JavaScript to display the results. The main advantage is you're not subject to daily requests limits that way, which most free RSS API services have, or reliability issues.

http://www.javascriptkit.com/dhtmltutors/ajaxticker/index.shtml

coco puffs
  • 1,040
  • 12
  • 8