2

After installing bottlenose and getting my API keys and associate tags I tried following the instructions in this guide: https://github.com/lionheart/bottlenose

(I have removed my api keys)

This is the error I am getting:

>>> import bottlenose
>>> amazon = bottlenose.Amazon(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_ASSOCIATE_TAG)
>>> response = amazon.ItemLookup(ItemId="B007OZNUCE")
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
response = amazon.ItemLookup(ItemId="B007OZNUCE")
File "C:\Users\Windows\AppData\Local\Programs\Python\Python35\lib\site-packages\bottlenose\api.py", line 265, in __call__
{'api_url': api_url, 'cache_url': cache_url})
File "C:\Users\Windows\AppData\Local\Programs\Python\Python35\lib\site-packages\bottlenose\api.py", line 226, in _call_api
return urllib2.urlopen(api_request, timeout=self.Timeout)
File "C:\Users\Windows\AppData\Local\Programs\Python\Python35\lib\urllib\request.py", line 162, in urlopen
return opener.open(url, data, timeout)
File"C:\Users\Windows\AppData\Local\Programs\Python\Python35\lib\urllib\request.py", line 471, in open
response = meth(req, response)
File"C:\Users\Windows\AppData\Local\Programs\Python\Python35\lib\urllib\request.py", line 581, in http_response
'http', request, response, code, msg, hdrs)
File"C:\Users\Windows\AppData\Local\Programs\Python\Python35\lib\urllib\request.py", line 509, in error
return self._call_chain(*args)
File"C:\Users\Windows\AppData\Local\Programs\Python\Python35\lib\urllib\request.py", line 443, in _call_chain
result = func(*args)
File"C:\Users\Windows\AppData\Local\Programs\Python\Python35\lib\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
Dan Loewenherz
  • 10,879
  • 7
  • 50
  • 81
sidni
  • 31
  • 2

2 Answers2

1

Check that you have the system clock correctly configured.

I have the same problem and I fixed it changing the date and time to the correct one.

H3ku
  • 43
  • 1
  • 7
0

You have to provide the value for keys

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • AWS_ASSOCIATE_TAG

In order to get the keys you have to register on AWS

Vardhman Patil
  • 517
  • 6
  • 22
  • i have these keys. I removed them to make this post. I did not want to paste my keys here. – sidni Oct 04 '16 at 22:33
  • i tried with another example. I didn't get any error. Please check that item id is present – Vardhman Patil Oct 05 '16 at 05:31
  • 1
    the item ID is present. I think the issue is with the associate tag. How can i fix this if this is the problem? – sidni Oct 05 '16 at 08:21
  • 1
    In my case I checked the three parameters and they're doing well via web using the scracthpad (my code using Ubuntu). – madtyn Nov 20 '17 at 12:03