Skip to main content

Amazon Product Advertising API 5.0 wrapper for Python

Project description

Amazon Product Advertising API 5.0 wrapper for Python

A simple Python wrapper for the last version of the Amazon Product Advertising API. This module allows to get product information from Amazon using the official API in an easier way. Like Bottlenose you can use cache reader and writer to limit the number of api calls.

PyPI Python License Support Amazon API PyPI - Wheel Documentation Status

Features

  • Object oriented interface for simple usage
  • Get multiple products at once
  • Configurable query caching
  • Compatible with Python versions 3.6 and up
  • Support for AU, BR, CA, FR, IN, IT, JP, MX, ES, TR, MX, AE, UK and US Amazon Product Advertising API endpoints
  • Configurable throttling for batches of queries
  • Ask for new features through the issues section.
  • Full documentation on Read the Docs

Installation

You can install or upgrade the module with:

pip install amazon-paapi5 --upgrade

Usage guide

Search items::

from amazon.paapi import AmazonAPI
amazon = AmazonAPI(KEY, SECRET, TAG, COUNTRY)
products = amazon.search_items(keywords='harry potter')
print(product['data'][0].image_large)
print(product['data'][1].prices.price)

Get multiple products information::

from amazon.paapi import AmazonAPI
amazon = AmazonAPI(KEY, SECRET, TAG, COUNTRY)
products = amazon.get_items(item_ids=['B01N5IB20Q','B01F9G43WU'])
print(products['data']['B01N5IB20Q'].image_large)
print(products['data']['B01F9G43WU'].prices.price)

Get variations::

from amazon.paapi import AmazonAPI
amazon = AmazonAPI(KEY, SECRET, TAG, COUNTRY)
products = amazon.get_variations(asin=['B01N5IB20Q','B01F9G43WU'])

Get browse nodes::

from amazon.paapi import AmazonAPI
amazon = AmazonAPI(KEY, SECRET, TAG, COUNTRY)
browseNodes = amazon.get_browse_nodes(browse_node_ids=['473535031'])

Use cache reader and writer::

from amazon.paapi import AmazonAPI

DATA = []

def custom_save_function(url, data, http_info):  
    DATA.append({'url':url, 'data': data, 'http_info':http_info}) 

def custom_retrieval_function(url):  
    for item in DATA:  
        if item["url"] == url: 
            return {'data':item['data'], 'http_info': item['http_info']}  
    return None

amazon = AmazonAPI(KEY, SECRET, TAG, COUNTRY, CacheReader=custom_retrieval_function, CacheWriter=custom_save_function) 
products = amazon.search_items(keywords='harry potter')

Changelog

Version 1.1.1
    - add additional parameters to api calls
Version 1.1.0
    - CacheReader and CacheWriter available for all the search functions
    - Defintion af AmazonException to get exceptions during the api calls
    - Constants defintion
    - AmazonProduct and AmazonBrowseNode definition
    - Uniform data structure returned by all the api calls
Version 1.0.0
    - CacheReader and CacheWriter
    - Enable throttling
Version 0.1.0
    - First release

Buy Me A Coffee

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

amazon-paapi5-1.1.1.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

amazon_paapi5-1.1.1-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file amazon-paapi5-1.1.1.tar.gz.

File metadata

  • Download URL: amazon-paapi5-1.1.1.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1

File hashes

Hashes for amazon-paapi5-1.1.1.tar.gz
Algorithm Hash digest
SHA256 15ce390635f2c9fa67a4b1bf1d9d9a90aef6bcecb9def44c1910992dc5e18314
MD5 a3a1d312f2981414f9bca45339d25ea5
BLAKE2b-256 a52459e80751208bbea7843d95b1fb12cb97653a1267045e74af0dc6312f928d

See more details on using hashes here.

File details

Details for the file amazon_paapi5-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: amazon_paapi5-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 24.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1

File hashes

Hashes for amazon_paapi5-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fc46fe9ee382a44a5e9511695229e45673eaeb96bbef7da646e48346fd6c4fbf
MD5 88761c1c18bfb8fa37619485f89cb1f2
BLAKE2b-256 10d7c4eba69d42ac2c04a8759c09768038c6c1d91299958eff940a84aa573591

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page