The SearchBins response group groups the items returned by ItemSearch into bins. A set of bins, for example, can be a set of price ranges for a product. In the case of women’s shoes, for example, you might have a bin that returns ASINs for shoes that cost between $0 and $50, a second bin for shoes that cost $50 to $100, and a third bin for shoes that cost more than $100. The basis on which the items are split into bins is specified by the NarrowBy attribute in the SearchBinSet tag. To refine the search, you make repeated requests using the NarrowBy values.
ItemSearch returns the first twenty-five bins of results.
The basis on which the items are split into bins is specified by the NarrowBy attribute in the SearchBinSet tag. In the following example, the NarrowBy attribute shows that the bins are based on price range:
<SearchBinSet NarrowBy="PriceRange">
For another product category, the NarrowBy attribute might be different, for example:
<SearchBinSet NarrowBy="BrandName">
You cannot specify NarrowBy values nor can you specify the values they encompass. When SearchBins is included as a Response Group in a request, ItemSearch automatically divides the ItemSearch results into bins.
NarrowBy values include:
Subject—BrowseNode IDs of all topics related to items returned by ItemSearch. For example, searching for books about dogs returns, in the Subject bins, BrowseNodes for "Home & Garden," "Animal Care & Pets," "Dogs," and "Educational."
BrandName—Brands, such as Levi's, Reebok, and Nike, that create the item. Use the name of a brand to filter out similar items made by other companies.
PriceRange—Minimum and maximum prices for a bin of items. Use the minimum and maximum price values in each bin to filter out items outside of the price range you want.
SpecialSize—Uncommon sizes an item comes in. Examples are "Plus Size & Tall," "Misses," "Maternity," "Husky," "Petites," and "Big & Tall."
Merchant—All merchants selling an item. This bin returns all merchants even if MerchantId is set to a single merchant in the ItemSearch request. In the response, the ASINs returned will be specific to the MerchantId specified in the request. The merchants listed in the Merchant bin can be used to list other merchants that sell the same ASIN. There are some items sold by only one merchant. In that case, the Merchant bin returns with only that merchant.
All Search Indices return the Subject bin. Most return all of the bins.
The following list shows which NarrowBy values are returned by each Search Index:
Apparel—Subject, BrandName, PriceRange, SpecialSize, Merchant
Baby—Subject, BrandName, PriceRange, SpecialSize, Merchant
Beauty—Subject, BrandName, PriceRange, SpecialSize, Merchant
Blended—Not supported
Books—Subject
Classical—Subject
DVD—Subject
Electronics—Subject, BrandName, PriceRange, SpecialSize, Merchant
Garden—Subject, BrandName, PriceRange, SpecialSize, Merchant
GourmetFood—Subject, BrandName, PriceRange, SpecialSize, Merchant
HealthPersonalCare—Subject, BrandName, PriceRange, SpecialSize, Merchant
Jewelry—Subject, Brand, PriceRange, SpecialSize, Merchant
Kitchen—Subject, BrandName, PriceRange, SpecialSize, Merchant
Magazines—Subject
Marketplace—Subject
Merchants—Subject, BrandName, PriceRange, SpecialSize, Merchant
Miscellaneous—Subject, BrandName, PriceRange, SpecialSize, Merchant
Music—Subject
MusicalInstruments—Subject, BrandName, PriceRange, SpecialSize, Merchant
OfficeProducts—Subject, BrandName, PriceRange, SpecialSize, Merchant
PCHardware—Subject, BrandName, PriceRange, SpecialSize, Merchant
Photo—Subject, BrandName, PriceRange, SpecialSize, Merchant
Showtimes—Theater
Software—Subject, BrandName, PriceRange, SpecialSize, Merchant
SportingGoods—Subject, BrandName, PriceRange, SpecialSize, Merchant
Theatrical—Subject
Tools—Subject, BrandName, PriceRange, SpecialSize, Merchant
Toys—Subject, BrandName, PriceRange, SpecialSize, Merchant
Travel—Subject
VHS—Subject
Video—Subject
VideoGames—Subject, BrandName, PriceRange, SpecialSize, Merchant
Wireless—Subject
WirelessAccessories—Subject
The element tags in a bin vary according to the bin. For example, in bins based on price, the elements and Name values are:
<BinName>
<BinItemCount>
<BinParameter>
<Name>MinimumPrice</Name>
<Value>
<BinParameter>
<Name>MaximumPrice</Name>
<Value>
The elements show the minimum and maximum price for items in that bin, and the number of items in that bin.
Other NarrowBy values use other element tags in their bins. For example, when NarrowBy is “Brand,” the element tags and Name values are:
<Bin> <BinName> <BinItemCount> <BinParameter> <Name>Brand</Name> <Value>
You cannot specify the element tags returned in a bin.
You can take the values in a bin and add them to the ItemSearch query to filter out of the response items that are outside of that bin. To narrow the search results to shirts that cost between $0 and $25, for example, you would add the following Name and its corresponding value as additional parameters in the original ItemSearch request:
&MinimumPrice=0 &MaximumPrice=2499
You could narrow the search results even further by adding an additional parameter to the query. For example, you could specify
&Brand=Levi’s
The response would then only include shirts by Levi’s that cost under $25. You could continue to drill down by adding additional parameters to the request.
Notice that in each case the results were narrowed down by adding the value tagged with Name and its corresponding value to the original ItemSearch request.
The following table describes the elements returned by SearchBins. The elements on the left side of a slash mark are the parents of the elements on the right side of the slash mark.
| Response Element | Ancestry | Definition |
|---|---|---|
BinItemCount
| SearchBinSets/SearchBinSet/Bin/BinItemCount | Number of items in a bin. |
BinName
| SearchBinSets/SearchBinSet/Bin/BinName | Name of the bin. |
Name
| SearchBinSets/SearchBinSet/Bin/BinParameter/Name | Name of item in bin. |
SearchBinSets
| SearchBinSets | Parent element for SearchBins element. |
Value
| SearchBinSets/SearchBinSet/Bin/BinParameter/Value | Value for item in bin |
SearchBins also returns the elements that all response groups return, which is described in Elements Common to All Response Groups.
The folllowing request was used to illustrate the XML response elements returned by SearchBins.
http://ecs.amazonaws.com/onca/xml? Service=AWSECommerceService& AWSAccessKeyId=[Your Access Key ID Here]& Operation=ItemSearch& MerchantId=A363XKZVKSMVXW& Condition=All& SearchIndex=SportingGoods& Keywords=Glove& ResponseGroup=SearchBins
The following response snippet shows the elements returned by SearchBins.
<Item>
<ASIN>B00005R2GR</ASIN>
</Item>
<Item>
<ASIN>B00076ZDV8</ASIN>
</Item>
<Item>
<ASIN>B00092FEEG</ASIN>
</Item>
<Item>
<ASIN>B000ADTP1W</ASIN>
</Item>
<SearchBinSets>
<SearchBinSet NarrowBy="PriceRange">
<Bin>
<BinName>$25-$49</BinName>
<BinItemCount>316</BinItemCount>
<BinParameter>
<Name>MinimumPrice</Name>
<Value>2500</Value>
</BinParameter>
<BinParameter>
<Name>MaximumPrice</Name>
<Value>4999</Value>
</BinParameter>
</Bin>
</SearchBinSet>
<Bin>
<BinName>$0-$24</BinName>
<BinItemCount>280</BinItemCount>
<BinParameter>
<Name>MinimumPrice</Name>
<Value>0</Value>
</BinParameter>
<BinParameter>
<Name>MaximumPrice</Name>
<Value>2499</Value>
</BinParameter>
</Bin>
</SearchBinSet>
<SearchBinSet NarrowBy="BrandName">
<Bin>
<BinName>Rawlings</BinName>
<BinItemCount>71</BinItemCount>
<BinParameter>
<Name>Brand</Name>
<Value>Rawlings</Value>
</BinParameter>
</Bin>
<Bin>
<BinName>Body Glove</BinName>
<BinItemCount>53</BinItemCount>
<BinParameter>
<Name>Brand</Name>
<Value>Body Glove</Value>
</BinParameter>
</Bin>
</SearchBinSet>
<SearchBinSet NarrowBy="Merchant">
<Bin>
<BinName>Sports"R"Us</BinName>
<BinItemCount>860</BinItemCount>
<BinParameter>
<Name>MerchantId</Name>
<Value>A363XKZVKSMVXW</Value>
</BinParameter>
</Bin>
<Bin>
<BinName>Target</BinName>
<BinItemCount>8</BinItemCount>
<BinParameter>
<Name>MerchantId</Name>
<Value>A1VC38T7YXB528</Value>
</BinParameter>
</Bin>
</SearchBinSet>
<SearchBinSet NarrowBy="Subject">
<Bin>
<BinName>Categories</BinName>
<BinItemCount>860</BinItemCount>
<BinParameter>
<Name>BrowseNode</Name>
<Value>3375301</Value>
</BinParameter>
</Bin>
<Bin>
<BinName>Baseball</BinName>
<BinItemCount>311</BinItemCount>
<BinParameter>
<Name>BrowseNode</Name>
<Value>3395731</Value>
</BinParameter>
</Bin>
</SearchBinSet>
Notice that the NarrowBy value is PriceRange.