redtoad / python-amazon-product-api

A Python wrapper for the Amazon Product Advertising API. This module offers a light-weight access to the latest version of the Amazon Product Advertising API without getting in your way.
https://pypi.org/project/python-amazon-product-api/
BSD 3-Clause "New" or "Revised" License
3 stars 4 forks source link

AWSError: AWS.ParameterOutOfRange: The value you specified for ItemPage is invalid. Valid values must be between 1 and 10. while iterating over results #43

Closed redtoad closed 11 years ago

redtoad commented 11 years ago

Originally reported by Branko Vukelic (Bitbucket: brankovukelic, GitHub: Unknown)


I have a code like this:

for b in api.item_search('Books', Keywords="astrology", ResponseGroup='Large'):
    print b.__dict__

It returns 10 pages as of this posting. After 10 items have been returned, the exception is thrown.


redtoad commented 11 years ago

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


I'm assuming this is fixed?

redtoad commented 11 years ago

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


Try out the development version. It should be fixed there.

On an unrelated note: I should really make a new release...

redtoad commented 11 years ago

Original comment by Rolf Nelson (Bitbucket: rolfnelson, GitHub: rolfnelson)


Version 0.2.5 has 400 hard-coded

Although now that I look at the source code, setting b.limit = 10 on the item_search return value might work, so 400 is more 'defaulted' than 'hard-coded'.

Also, if 'b' means book in the example, the confusion might be that item_search returns pages, and not (as the (outdated?) docs suggest) individual items (like books) in 0.2.5.

redtoad commented 11 years ago

Original comment by Rolf Nelson (Bitbucket: rolfnelson, GitHub: rolfnelson)


I have the same problem. The page-limit for item searches has been 10 instead of 400 since about 2011. Version 0.2.5 has 400 hard-coded; as a work-around I'm just iterating through the pages with itertools.islice(api.item_search(...), 10) so I don't fall over the page limit.

redtoad commented 11 years ago

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


Can you post the complete traceback please? Also your locale for completeness.