To get the flavor of Amazon Associates Web Service, copy and paste the following URL into a browser substituting your own AWS Access Key ID for [ID].
http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=[ID]&Operation=ItemSearch&SearchIndex=Books&Title=Harry%20Potter&Version=2008-04-07
![]() | Tip |
|---|---|
Be careful not to introduce any spaces in the URL. Spaces are URL encoded as %20. Parameter names and values are case sensitive. |
Congratulations! You just made your first Amazon Associates Web Service request. From this example, you can see that a REST request is a URL. Everything before the question mark (?) specifies the destination of the request. This destination is the same for every Amazon Associates Web Service request (sent to the same locale). Everything after the question mark is a parameter in the request. This request searches (Operation=ItemSearch) for all books (SearchIndex=Books) that have "Harry Potter" in the title (Title=Harry%20Potter).
![]() | Tip |
|---|---|
Amazon Associates Web Service has a number of locales, including the US, JP (Japan), FR (France), DE (Germany), United Kingdom (UK), and Canada (CA). Each locale has a slightly different endpoint. For example, the JP endpoint is http://ecs.amazonaws.jp. You can send requests to any locale. Typically, however, you send them to the locale in which your customers' reside for a variety of reasons, including reducing shipping costs. For a list of all locales and endpoints, go to the Amazon Associates Web Service Developer Guide. |
Amazon Associates Web Service responds to the request by returning an XML document. The following is a snippet of the response.
<TotalResults>853</TotalResults>
<TotalPages>86</TotalPages>
<Item>
<ASIN>0439784549</ASIN>
<DetailPageURL>http://www.amazon.com/gp/redirect.html
%3FASIN=0439784549%26tag=ws%26lcode=xm2%26cID=
2025%26ccmID=165953%26location=/o/ASIN/0439784549%
253FSubscriptionId=1V9M7E1ZATWETZDS6W82
</DetailPageURL>
<ItemAttributes>
<Author>J.K. Rowling</Author>
<Creator Role="Illustrator">Mary GrandPré</Creator>
<Manufacturer>Scholastic, Inc.</Manufacturer>
<ProductGroup>Book</ProductGroup>
<Title>Harry Potter and the Half-Blood Prince(Book 6)
</Title>
</ItemAttributes>
</Item>This snippet shows that 853 items match the search criteria. The first item returned is, "Harry Potter and the Half-Blood Prince (Book 6)." Many details about the book are returned, including the name of the author, illustrator, book manufacturer, and product identifier (ASIN), 0439784549. If you copy the DetailPageURL into a browser, a web page about this book is displayed.
![]() | Tip |
|---|---|
An ASIN (Amazon Standard Item Number) is an alphanumeric token that uniquely identifies items for sale on Amazon. |
Submitting URLs in a browser provides a good demonstration of how Amazon Associates Web Service requests and responses work. This practice, however, is not appropriate for customer applications. The remainder of this section describes how to issue Amazon Associates Web Service requests programmatically. The next section describes how to process the responses programmatically.