redtoad/python-amazon-product-api

Fetching Items more than 10 Pages using item_search()

Closed this issue · 6 comments

Originally reported by ARUN KUMAR R (Bitbucket: arunkmarcse, GitHub: arunkmarcse)


Hi,

I have used 'Amazon In' locale and was exploring this python API. It seems to be working fine. But, i would like to fetch list of all products belonging to one specific category using search. I have used the below code and its working. But, it returns only upto 10 pages.
I can see result.pages value is 54957. can you please give an example code to iterate through all the items of all other pages?

#!python
from amazonproduct import API
api = API(locale='in')
result = api.item_search('Electronics',Keywords='Laptops', SearchIndex='Electronics')
for book in result:
    print "Page Number" +str(result.current)
    print book.ItemAttributes.Title

Original comment by Sebastian Rahlf (Bitbucket: basti, GitHub: basti)


While I would very much like to fix this problem somehow, I fear this cannot be done in a general and reliable way.

Original comment by ARUN KUMAR R (Bitbucket: arunkmarcse, GitHub: arunkmarcse)


Ok Thanks for the suggestion...I will work on it...

Original comment by Sebastian Rahlf (Bitbucket: basti, GitHub: basti)


If you refer to the official documentation, you'll find that you can only get the first 10 result pages. So I'm afraid, there is nothing to be done on the library side.

The only thing I can suggest is using alternating keywords or different BrowseNodeIDs in repeated searches.

Original comment by ARUN KUMAR R (Bitbucket: arunkmarcse, GitHub: arunkmarcse)


As i would need to collect all the items and store in the mysql database, please suggest me any other method. Is there any way that i can mention page number as argument to iterate for the next set of 10 pages or items?

Original comment by ARUN KUMAR R (Bitbucket: arunkmarcse, GitHub: arunkmarcse)


ok thats fine.. As i would need to collect all the items and store in the mysql database, please suggest me any other method. Is there any way that i can mention page number as argument to iterate for the next set of 10 pages or items?

Original comment by Sebastian Rahlf (Bitbucket: basti, GitHub: basti)


Unfortunately, 10 is all you get. They changed this some time ago in the API itself.