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

Best Programming Practices

The following checklist of best practices describes how you can increase the effectiveness of your Product Advertising API 4.0 applications.

Read the Product Advertising API Terms and Conditions

The Product Advertising API Terms and Conditions spell out in detail the limitations that Amazon enforces on all Product Advertising API applications. The thrust of all Product Advertising API applications should be to direct sales to Amazon and thus earn Associate sales commissions. If your application is designed around another purpose, please reconsider and make sure your proposed Product Advertising API application falls within the guidelines of the Product Advertising API Terms and Conditions. Applications that do not meet the Product Advertising API Terms and Conditions will be blocked from accessing Product Advertising API.

Use the Latest API Version

Product Advertising API makes frequent releases. Each release either adds functionality or increases the accuracy, speed, and stability of Product Advertising API.

The Product Advertising API uses the default API version 2013-08-01 unless you supply a different value for the Version parameter. To use a different version, you must include it in the Version parameter in your requests.

Product Advertising API 3.0 has been deprecated. Make sure you develop against Product Advertising API 4.0.

Understand Available Operations

Product Advertising API provides many different operations to facilitate product discovery. Using the right operations can dramatically enhance your customer’s shopping experience and increase your Associate commissions. See the API Reference for a full description of all Product Advertising API operations. Some enable you to:

Task Operations
Find products and categories ItemSearch, ItemLookup, and BrowseNodeLookup
Find similar items SimilarityLookup
Provide shopping cart functionality for your application or website CartCreate, CartAdd, CartModify, and CartGet

Use the Right Response Group

One of the great features of Product Advertising API is the control you have over the amount of information returned in responses. A response group is a collection of data returned by Product Advertising API. Product Advertising API has over 55 response groups, each serving a different need. So, you can get exactly the information you need and no more.

We recommend that you specify response groups that return only the information your application needs. Response groups, such as Large and ItemAttributes return lots of data. Such large data sets sometimes incur performance penalties both in Product Advertising API fulfilling the request and in your application’s processing of the response.

Use Your Associate Tag in Product Advertising API Requests

To earn commissions for selling Amazon items, you must register with Amazon as an Associate. In return, you receive an Associate tag, which identifies you. By including your Associate tag in each Product Advertising API request, you receive commissions for customer purchases.

Amazon also uses your Associate tag to monitor your use of Product Advertising API, which helps us determine how to improve our web service.

Handling Errors

Make sure your application handles errors gracefully. One way to do that is to check the status of the IsValid element. IsValid is returned with every request. If its value is “False,” there will be an error message with a description of why your request was not valid.

It’s generally a good practice to log any unexpected error that is returned by Product Advertising API. Errors are returned with an error code and message. The code is a descriptive string that identifies the error. The error message is a more ‘human friendly’ message that can be displayed to your customers. Your application should be able to handle expected error messages.

Your application, for example, should display error messages that are meaningful to the customer. For example, when Product Advertising API responds with the error, “AWS.ECommerceService.NoExactMatches,” your application should display an explanation, such as, “We did not find any matches for your request.”

If your application exceeds the number of allowed requests submitted per second, Product Advertising API returns a 503 error, which means that Product Advertising API is restricting the number of requests it is processing from your application. The Product Advertising API Terms and Conditions outline the number of allowed requests permitted per second.

Use Caches Carefully

Product Advertising API product data changes often. Prices can change hourly, Browsenode values change without notice, and product availability is volatile. For these reasons, you should not cache product data.

It is against the Product Advertising API Terms and Conditions to cache customer information derived from Amazon.

You can enhance the performance of your application by caching identifiers, such as the CartId, HMAC, and PurchaseURL.

Use the Correct AWSAccessKeyId

To become a Product Advertising API developer, you must retrieve your AWS credentials. Your credentials are a AWSAccessKeyId and a SecretKey. Every Product Advertising API request you submit must include the AWSAccessKeyId. Because your account is linked to your email address, Amazon can contact you easily. For more information, see Sign up for the Product Advertising API.