amazon-product-api icon indicating copy to clipboard operation
amazon-product-api copied to clipboard

You are submitting requests too quickly. Please retry your requests at a slower rate

Open dheekshas opened this issue 7 years ago • 8 comments

I am getting this error though I am not making multiple calls at a time. My first call itself has thrown this error as per my log. Same API call is working after some time. Please guide me how to solve this issue.

Function usage:

var client = amazon.createClient({ awsId: "XXXXXXXXXXXXXXXXXXX", awsSecret: "YYYYYYYYYYYYYYYYYYYYYYY", awsTag: "ZZZZZZZZZZZZZZ" });

console.log("Before making Amazon API"); client.itemLookup({ idType: 'ASIN', itemId: BBBBBBBBBB, //This is valid amazon ASIN id domain: 'webservices.amazon.in' }).then(function (results) { var result = JSON.stringify(results); console.log("amaz success" + result);

    res.send(result);
}).catch(function (err) {
console.log("amaz error" + err);
var result = JSON.stringify(err);
result = "ErrorOccured" + result;
    res.send(result);        
});

Error:

{"$":{"xmlns":"http://ecs.amazonaws.com/doc/2013-08-01/"},"Error":[{"Code":["RequestThrottled"],"Message":["AWS Access Key ID: XXXXXXXXXXXXXXXX. You are submitting requests too quickly. Please retry your requests at a slower rate."]}],"RequestID":["5b1b2a16-1870-4884-9543-26d463955d94"]}"

dheekshas avatar Nov 18 '17 10:11 dheekshas

Same issue, and i'm running code manually, very slowly. Here there are some info about limit (http://docs.aws.amazon.com/AWSECommerceService/latest/DG/TroubleshootingApplications.html)

andreabisello avatar Dec 06 '17 20:12 andreabisello

Check this issue https://github.com/t3chnoboy/amazon-product-api/issues/37

masterT avatar Dec 06 '17 21:12 masterT

Same issue,

I only execute one request in my code:

const amazon = require('amazon-product-api');
const credentials = require('./credentials.json');

const client = amazon.createClient(credentials);

client.itemSearch({
    director: 'Quentin Tarantino',
    actor: 'Samuel L. Jackson',
    searchIndex: 'DVD',
    audienceRating: 'R',
    responseGroup: 'ItemAttributes,Offers,Images',
}).then((results) => {
    console.log('OK');
    console.log(results);
}).catch((err) => {
    console.log('ERROR');
    console.log(err.Error);
});

Error: [ { Code: [ 'RequestThrottled' ], Message: [ 'AWS Access Key ID: XXXXXXXXXXXXXXXXXXX. You are submitting requests too quickly. Please retry your requests at a slower rate.' ] } ]

50l3r avatar Jan 28 '19 16:01 50l3r

Solved adding the domain in request:

domain: 'webservices.amazon.es'

50l3r avatar Jan 28 '19 16:01 50l3r

how to add this

Deepjyoti120 avatar Apr 11 '19 08:04 Deepjyoti120

Solved using https://github.com/jhurliman/node-rate-limiter

Something like:

const RateLimiter = require('limiter').RateLimiter;
const limiter = new RateLimiter(1, 2000);

limiter.removeTokens(1, function() {
 client.itemLookup({...})
})

geremora avatar Apr 15 '19 01:04 geremora

Might be related to some changes made to their API operating agreement.

https://docs.aws.amazon.com/AWSECommerceService/latest/DG/TroubleshootingApplications.html

Note that your account will lose access to Product Advertising API if it has not generated referring sales for a consecutive 30-day period.

I also read that in order to qualify access you need to make three sales, although I can not find that at this time.

adampatterson avatar Sep 13 '19 01:09 adampatterson

Found it:

https://associates.amazon.ca/assoc_credentials/home

How do I get access to PA API? In order to qualify for requesting access to PA API, you will need an associate account, you will have to complete three qualifying sales in the first 180 days and you will have to comply with the Operating Agreement. Once your account has been approved as an associate account, you will see a 'Request for PA API access' button below. You can click the button to get access to PA API.

adampatterson avatar Sep 13 '19 01:09 adampatterson