A delay of 1 second per request is not enough for 3600 per hour

The Amazon API limit is apparently 1 second per second, or 3,600 per hour. So I implemented it like this:

while True:
    #sql stuff
    time.sleep(1)
    result = api.item_lookup(row[0], ResponseGroup='Images,ItemAttributes,Offers,OfferSummary', IdType='EAN', SearchIndex='All')
    #sql stuff

Error:

amazonproduct.errors.TooManyRequests: RequestThrottled: AWS Access Key ID: ACCESS_KEY_REDACTED. You are sending requests too fast. Try again at a lower speed.

Any ideas why?

+4
source share
2 answers

This code looks correct, and it looks like 1 request / second limit is still relevant: http://docs.aws.amazon.com/AWSECommerceService/latest/DG/TroubleshootingApplications.html#efficiency-guidelines

, . , , VM , , , , -, , .

, , , " / ", TCP. extra_delay = 0. , extra_delay += 1 sleep(1 + extra_delay), . , extra_delay = extra_delay * 0.9.

+1

, " " (fooobar.com/questions/167037/...). , , .

, Amazon API , . , , , , , "1-" . , Amazon , , , , , +/- 5%. , , , ACCESS_KEY_REDACTED.

, .

API Amazon ? 5 ? 2- 200% , . , Amazon , .

"". API (, SLEEP = 2), . , , , .

,

, API , . , , , Amazon API .

? Amazon SQS . , Amazon Lambda.

0

Source: https://habr.com/ru/post/1655698/


All Articles