A simple Python wrapper for the Amazon.com Product Advertising API ⛺

Overview

Amazon Simple Product API

A simple Python wrapper for the Amazon.com Product Advertising API.

Build Status Documentation Status Coverage Status PyPI version PyPI - License PyPI - Downloads PyPI - Python Version Code Shelter

Features

  • An object oriented interface to Amazon products
  • Supports both item search and item lookup
  • Compatible with Google App Engine

Dependencies

Before you get started, make sure you have:

  • Installed Bottlenose (pip install bottlenose)
  • Installed lxml (pip install lxml)
  • Installed dateutil (pip install python-dateutil)
  • An Amazon Product Advertising account
  • An AWS account

Installation

 pip install python-amazon-simple-product-api

Usage

Lookup:

 >>> from amazon.api import AmazonAPI
 >>> amazon = AmazonAPI(AMAZON_ACCESS_KEY, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG)
 >>> product = amazon.lookup(ItemId='B00EOE0WKQ')
 >>> product.title
 'Amazon Fire Phone, 32GB (AT&T)'
 >>> product.price_and_currency
 (199.0, 'USD')
 >>> product.ean
 '0848719035209'
 >>> product.large_image_url
 'http://ecx.images-amazon.com/images/I/51BrZzpkWrL.jpg'
 >>> product.get_attribute('Publisher')
 'Amazon'
 >>> product.get_attributes(['ItemDimensions.Width', 'ItemDimensions.Height'])
 {'ItemDimensions.Width': '262', 'ItemDimensions.Height': '35'}

(the API wrapper also supports many other product attributes)

Lookup on amazon.de instead of amazon.com by setting the region:

 >>> from amazon.api import AmazonAPI
 >>> import bottlenose.api
 >>> region_options = bottlenose.api.SERVICE_DOMAINS.keys()
 >>> region_options
 ['US', 'FR', 'CN', 'UK', 'IN', 'CA', 'DE', 'JP', 'IT', 'ES']
 >>> amazon_de = AmazonAPI(AMAZON_ACCESS_KEY, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG, region="DE")
 >>> product = amazon_de.lookup(ItemId='B0051QVF7A')
 >>> product.title
 u'Kindle, WLAN, 15 cm (6 Zoll) E Ink Display, deutsches Men\xfc'
 >>> product.price_and_currency
 (99.0, 'EUR')

Bulk lookup requests are also supported:

 >>> from amazon.api import AmazonAPI
 >>> amazon = AmazonAPI(AMAZON_ACCESS_KEY, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG)
 >>> products = amazon.lookup(ItemId='B00KC6I06S,B005DOK8NW,B00TSUGXKE')
 >>> len(products)
 5
 >>> products[0].asin
 'B0051QVESA'

If you'd rather get an empty list intead of exceptions use lookup_bulk() instead.

Search:

 >>> from amazon.api import AmazonAPI
 >>> amazon = AmazonAPI(AMAZON_ACCESS_KEY, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG)
 >>> products = amazon.search(Keywords='kindle', SearchIndex='All')
 >>> for i, product in enumerate(products):
 >>>     print "{0}. '{1}'".format(i, product.title)
 0. 'Kindle, Wi-Fi, 6" E Ink Display - includes Special Offers & Sponsored Screensavers'
 1. 'Kindle Fire, Full Color 7" Multi-touch Display, Wi-Fi'
 2. 'Kindle US Power Adapter (Not included with Kindle or Kindle Touch)'
 3. 'Kindle Touch, Wi-Fi, 6" E Ink Display - includes Special Offers & Sponsored Screensavers'
 4. 'Kindle Keyboard 3G, Free 3G + Wi-Fi, 6" E Ink Display - includes Special Offers & Sponsored Screensavers'
 5. 'Kindle Touch 3G, Free 3G + Wi-Fi, 6" E Ink Display - includes Special Offers & Sponsored Screensavers'
 ...
 49. 'Kindle Wireless Reading Device (6" Display, U.S. Wireless)'

The search method returns an iterable that will iterate through all products, on all pages available. Additional pages are retrieved automatically as needed. Keep in mind that Amazon limits the number of pages it makes available.

Valid values of SearchIndex are: 'All','Apparel','Appliances','ArtsAndCrafts','Automotive', 'Baby','Beauty','Blended','Books','Classical','Collectibles','DVD','DigitalMusic','Electronics', 'GiftCards','GourmetFood','Grocery','HealthPersonalCare','HomeGarden','Industrial','Jewelry', 'KindleStore','Kitchen','LawnAndGarden','Marketplace','MP3Downloads','Magazines','Miscellaneous', 'Music','MusicTracks','MusicalInstruments','MobileApps','OfficeProducts','OutdoorLiving','PCHardware', 'PetSupplies','Photo','Shoes','Software','SportingGoods','Tools','Toys','UnboxVideo','VHS','Video', 'VideoGames','Watches','Wireless','WirelessAccessories'

There is also a convenience method to search and return a list of the first N results:

 >>> from amazon.api import AmazonAPI
 >>> amazon = AmazonAPI(AMAZON_ACCESS_KEY, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG)
 >>> products = amazon.search_n(1, Keywords='kindle', SearchIndex='All')
 >>> len(products)
 1
 >>> products[0].title
 'Kindle, Wi-Fi, 6" E Ink Display - includes Special Offers & Sponsored Screensavers'

Similarity Lookup:

 >>> from amazon.api import AmazonAPI
 >>> amazon = AmazonAPI(AMAZON_ACCESS_KEY, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG)
 >>> products = amazon.similarity_lookup(ItemId='B0051QVESA,B005DOK8NW')
 >>> len(products)
 4

Browse Node Lookup:

 >>> from amazon.api import AmazonAPI
 >>> amazon = AmazonAPI(AMAZON_ACCESS_KEY, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG)
 >>> bn = amazon.browse_node_lookup(BrowseNodeId=2642129011)
 >>> bn.name
 'eBook Readers'

Create and manipulate Carts:

 >>> from amazon.api import AmazonAPI
 >>> amazon = AmazonAPI(AMAZON_ACCESS_KEY, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG)     
 >>> product = amazon.lookup(ItemId="B0016J8AOC")
 >>> item = {'offer_id': product.offer_id, 'quantity': 1}
 >>> cart = amazon.cart_create(item)
 >>> fetched_cart = amazon.cart_get(cart.cart_id, cart.hmac)
 >>> another_product = amazon.lookup(ItemId='0312098286')
 >>> another_item = {'offer_id': another_product.offer_id, 'quantity': 1}
 >>> another_cart = amazon.cart_add(another_item, cart.cart_id, cart.hmac)     
 >>> cart_item_id = None
 >>> for item in cart:
 >>>     cart_item_id = item.cart_item_id
 >>> modify_item = {'cart_item_id': cart_item_id, 'quantity': 3}
 >>> modified_cart = amazon.cart_modify(item, cart.cart_id, cart.hmac)     
 >>> cleared_cart = amazon.cart_clear(cart.cart_id, cart.hmac)

For the 'Books' SearchIndex a Power Search option is avaialble:

 >>> products = amazon.search(Power="subject:history and (spain or mexico) and not military and language:spanish",SearchIndex='Books')

For more information about these calls, please consult the Product Advertising API Developer Guide.

Tests

To run the test suite please follow these steps:

  • Make sure Nose is installed: (pip install nose)
  • Create a local file named: test_settings.py with the following variables set to the relevant values: AMAZON_ACCESS_KEY, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG
  • Run nosetests

Pull Requests

  • All code should be unit tested
  • All tests must pass
  • Source code should be PEP8 complient
  • Coverage shouldn't decrease
  • All Pull Requests should be rebased against master before submitting the PR

This project is looking for core contributors. Please message me.

License

Copyright © 2012 Yoav Aviram

See LICENSE for details.

Comments
  • PAAPI 5.0

    PAAPI 5.0

    opened by tinohager 25
  • SSL Error

    SSL Error

    Receiving this error:

    Traceback (most recent call last):
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1318, in do_open
        encode_chunked=req.has_header('Transfer-encoding'))
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1239, in request
        self._send_request(method, url, body, headers, encode_chunked)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1285, in _send_request
        self.endheaders(body, encode_chunked=encode_chunked)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1234, in endheaders
        self._send_output(message_body, encode_chunked=encode_chunked)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1026, in _send_output
        self.send(msg)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 964, in send
        self.connect()
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1400, in connect
        server_hostname=server_hostname)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 407, in wrap_socket
        _context=self, _session=session)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 814, in __init__
        self.do_handshake()
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 1068, in do_handshake
        self._sslobj.do_handshake()
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 689, in do_handshake
        self._sslobj.do_handshake()
    ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<pyshell#15>", line 1, in <module>
        products = amazon.search_n(1, Keywords='kindle', SearchIndex='All')
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/amazon/api.py", line 288, in search_n
        return list(islice(items, n))
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/amazon/api.py", line 544, in __iter__
        for page in self.iterate_pages():
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/amazon/api.py", line 561, in iterate_pages
        yield self._query(ItemPage=self.current_page, **self.kwargs)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/amazon/api.py", line 573, in _query
        response = self.api.ItemSearch(ResponseGroup=ResponseGroup, **kwargs)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bottlenose/api.py", line 274, in __call__
        {'api_url': api_url, 'cache_url': cache_url})
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bottlenose/api.py", line 235, in _call_api
        return urllib2.urlopen(api_request, timeout=self.Timeout)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 223, in urlopen
        return opener.open(url, data, timeout)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 526, in open
        response = self._open(req, data)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 544, in _open
        '_open', req)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
        result = func(*args)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1361, in https_open
        context=self._context, check_hostname=self._check_hostname)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1320, in do_open
        raise URLError(err)
    urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)>
    
    

    Any Idea how to resolve this?

    opened by ChrisPotts 15
  • HTTP Error 503: Service Unavailable

    HTTP Error 503: Service Unavailable

    I am new to Python and web scraping. I was wondering this is because I am submitting requests too quickly and my requests are being throttled. However I do not know how to deal with the problem and get the price list for 8000 items.

    This is my code, and I have 8000 ItemId in 'ISBN_final_list'.

    price_and_currency_list = [] for each in ISBN_final_list: product = amazon.lookup(ItemId=each) price_and_currency = product.price_and_currency price_and_currency_list.append(price_and_currency)

    opened by Yanan95 14
  • HTTP Error 400 when viewing CA region

    HTTP Error 400 when viewing CA region

    When I try looking up a product on US it works. But when I try to set the region to CA It returns even if the ItemID does exist on amazon.ca:

    urllib.error.HTTPError: HTTP Error 400: Bad Request

    If I test on other regions, it also still works. (assuming the id is valid) So it appears to only not work on canada.

    opened by LucasCoderT 7
  • urllib2.HTTPError: HTTP Error 503: Service Unavailable

    urllib2.HTTPError: HTTP Error 503: Service Unavailable

    I'm getting this error on my gcloud app which runs python 2.7.16 Same error occurs on python 3.7.1 when executing the command line demo of the documentation

    >>> amazon.lookup(ItemId='B07MFZY2F2') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python27\lib\site-packages\amazon\api.py", line 174, in lookup response = self.api.ItemLookup(ResponseGroup=ResponseGroup, **kwargs) File "C:\Python27\lib\site-packages\bottlenose\api.py", line 274, in __call__ {'api_url': api_url, 'cache_url': cache_url}) File "C:\Python27\lib\site-packages\bottlenose\api.py", line 235, in _call_api return urllib2.urlopen(api_request, timeout=self.Timeout) File "C:\Python27\lib\urllib2.py", line 154, in urlopen return opener.open(url, data, timeout) File "C:\Python27\lib\urllib2.py", line 435, in open response = meth(req, response) File "C:\Python27\lib\urllib2.py", line 548, in http_response 'http', request, response, code, msg, hdrs) File "C:\Python27\lib\urllib2.py", line 473, in error return self._call_chain(*args) File "C:\Python27\lib\urllib2.py", line 407, in _call_chain result = func(*args) File "C:\Python27\lib\urllib2.py", line 556, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) urllib2.HTTPError: HTTP Error 503: Service Unavailable

    opened by Karlheinzniebuhr 5
  • Adding to cart

    Adding to cart

    The code for adding items to the cart raises an error if there are more than qty10 added. Is there a reason for this?

    A popular way to read inventory levels of listings is to add qty999 to the cart, which amazon lowers to the actual amount on hand.

    I am just wondering the reason for the limit of 10.

    Thanks, Jason

    opened by JasonCrowe 5
  • Batch Requests

    Batch Requests

    Is there a way to do a search for multiple items in a single request (batch requests)?. This is very important because of amazon's one second rule. It does look like some one has implemented it elsewhere as I found this forum post.

    opened by ghost 5
  • working only for ES,FR,IT

    working only for ES,FR,IT

    
    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.

    opened by andreabisello 3
  • Empty title

    Empty title

    I haven't spent much time debugging this but it appears some titles are retuned empty while they are not from the Amazon product API

    product = AmazonAPI(AMAZON_ACCESS_KEY, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG, region="UK").lookup(ItemId='B00PK4LLLS')
    print product.title
    

    this prints None

    product on amazon.co.uk https://www.amazon.co.uk/Downton-Abbey-Moorland-Holiday-Christmas/dp/B00PK4LLLS

    Version: 2.2.11

    opened by CosmicAnalogue465 3
  • 400 request error with provided example

    400 request error with provided example

    After running the sample commands provided in the documentation, `from amazon.api import AmazonAPI

    amazon = AmazonAPI(AMAZON_ACCESS_KEY, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG)

    product = amazon.lookup(ItemId='B00EOE0WKQ')`

    I'm getting this error:

    product = amazon.lookup(ItemId='B00EOE0WKQ') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/site-packages/amazon/api.py", line 174, in lookup response = self.api.ItemLookup(ResponseGroup=ResponseGroup, **kwargs) File "/usr/local/lib/python2.7/site-packages/bottlenose/api.py", line 265, in __call__ {'api_url': api_url, 'cache_url': cache_url}) File "/usr/local/lib/python2.7/site-packages/bottlenose/api.py", line 226, in _call_api return urllib2.urlopen(api_request, timeout=self.Timeout) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen return opener.open(url, data, timeout) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 435, in open response = meth(req, response) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 548, in http_response 'http', request, response, code, msg, hdrs) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 473, in error return self._call_chain(*args) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain result = func(*args) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 556, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) urllib2.HTTPError: HTTP Error 400: Bad Request

    I have the latest python 2.9.13 and all packages with the latest versions also.

    opened by Karlheinzniebuhr 3
  • ImportError: No module named amazon.api

    ImportError: No module named amazon.api

    After running the install via the pip command, opening a new console window with python and trying to run the import command from amazon.api import AmazonAPI I get ImportError: No module named amazon.api

    opened by Karlheinzniebuhr 3
  • Updated README

    Updated README

    This module no longer works since Amazon updated its API, so I've added a warning message and a link to my module to help people find it. It would be nice if you could apply this pull request.

    opened by sergioteula 0
  • HTTP Error 410: Gone. Using outdated API?

    HTTP Error 410: Gone. Using outdated API?

    Thanks for this module! I have been trying my first steps today, by my requests produce an error:

    HTTPError: HTTP Error 410: Gone
    

    When I login to PartnerNet, I currently see a huge red notification telling everyone that the API v4 has been discontinued since 31 March, 2020 (which was 5 weeks ago as I am typing this).

    Is it possible the module still uses API v5, which would explain the error?

    I'll try using the new API without the wrapper for now. But would be happy about any response, if this is indeed the issue.

    Detailed example below.


    from amazon.api import AmazonAPI
    
    # fill these in if you want to try the example
    secrets = {
      "access_key": "",
      "secret_key": "",
      "assoc_id": ""
    }
    
    amazon = AmazonAPI(secrets['access_key'], secrets['secret_key'], secrets['assoc_id'], region='US')
    
    products = amazon.search(Keywords='Tolkien', SearchIndex='All')
    
    for i, product in enumerate(products):
        print(f"{i}: f{product.title}")
    

    Output:

    ---------------------------------------------------------------------------
    HTTPError                                 Traceback (most recent call last)
    <ipython-input-9-cc24b8799447> in <module>
    ----> 1 for i, product in enumerate(products):
          2     print(f"{i}: f{product.title}")
    
    ~/projects/tolkien-stats/venv/lib/python3.6/site-packages/amazon/api.py in __iter__(self)
        542             Yields a :class:`~.AmazonProduct` for each result item.
        543         """
    --> 544         for page in self.iterate_pages():
        545             for item in getattr(page.Items, 'Item', []):
        546                 yield AmazonProduct(
    
    ~/projects/tolkien-stats/venv/lib/python3.6/site-packages/amazon/api.py in iterate_pages(self)
        559             while not self.is_last_page:
        560                 self.current_page += 1
    --> 561                 yield self._query(ItemPage=self.current_page, **self.kwargs)
        562         except NoMorePages:
        563             pass
    
    ~/projects/tolkien-stats/venv/lib/python3.6/site-packages/amazon/api.py in _query(self, ResponseGroup, **kwargs)
        571             An lxml root element.
        572         """
    --> 573         response = self.api.ItemSearch(ResponseGroup=ResponseGroup, **kwargs)
        574         root = objectify.fromstring(response)
        575         if (hasattr(root.Items.Request, 'Errors') and
    
    ~/projects/tolkien-stats/venv/lib/python3.6/site-packages/bottlenose/api.py in __call__(self, **kwargs)
        272         # make the actual API call
        273         response = self._call_api(api_url,
    --> 274                                   {'api_url': api_url, 'cache_url': cache_url})
        275 
        276         # decompress the response if need be
    
    ~/projects/tolkien-stats/venv/lib/python3.6/site-packages/bottlenose/api.py in _call_api(self, api_url, err_env)
        233                 else:
        234                     # the simple way
    --> 235                     return urllib2.urlopen(api_request, timeout=self.Timeout)
        236             except:
        237                 if not self.ErrorHandler:
    
    /usr/lib/python3.6/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)
        221     else:
        222         opener = _opener
    --> 223     return opener.open(url, data, timeout)
        224 
        225 def install_opener(opener):
    
    /usr/lib/python3.6/urllib/request.py in open(self, fullurl, data, timeout)
        530         for processor in self.process_response.get(protocol, []):
        531             meth = getattr(processor, meth_name)
    --> 532             response = meth(req, response)
        533 
        534         return response
    
    /usr/lib/python3.6/urllib/request.py in http_response(self, request, response)
        640         if not (200 <= code < 300):
        641             response = self.parent.error(
    --> 642                 'http', request, response, code, msg, hdrs)
        643 
        644         return response
    
    /usr/lib/python3.6/urllib/request.py in error(self, proto, *args)
        568         if http_err:
        569             args = (dict, 'default', 'http_error_default') + orig_args
    --> 570             return self._call_chain(*args)
        571 
        572 # XXX probably also want an abstract factory that knows when it makes
    
    /usr/lib/python3.6/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args)
        502         for handler in handlers:
        503             func = getattr(handler, meth_name)
    --> 504             result = func(*args)
        505             if result is not None:
        506                 return result
    
    /usr/lib/python3.6/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs)
        648 class HTTPDefaultErrorHandler(BaseHandler):
        649     def http_error_default(self, req, fp, code, msg, hdrs):
    --> 650         raise HTTPError(req.full_url, code, msg, hdrs, fp)
        651 
        652 class HTTPRedirectHandler(BaseHandler):
    
    HTTPError: HTTP Error 410: Gone
    
    opened by floriandotpy 3
  • Request: include unthrottled support?

    Request: include unthrottled support?

    Sadly as I'm sure many of you know if you don't generate sales within 30 days your access if removed.

    Luckily an amazing cache has been created here: https://www.commercedna.com/ is it possible to integrate this into the project?

    opened by LukePrior 0
  • Update the ItemIDs in the examples on the PyPi project page

    Update the ItemIDs in the examples on the PyPi project page

    https://pypi.org/project/python-amazon-simple-product-api/

    Some of ItemIDs are for products that no longer exist:

    • B00EOE0WKQ
    • B0051QVESA

    Consequently, when the example code is run, it throws this error: raise AsinNotFound("ASIN(s) not found: '{0}'".format(amazon.api.AsinNotFound: ASIN(s) not found

    For the sake of making things easier, it would be nice to update them with products that still exist.

    opened by Pikamander2 2
  • oorel@mash2527:~$sudo pip install python-amazon-simple-product-api

    oorel@mash2527:~$sudo pip install python-amazon-simple-product-api

    oorel@mash2527:~$ oorel@mash2527:~$sudo pip install python-amazon-simple-product-api Requirement already satisfied (use --upgrade to upgrade): python-amazon-simple-product-api in /usr/local/lib/python2.7/dist-packages Requirement already satisfied (use --upgrade to upgrade): bottlenose in /usr/local/lib/python2.7/dist-packages (from python-amazon-simple-product-api) Downloading/unpacking lxml (from python-amazon-simple-product-api) Downloading lxml-4.3.3.tar.gz (4.4MB): 4.4MB downloaded Running setup.py (path:/tmp/pip_build_root/lxml/setup.py) egg_info for package lxml Building lxml version 4.3.3. Building without Cython. ERROR: /bin/sh: 1: xslt-config: not found

    ** make sure the development packages of libxml2 and libxslt are installed **
    
    Using build configuration of libxslt
    
    warning: no previously-included files found matching '*.py'
    

    Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /usr/local/lib/python2.7/dist-packages (from python-amazon-simple-product-api) Installing collected packages: lxml Running setup.py install for lxml Building lxml version 4.3.3. Building without Cython. ERROR: /bin/sh: 1: xslt-config: not found

    ** make sure the development packages of libxml2 and libxslt are installed **
    
    Using build configuration of libxslt
    building 'lxml.etree' extension
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DCYTHON_CLINE_IN_TRACEBACK=0 -Isrc -Isrc/lxml/includes -I/usr/include/python2.7 -c src/lxml/etree.c -o build/temp.linux-x86_64-2.7/src/lxml/etree.o -w
    src/lxml/etree.c:97:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    Compile failed: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    cc -I/usr/include/libxml2 -c /tmp/xmlXPathInitZXlX0g.c -o tmp/xmlXPathInitZXlX0g.o
    /tmp/xmlXPathInitZXlX0g.c:1:26: fatal error: libxml/xpath.h: No such file or directory
     #include "libxml/xpath.h"
                              ^
    compilation terminated.
    *********************************************************************************
    Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
    *********************************************************************************
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-v84ZR4-record/install-record.txt --single-version-externally-managed --compile:
    Building lxml version 4.3.3.
    

    Building without Cython.

    ERROR: /bin/sh: 1: xslt-config: not found

    ** make sure the development packages of libxml2 and libxslt are installed **

    Using build configuration of libxslt

    running install

    running build

    running build_py

    creating build

    opened by olegorel 1
Owner
Yoav Aviram
Business Innovator, Entrepreneur, Investor, Independent Academic, Activist
Yoav Aviram
Script to get a notification when a product, on Amazon Warehouse, is available within a target price

Amazon_Warehouse_Scraping This script aims to scrape Amazon Warehouse and send an email back if there are products whose price matches with the target

null 2 Oct 25, 2021
An Amazon Price Tracker app helps you to buy which product you want within sale price by sending an E-Mail.

Amazon Price Tracker An Amazon Price Tracker app helps you to buy which product you want within sale price by sending an E-Mail. Installing Download t

Aytaç Kaşoğlu 2 Feb 10, 2022
Live Coding - Mensageria na AWS com Amazon SNS e Amazon SQS

Live Coding - Mensageria na AWS com Amazon SNS e Amazon SQS Repositório para o Live Coding do dia 08/12/2021 Serviços utilizados Amazon SNS Amazon SQS

Cassiano Ricardo de Oliveira Peres 3 Mar 1, 2022
🚀 An asynchronous python API wrapper meant to replace discord.py - Snappy discord api wrapper written with aiohttp & websockets

Pincer An asynchronous python API wrapper meant to replace discord.py ❗ The package is currently within the planning phase ?? Links |Join the discord

Pincer 125 Dec 26, 2022
Python script to harvest tweets with the Twitter API V2 Academic Research Product Track

Tweet harvester Python script to scrape, collect, and/or harvest tweets with the Twitter API V2 Academic Research Product Track. Important note: In or

Thomas Frissen 2 Nov 11, 2021
PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.

PRAW: The Python Reddit API Wrapper PRAW, an acronym for "Python Reddit API Wrapper", is a Python package that allows for simple access to Reddit's AP

Python Reddit API Wrapper Development 3k Dec 29, 2022
PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.

PRAW: The Python Reddit API Wrapper PRAW, an acronym for "Python Reddit API Wrapper", is a Python package that allows for simple access to Reddit's AP

Python Reddit API Wrapper Development 3k Dec 29, 2022
A simple Python API wrapper for Cloudflare Stream's API.

python-cloudflare-stream A basic Python API wrapper for working with Cloudflare Stream. Arbington.com started off using Cloudflare Stream. We used the

Arbington 3 Sep 8, 2022
Aws-lambda-requests-wrapper - Request/Response wrapper for AWS Lambda with API Gateway

AWS Lambda Requests Wrapper Request/Response wrapper for AWS Lambda with API Gat

null 1 May 20, 2022
The unofficial Amazon search CLI & Python API

amzSear The unofficial Amazon Product CLI & API. Easily search the amazon product directory from the command line without the need for an Amazon API k

Asher Silvers 95 Nov 11, 2022
A simple API wrapper for the Tenor API

Gifpy A simple API wrapper for the Tenor API Installation Python 3.9 or higher is recommended python3 -m pip install gifpy Clone repository: $ git cl

Juan Ignacio Battiston 4 Dec 22, 2021
Integrating Amazon API Gateway private endpoints with on-premises networks

Integrating Amazon API Gateway private endpoints with on-premises networks Read the blog about this application: Integrating Amazon API Gateway privat

AWS Samples 12 Sep 9, 2022
HTTP Calls to Amazon Web Services Rest API for IoT Core Shadow Actions 💻🌐💡

aws-iot-shadow-rest-api HTTP Calls to Amazon Web Services Rest API for IoT Core Shadow Actions ?? ?? ?? This simple script implements the following aw

AIIIXIII 3 Jun 6, 2022
A simple library for interacting with Amazon S3.

BucketStore is a very simple Amazon S3 client, written in Python. It aims to be much more straight-forward to use than boto3, and specializes only in

Jacobi Petrucciani 219 Oct 3, 2022
🤖 Fast and simple bot to transform links from Amazon into a nice post with your referral link in Telegram 🛒

AmazonBot ?? Fast and simple bot to transform links from Amazon into a nice post with your referral link in Telegram ?? Prerequisites You need Python

Alternative Profit 3 Dec 25, 2022
Python API wrapper around Trello's API

A wrapper around the Trello API written in Python. Each Trello object is represented by a corresponding Python object. The attributes of these objects

Richard Kolkovich 904 Jan 2, 2023
Async ready API wrapper for Revolt API written in Python.

Mutiny Async ready API wrapper for Revolt API written in Python. Installation Python 3.9 or higher is required To install the library, you can just ru

null 16 Mar 29, 2022
A Python API wrapper for the Twitter API!

PyTweet PyTweet is an api wrapper made for twitter using twitter's api version 2! Installation Windows py3 -m pip install PyTweet Linux python -m pip

TheFarGG 1 Nov 19, 2022