Class Amazon::AWS::ItemSearch
In: lib/amazon/aws.rb
Parent: Operation

This is the class for the most common type of AWS look-up, an ItemSearch. This allows you to search for items that match a set of broad criteria. It returns items for sale by Amazon merchants and most types of seller.




SEARCH_INDICES = %w[ All Apparel Automotive Baby Beauty Blended Books Classical DigitalMusic DVD Electronics ForeignBooks GourmetFood Grocery HealthPersonalCare Hobbies HomeGarden HomeImprovement Industrial Jewelry KindleStore Kitchen Lighting Magazines Merchants Miscellaneous MP3Downloads Music MusicalInstruments MusicTracks OfficeProducts OutdoorLiving Outlet PCHardware PetSupplies Photo Shoes SilverMerchants Software SoftwareVideoGames SportingGoods Tools Toys UnboxVideo VHS Video VideoGames Watches Wireless WirelessAccessories ]   Not all search indices work in all locales. It is the user‘s responsibility to ensure that a given index is valid within a given locale.

According to the AWS documentation:

  • All searches through all indices.
  • Blended combines Apparel, Automotive, Books, DVD, Electronics, GourmetFood, Kitchen, Music, PCHardware, PetSupplies, Software, SoftwareVideoGames, SportingGoods, Tools, Toys, VHS and VideoGames.
  • Merchants combines all search indices for a merchant given with MerchantId.
  • Music combines the Classical, DigitalMusic, and MusicTracks indices.
  • Video combines the DVD and VHS search indices.

Public Class methods

Search AWS for items. search_index must be one of SEARCH_INDICES and parameters is an optional hash of parameters that further refine the scope of the search.


 is = 'Books', { 'Title' => 'ruby programming' } )

In the above example, we search for books with Ruby Programming in the title.


# File lib/amazon/aws.rb, line 955
      def initialize(search_index, parameters)
        unless SEARCH_INDICES.include? search_index.to_s
          raise "Invalid search index: #{search_index}"

        super( { 'SearchIndex' => search_index }.merge( parameters ) )