Product Advertising API
Developer Guide (API Version 2013-08-01)

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

Example REST Requests

This section shows the steps to sign a request with example AWS credentials. You can also use the Product Advertising API Scratchpad to generate sample code for requests and responses. For more information, see Using the Product Advertising API Scratchpad.


  • AWS secret key: 1234567890

Follow these steps with these credentials to generate the same signature strings in the examples. This can help verify your request generation code. You cannot make actual requests with these example requests.


If you aren't familiar with REST requests, see Anatomy of a REST Request before continuing with this example.

The following is an example of an ItemLookup request: e&AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Operation=ItemLookup&ItemId =0679722769&ResponseGroup=ItemAttributes,Offers,Images,Reviews&Ve rsion=2013-08-01

Steps to Sign the Example Request

  1. Enter the time stamp. For this example, we'll use the UTC time 2014-08-18T12:00:00Z.,ItemAttributes,Offers,Reviews&Version=2013-08-01&Timestamp=2014-08-18T12:00:00Z
  2. URL encode the request's comma (,) and colon (:) characters, so that they don't get misinterpreted. For more information about converting to RFC 3986 specifications, see documentation and code samples for your programming language.


    Do not double-escape any characters.

  3. Split the parameter/value pairs and delete the ampersand characters (&). The linebreaks used in the following example follow Unix convention (ASCII 0A, "line feed" character).

    Service=AWSECommerceService AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE AssociateTag=mytag-20 Operation=ItemLookup ItemId=0679722769 ResponseGroup=Images%2CItemAttributes%2COffers%2CReviews Version=2013-08-01 Timestamp=2014-08-18T12%3A00%3A00Z
  4. Sort your parameter/value pairs by byte value (not alphabetically, lowercase parameters will be listed after uppercase ones).

    AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE AssociateTag=mytag-20 ItemId=0679722769 Operation=ItemLookup ResponseGroup=Images%2CItemAttributes%2COffers%2CReviews Service=AWSECommerceService Timestamp=2014-08-18T12%3A00%3A00Z Version=2013-08-01
  5. Rejoin the sorted parameter/value list with ampersands. The result is the canonical string that we'll sign:

  6. Prepend the following three lines (with line breaks) before the canonical string:

    GET /onca/xml
  7. The string to sign:

    GET /onca/xml AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&AssociateTag=mytag-20&ItemId=0679722769&Operation=ItemLookup&ResponseGroup=Images%2CItemAttributes%2COffers%2CReviews&Service=AWSECommerceService&Timestamp=2014-08-18T12%3A00%3A00Z&Version=2013-08-01
  8. Calculate an RFC 2104-compliant HMAC with the SHA256 hash algorithm using the string above with this example AWS secret key: 1234567890. For more information about this step, see documentation and code samples for your programming language.



    If you get 8fb6d93342d767d797799aee4ea5a6d8322f0d8554537c313cfa69fa25f1cd07, you need to convert it to binary and then to base64 format. Some libraries use hex instead of base64.

  9. URL encode the plus (+) and equal (=) characters in the signature:

  10. Add the URL encoded signature to your request, and the result is a properly-formatted signed request:

Examples of Other Signed Requests

The previous section went through a detailed process for signing an ItemLookup request. This section presents examples of unsigned requests, the string to sign generated from them, and the final signed request. These examples can make excellent test cases for your software. All examples use the example AWS secret key 1234567890 used earlier in the Steps to Sign the Example Request.

ItemSearch Examples

The following examples show the ItemSearch request without a signature, with the string to sign, and the signed request.

Original Unsigned Request,Offers,Images,Reviews,Variations&Version=2013-08-01&SearchIndex=DVD&Sort=salesrank&AssociateTag=mytag-20

String to Sign

GET /onca/xml AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Actor=Johnny%20Depp&AssociateTag=mytag-20&Operation=ItemSearch&Operation=ItemSearch&ResponseGroup=ItemAttributes%2COffers%2CImages%2CReviews%2CVariations&SearchIndex=DVD&Service=AWSECommerceService&Sort=salesrank&Timestamp=2014-08-18T17%3A34%3A34.000Z&Version=2013-08-01

Signed Request

CartCreate Examples

The following examples show the CartCreate request without a signature, with the string to sign, and the signed request.

Original Unsigned Request

String to Sign

GET /onca/xml AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&AssociateTag=mytag-20&Item.1.OfferListingId=j8ejq9wxDfSYWf2OCp6XQGDsVrWhl08GSQ9m5j%2Be8MS449BN1XGUC3DfU5Zw4nt%2FFBt87cspLow1QXzfvZpvzg%3D%3D&Item.1.Quantity=3&Operation=CartCreate&Operation=ItemSearch&Service=AWSECommerceService&Timestamp=2014-08-18T17%3A36%3A55.000Z&Version=2013-08-01

Signed Request

BrowseNodeLookup Examples

The following examples show the BrowseNodeLookup request without a signature, with the string to sign, and the signed request.

Original Unsigned Request,TopSellers,NewReleases,MostWishedFor,MostGifted

String to Sign

GET /onca/xml AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&AssociateTag=mytag-20&BrowseNodeId=465600&Operation=BrowseNodeLookup&Operation=ItemSearch&ResponseGroup=BrowseNodeInfo%2CTopSellers%2CNewReleases%2CMostWishedFor%2CMostGifted&Service=AWSECommerceService&Timestamp=2014-08-18T17%3A38%3A12.000Z&Version=2013-08-01

Signed Request

SimilarityLookup Examples

The following examples show the SimilarityLookup request without a signature, with the string to sign, and the signed request.

Original Unsigned Request,B000NK8EWI&Version=2013-08-01&AssociateTag=mytag-20&ResponseGroup=Offers,ItemAttributes&SimilarityType=Intersection&Condition=New&Merchant=Amazon

String to Sign

GET /onca/xml AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&AssociateTag=mytag-20&Condition=New&ItemId=B0011ZK6PC%2CB000NK8EWI&Merchant=Amazon&Operation=ItemSearch&Operation=SimilarityLookup&ResponseGroup=Offers%2CItemAttributes&Service=AWSECommerceService&SimilarityType=Intersection&Timestamp=2014-08-18T17%3A39%3A22.000Z&Version=2013-08-01

Signed Request