views:

719

answers:

7

I'm building a Rails web app and was wondering what is the best way to get a list of products that Amazon would return based on a search term?

For example, if I sent amazon the term "iphone", I'd get a list of iphones back from Amazon.

Does anyone know if there's a gem or library for Rails out there that would fit this need?

A: 

The Ruby/AWS library (gem: ruby-aaws) seems to do it. Not much in the way of examples, but with some code searches I'm sure you can turn up something.

Bill Turner
Yes ruby-aws will do it. It may take a bit of experimenting to get the exact results you want. For example, there are various types of results and not all the types will return the price.
Jim
I've tried for a couple of hours wit ruby-aaws but amazon-ecs worked out of the box on the first try.
J. Pablo Fernández
there are a number of examples in the gem code in the examples directory... at least a dozen, with comments
umassthrower
+2  A: 

I've always used the amazon-ecs gem. Despite the name, it looks like it's still under active development (last updated August 27th, 2009).

http://github.com/jugend/amazon-ecs

Here is a blog post that might help you on your way:

http://www.pluitsolutions.com/projects/amazon-ecs

Carlos
A: 

Another pottential library to do this is amazon-product-advertising-api, but I cannot say anything else about it as I haven't tried it.

J. Pablo Fernández
A: 

Hi Jim, I am using ruby-aaws Ruby/AWS Library 0.7.0 but it doesnt work for me. I am following an example from the book Ruby On Rails Bible but no success. The error that I get is.. Amazon::AWS::HTTPError: HTTP response code 403 from C:/Documents and Settings/kumar/My Documents/Aptana Studio Workspace/amazon_test/lib/amazon/aws.rb:169:in get_page' from C:/Documents and Settings/kumar/My Documents/Aptana Studio Workspace/amazon_test/lib/amazon/aws/search.rb:305:in search' from C:/Documents and Settings/kumar/My Documents/Aptana Studio Workspace/amazon_test/lib/amazon_interface.rb:18:in `find_by_keyword' from (irb):3

Kumar Deepam
+1  A: 

So the Ruby/AWS library is the way to go. There is a pretty good tutorial here

Pablo, ruby-aaws worked nearly out of the box for me. I just had to setup a .amazonrc file with the configuration options like my amazon affiliate id and AWS public and secret keys.

umassthrower
ohh yea, and the maintainer seems to still be maintaining this API as of this spring (2010) at least.
umassthrower
+1  A: 

http://github.com/papercavalier/sucker

Sean Buttinger
A: 

I second Ruby/AWS. It has support for ListSearch and ListLookup. Amazon-ecs has comparatively less support for the API.

Reed G. Law