akaszynski / keepa

Python Keepa.com API
https://keepaapi.readthedocs.io/en/latest/
Apache License 2.0
241 stars 77 forks source link

getting only 'REQUEST_REJECTED' responses today... #137

Closed petemyron closed 1 year ago

petemyron commented 1 year ago

No idea, what could have changed, but I've been getting only this REQUEST_REJECTED response from this sdk today. So far, I have:

I did not restart computers, but if that affected the outcome, I would consider retiring early.

What other things have you all experienced that I can also check?

an example request:

product_params = '
{
    "salesRankDrops30_gte": 50,
    "current_AMAZON_gte": -1,
    "current_AMAZON_lte": -1,
    "current_NEW_gte": -1,
    "current_NEW_lte": -1,
    "current_USED_gte": -1,
    "current_USED_lte": -1,
    "current_REFURBISHED_gte": -1,
    "current_REFURBISHED_lte": -1,
    "current_COLLECTIBLE_gte": -1,
    "current_COLLECTIBLE_lte": -1,
    "current_TRADE_IN_gte": -1,
    "current_TRADE_IN_lte": -1,
    "current_RENT_gte": -1,
    "current_RENT_lte": -1,
    "current_EBAY_NEW_SHIPPING_gte": -1,
    "current_EBAY_NEW_SHIPPING_lte": -1,
    "current_EBAY_USED_SHIPPING_gte": -1,
    "current_EBAY_USED_SHIPPING_lte": -1,
    "sort": [
        [
            "current_SALES",
            "asc"
        ]
    ],
    # "lastOffersUpdate_gte": 6491301,
    "productType": [
        0
    ],
    "perPage": 10,
    "page": 0
}'

called with

async def fetch_asins(product_params):
    api = await keepa.AsyncKeepa().create(KEEPA_API_KEY)
    return await api.product_finder(product_params)

asins = asyncio.run(fetch_asins(product_params))
petemyron commented 1 year ago

Looks like I didn't read closely enough. After recreating the request using requests, the error that's returned was combination of perPage and page exeeds limit. My params above were a lie--I actually had upped this to 20,000 perPage, which is above the allowed limit of 10,000... 🤦