yoavaviram / python-amazon-simple-product-api

A simple Python wrapper for the Amazon.com Product Advertising API ⛺
Apache License 2.0
817 stars 212 forks source link

Is this for python 2 or 3? #64

Closed filipe3x closed 8 years ago

filipe3x commented 9 years ago

I'm getting this error: HTTPError: HTTP Error 400: Bad Request

while using product = amazon.lookup(ItemId='B00IUICOF8')

ps: I'm using python 2.7

yoavaviram commented 8 years ago

Works for me. Can you provide more info? It's python 2 at the moment.

lukasklein commented 8 years ago

I'm getting the same error on Python 3.5 (saw that it should be supported by now) -- traceback below:

>>> amazon = AmazonAPI(settings.AWS_ACCESS_KEY_ID, settings.AWS_SECRET_ACCESS_KEY, settings.AMAZON_ASSOC_TAG)
>>> product = amazon.lookup(ItemId='B017T677K8')
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/local/lib/python3.5/site-packages/amazon/api.py", line 173, in lookup
    response = self.api.ItemLookup(ResponseGroup=ResponseGroup, **kwargs)
  File "/usr/local/lib/python3.5/site-packages/bottlenose/api.py", line 251, in __call__
    {'api_url': api_url, 'cache_url': cache_url})
  File "/usr/local/lib/python3.5/site-packages/bottlenose/api.py", line 212, in _call_api
    return urllib2.urlopen(api_request, timeout=self.Timeout)
  File "/usr/local/lib/python3.5/urllib/request.py", line 162, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/lib/python3.5/urllib/request.py", line 471, in open
    response = meth(req, response)
  File "/usr/local/lib/python3.5/urllib/request.py", line 581, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/local/lib/python3.5/urllib/request.py", line 509, in error
    return self._call_chain(*args)
  File "/usr/local/lib/python3.5/urllib/request.py", line 443, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.5/urllib/request.py", line 589, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request
avks commented 7 years ago

Same issue for me, too. Anyone solved it here?

edit: Okay, after a bit of looking up, I found that I didn't sign up for advertsing api access. Fixed once I signed up.