amazon-advertising-apibottlenose

Error when use bottlenose


I have problems when I use bottlenose. According to its instructions, I need to add a error_handler as per instructions. in the instructions I placed the function:

def error_handler(err):
    ex = err['exception']
    if isinstance(ex, HTTPError) and ex.code == 404:
        time.sleep(random.expovariate(0.1))
        return True

The examples in the instruction says to use this line:

amazon = bottlenose.Amazon(ErrorHandler=error_handler)

I have this:

amazon = bottlenose.Amazon(AWSAccessKeyId=ACCESS_KEY_ID, AWSSecretAccessKey = SECRET_KEY,AssociateTag = ASSOC_TAG)

But I'm getting no correct response. Why?


Solution

  • Are you submitting requests too quickly? You need to slow down. One request per second is a good speed.

    The Amazon Product Advertising API returns errors in three categories so that you can easily determine how best to handle the problem: