Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
124 lines (88 sloc) 2.57 KB



Vacuum is a thin Ruby wrapper to various Amazon Web Services (AWS) APIs.



gem install vacuum

Amazon Product Advertising API

Vacuum knows the Amazon Product Advertising API inside out.

Set up a request:

req = :product_advertising

req.configure do |config|
  config.key    'key'
  config.secret 'secret'
  config.tag    'tag'

Build and run a search: operation:    'ItemSearch',
          search_index: 'Books',
          keywords:     'Deleuze'
res = req.get

Or accomplish the same search less verbosely:

res = :books, 'Deleuze'

The response wraps a Nokogiri document:


And lets you drop down to any node:

if res.valid?
  res.find('Item') do |item|
    p item

You will find more examples here.

Amazon Marketplace Web Services API

The wrapper to the Amazon Marketplace Web Services API is a work-in-progress.

Set up a request to the Products API:

req = do |config|
  config.locale      'US'
  config.key         'key'
  config.secret      'secret'
  config.marketplace 'marketplace'
  config.seller      'seller'

Get the lowest offers for a single ASIN: 'Action'          => 'GetLowestOfferListingsForASIN',
          'ASINList.ASIN.1' => '0231081596'
offers = req.get.find 'GetLowestOfferListingsForASINResult'

I will at some point throw in some syntactic sugar for common operations.

Other AWS APIs

Vacuum should work with all AWS libraries, including EC2, S3, IAM, SimpleDB, SQS, SNS, SES, and ELB. Most of these already have popular Ruby implementations. If you need to implement one using Vacuum, please fork and send a pull request when done.

HTTP Client Adapters

You can use any of the alternative adapters Faraday supports:

req.connection do |builder|
  builder.adapter :em_synchrony



Workers queuing to crawl AWS.

Something went wrong with that request. Please try again.