These parameters are defined in the section of the API reference that describes the associated operation.
Sorting Results
The following Product Advertising API operations have a Sort parameter that arranges results:
•
ItemSearch
To Sort Results
1. Consult the appendix, APPNDX_SortValuesArticle Sort Values, to determine available sort values.
Available sort values vary by locale and search index.
2. Add the Sort parameter to a request that uses one of the preceding operations.
For example, the following request returns books with "Harry Potter" in their title or description in
alphabetical order.
http://webservices.amazon.com/onca/xml?
Service=AWSECommerceService&
AWSAccessKeyId=1MEXAMPLEZBG2&
Operation=ItemSearch&
Keywords=Harry%20Potter&
SearchIndex=Books&
Sort=titlerank&
ItemPage=4&
Version=2011-08-01
&Timestamp=[YYYY-MM-DDThh:mm:ssZ]
&Signature=[Request Signature]
A small snippet of the response shows that the book titles are returned in alphabetical order.
<Title>Aventuras de Harry Potter, Las</Title>
...
<Title>Beacham's Sourcebook For Teaching Young Adult Fiction: Exploring Harry
Potter</Title>
...
<Title>Beatrix Potter to Harry Potter: Portraits of Children's Writers</Title>
Product Advertising API provides many different sorting criteria, for example, price (high to low, or low to
high), salesrank (best to worst selling, or worst to best selling), publication date, review rank, and release
date. Valid sort parameters vary by search index, for example, the DigitalMusic search index can be
sorted by UploadedDate. That value for Sort would not make sense in the Automotive search index, for
example. Sort parameters also differ by locale.
For more information about sort values by locale and search index, see the appendix,
ItemSearch Sort
Values By Locale (p. 314)
.
Default Sort Values
There are many sort values. The majority are not applied unless the
Sort
parameter is included in the
request. There are two sort values, however, that are used by default.
• For
ItemSearch
requests that do not use the
BrowseNode
parameter, results are sorted by Relevance
API Version 2011-08-01
83
Product Advertising API Developer Guide
Paging and Sorting Through Responses