How to get and set up the Amazon Affiliate API (PA API)

Wasabi Team
Wasabi Team

Many affiliates get their product data from the misnamed Amazon Associates API, which actual name is Amazon Product Advertising API (PA API).

To enjoy this API, you have to obtain the credentials first. Once you have them, you can take advantage of them on as many websites as you want.

How to get the Amazon Affiliate API

Sign up at Amazon Associates program (if you have not already).

Sign up as a Product Advertising API userby visiting the corresponding URL.

CountryProduct Advertising API URL
Brazilhttp://associados.amazon.com.br/gp/associates/apply/main.html
Canadahttps://associates.amazon.ca/gp/flex/advertising/api/sign-in.html
Chinahttps://associates.amazon.cn/gp/advertising/api/detail/main.html
Francehttps://partenaires.amazon.fr/gp/flex/advertising/api/sign-in.html
Germanyhttps://partnernet.amazon.de/gp/flex/advertising/api/sign-in.html
Indiahttps://affiliate-program.amazon.in/
Italyhttps://programma-affiliazione.amazon.it/gp/advertising/api/detail/main.html
Japanhttps://affiliate-program.amazon.com/gp/flex/advertising/api/sign-in-jp.html
Mexicohttps://afiliados.amazon.com.mx/gp/advertising/api/detail/main.html
Spainhttps://afiliados.amazon.es/gp/flex/advertising/api/sign-in.html
United Kingdomhttps://affiliate-program.amazon.co.uk/
United Stateshttps://affiliate-program.amazon.com/gp/flex/advertising/api/sign-in.html

Visit https://affiliate-program.amazon.com/ (or the URL from the country you signed up in)

Click on the menu ToolsProduct Advertising API

Amazon Affiliates API

Click on the “Manage Credentials” button.

Click on “Continue to Security Credentials” in the pop-up window.

PA API

Expand the “Access Keys (Access Key ID and Secret Access Key)” tab of the accordion.

There you will be able to see the keys you have already created or create a new one by clicking on the “Create an access key” button.

In the ” Create an Access Key” pop-up window, click on “Show Access Key” and write down the “Access Key ID” and “Secret Access Key“, as this is the data Wasabi will require to be able to connect with Amazon Product Advertising API. We also recommend clicking on “Download key file” to make a backup copy of the keys (remember to keep them in a safe place).

New API keys will start working 48 hours after their creation. You will be able to connect if you have tried to use them before, but you will not be able to get product data.

Note: remember that the maximum number of active keys is 2, but you can take advantage of them on as many websites as you want. We recommend writing down the keys when creating them, so in case you need them in the future, you will not have to deactivate a key to create a new one since you can reuse the old one.

How to set up Amazon Product Advertising API in Wasabi Theme

You must follow these steps to set up Wasabi with Amazon’s API:

Click on WasabiAffiliate in the WordPress menu

Click on Amazon Settings

Fill in the following fields:

  • API Key: corresponds to the “Access Key ID” value obtained in the previous step.
  • API secret: corresponds to the “Secret Access Key” value obtained in the previous step.
  • Associate Tag:corresponds to the “tracking ID” created in the Amazon affiliate panel (https://afiliados.amazon.com/home/account/tag/manage).
  • Country: This is the country where the products will be searched for and linked to from the generated affiliate links.
  • Cache Expiration Time: represents the time that requests to Amazon’s API remain in the cache. Thanks to this setting, we can increase the website’s loading speed, reduce the number of requests to Amazon API, and adjust it with the value that best suits your case, although the default value (86400) works in most cases.
  • Once you have completed all the data, press the blue “Publish” button to save the changes.

Amazon’s API Connection Errors

If you happen to experience connection errors when connecting Wasabi to Amazon’s API, it is almost always due to one of these issues:

⚠️ “Out of stock”, “No data available in the API” or a warning constantly popping up and indicating that Amazon could apply restrictions on the API’s usage.

Amazon sets some initial restrictions on the API’s usage. It “almost” does not allow to use it if the account has no sales. Usage limitations may be in place for this reason.

We say “almost” because if the account is new and there are no sales, you can use the API, more or less, but if the account is old and does not generate sales, even if you can connect to the API directly, it does not allow you to obtain product information.

Take a look at Amazon’s official API documentation, which says: If you do not sell anything within 30 days, you cannot get any data from the API(even though you can connect to it). So you have to ask yourself: Do I have a minimum affiliate income in that Amazon account?

You can test it yourself on:

AWS Paapi5 API scratchpad

In case restrictions apply, TooManyRequests should appear.

⚠️ Provider configuration is invalid

This error may appear for several reasons:

  • The API Key or API Secret is either not correct or disabled.
  • The Associate Tag does not exist or belongs to a different account from the one used to register the API keys.
  • The country selected in Wasabi does not correspond to the country of the affiliate account.

Solutions:

  • Make sure there is no blank space at the beginning or end of the API Key, API Secret, or Associate Tag. This is a common mistake when copying and pasting.
  • Is the API Key/Secret correct?
  • Is the API Key/Secret active? You can check its status here.
  • Is the Associate Tag correct?
  • Is the Associate Tag registered with the same account as the API Key?
  • Is the country selected in Wasabi the same as the one registered in the Associate Tag?
  • Does the server of your website meet the technical requirements established by Wasabi? For example, PHP 7.2 or higher with the mbstring, dom, json, libxml, curl, and iconv extensions enabled and up to date.
  • If the API key is old, it may no longer work with the new API connection. Try creating a new API Key/Secret.

You can check yourself if the setup is correct in:

⚠️ You just created the API Key, but it does not work

If you have just created the API key, you will have to wait up to 72 hours before you can start using it.

Also, according to Amazon’s official documentation, the initial usage limit allowed per day is 8,640 requests, and the limit for each account will be based on your product’s API revenue performance over the last 30 days.

Keep reading on: