Having Amazon Produce Its Own RSS Feeds

Andrew Odewahn, an editor at O’Reilly, spotted how you can have Amazon.com produce RSS feeds from any search within its own site. So, he says:

You could subscribe to a search for books on “software engineering,” “Java,” and “history of europe” to easily keep track with what’s going on.

To do this, you only need play with a URL. The URL for an RSS 0.91 feed of a keyword search for “software engineering” is:

http://xml.amazon.com/onca/xml3?t=webservices-20&dev- t=amznRss&KeywordSearch=software%20engineering&mode=books&bcm=&typ e=lite&page=1&ct=text/xml&sort=+salesrank&f=http://xml.amazon.com/xsl/ xml-rss091.xsl

As you can see, this is actually calling the Amazon web services system and then formatting it by passing it through an XSLT stylesheet.

Andrew goes on to say,

By default, the search results are sorted by Amazon rank. After hacking around a bit, I found that you can change this default to any of a variety of other orders. For example, you can modify the feed so that books are sorted by publication date to get an automatically updated list of new books published on a particular topic.

To do this, scroll over the URL until you see the “&sort=+salesrank” part. To change the sort order, replace “salesrank” with the option you’d prefer. Here’s a list of possible options found on Amazon’s Web Services page, http://www.amazon.com/gp/aws/landing.html:

  • Publication Date daterank

  • Featured Items pmrank

  • Sales Rank salesrank

  • Customer reviews reviewrank ...

Get Developing Feeds with RSS and Atom now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.