Amazon api not returning results aligned with the amazon website results

Question:

I’m using the python-amazon-product-api to create a search bar which will return results similar to the results returned on the amazon site. However, when I do an itemSearch, as follows, I get some results, but it only returns products which are sold and shipped by amazon. I was wondering if anyone could help me fix this.

 root = api.item_search('All', Keywords=searchWord, ResponseGroup='Large', ItemPage=pageNo)
Asked By: iman453

||

Answers:

Try to set the ‘MerchantId’ parameter to ‘All’:

root = api.item_search('All', Keywords=searchWord, ResponseGroup='Large', ItemPage=pageNo, MerchantId='All')

If you don’t specify it, it will be defaulted to “Amazon”, which is why you see only Amazon’s products (please refer to the Item Search documentation for more information)


To answer your comment, here is the code I have tried out:

AWS_KEY = '...'
SECRET_KEY = '...'
searchWord = "Lenovo"
pageNo = "1"

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

result = api.item_search('All', Keywords=searchWord, ResponseGroup='Large', ItemPage=pageNo, MerchantId='All')
for item in result.Items.Item:
    print item.ItemAttributes.Title

This yields the following results (as of 05/28/2011)

  • Lenovo G560 Series 067999U Laptop (Black)
  • Lenovo G560 Series 0679ALU 15.6-Inch Laptop (Black)
  • Lenovo Multimedia Remote with Keyboard
  • Lenovo G560 Series 0679AKU 15.6-Inch Laptop (Black)
  • Lenovo Ideapad Z560 09143YU 15.6-Inch Laptop (Black)
  • Lenovo IdeaPad U260 08763DU 12.5-Inch Ultraportable Laptop (Clementine Orange)
  • Lenovo Ideacentre H405 77231AU Desktop (Black)
  • Lenovo ThinkPad 0578F7U Notebook – Core i3 i3-370M 2.4GHz – 14-Inch – […]
  • Lenovo G560 Series 0679AJU 15.6-Inch Laptop (Black)
  • Lenovo Ideapad G550 2958-9PU 15.6-Inch Laptop (Black)

This seems to be the exact 10 items that are currently showing up on the Amazon Search page you linked to in your comment.

Answered By: user635090
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.