Volatil3
Volatil3

Reputation: 14978

Python: Invalid AWS Access key error

I am using the following example code to fetch details. And it's giving error:

amazonproduct.errors.InvalidClientTokenId: InvalidClientTokenId: The AWS Access Key Id you provided does not exist in our records.

The same is working while I used in PHP. I generated the key going to IAM Console.

access_key = '***'
secret_key = '***'
associate_tag = 'ptab-20'
api = API(locale='us')
    result = api.item_lookup('B006H3MIV8')
    for item in result.Items.Item:
        print '%s (%s)' % (item.ItemAttributes.Title, item.ASIN)

Upvotes: 0

Views: 668

Answers (1)

Muhammad Tahir
Muhammad Tahir

Reputation: 5184

Somehow python-amazon-product-api is not considering the config file i.e. ~/.amazon-product-api. Alternatively you can specify your credentials directly when instantiating API object by

api = API(AWS_KEY, SECRET_KEY, "us")

Upvotes: 2

Related Questions