yoavaviram / python-amazon-simple-product-api

A simple Python wrapper for the Amazon.com Product Advertising API ⛺
Apache License 2.0
817 stars 212 forks source link

working only for ES,FR,IT #152

Closed andreabisello closed 5 years ago

andreabisello commented 5 years ago

region_options = bottlenose.api.SERVICE_DOMAINS.keys()
print(region_options)
for region in region_options:
    try:
        time.sleep(5)
        amazon = AmazonAPI(AMAZON_ACCESS_KEY, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG, region=region, MaxQPS=0.2)
        products = amazon.search_n(1,Keywords='kindle', SearchIndex='All')
        print("worked for " + region)
        for i, product in enumerate(products):
            print(product.title)
    except Exception as e:
        print("not working for " + region)
        print(e)
dict_keys(['CA', 'CN', 'DE', 'ES', 'FR', 'IN', 'IT', 'JP', 'UK', 'US', 'BR', 'MX'])
not working for CA
HTTP Error 503: Service Unavailable
not working for CN
HTTP Error 503: Service Unavailable
not working for DE
HTTP Error 400: Bad Request
worked for ES
Nuevo Kindle Paperwhite - Ahora resistente al agua y con el doble de almacenamiento - incluye ofertas especiales
worked for FR
Nouveau Kindle Paperwhite - Maintenant résistant à l'eau et avec deux fois plus d'espace de stockage - Avec offres spéciales
not working for IN
HTTP Error 400: Bad Request
worked for IT
Nuovo Kindle Paperwhite, resistente all’acqua e con il doppio dello spazio di archiviazione - Con offerte speciali
not working for JP
HTTP Error 503: Service Unavailable
not working for UK
HTTP Error 400: Bad Request
not working for US
HTTP Error 503: Service Unavailable
not working for BR
HTTP Error 503: Service Unavailable
not working for MX
HTTP Error 503: Service Unavailable

Process finished with exit code 0

i will try to take a look at the endpoint, maybe for these regions endpoints are different.

andreabisello commented 5 years ago

the problem is related with bottlenose. this library is based on bottlenose. i'm moving on bottlenose repository

andreabisello commented 5 years ago

it looks like a throttle issue, even making one call i got 503 for throttling . https://forums.aws.amazon.com/thread.jspa?messageID=887729

synweap15 commented 5 years ago

This is due to change in Amazon Policy, read here (section "Efficiency Guides"):

https://docs.aws.amazon.com/AWSECommerceService/latest/DG/TroubleshootingApplications.html