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.

PyPI Python License Support Amazon API

Features

  • Object oriented interface for simple usage.
  • Get information about a product through its ASIN or URL.
  • Get item variations or search for products on Amazon.
  • Get multiple results at once without the 10 items limitation from Amazon.
  • Configurable throttling to avoid requests exceptions.
  • Support for all available countries.
  • Reorganized product information structure for simple use.
  • Ask for new features through the issues section.
  • Join our Telegram group for support or development.

Installation

You can install or upgrade the module with:

pip install python-amazon-paapi --upgrade

Usage guide

Basic usage:

from amazon.paapi import AmazonAPI
amazon = AmazonAPI(KEY, SECRET, TAG, COUNTRY)
product = amazon.get_product('B01N5IB20Q')
print(product.title)

Get multiple product information:

product = amazon.get_products('B01N5IB20Q,B01F9G43WU')
print(product[0].images.large)
print(product[1].prices.price.value)

Use URL insted of ASIN:

product = amazon.get_product('https://www.amazon.com/dp/B01N5IB20Q')

Get product variations:

product = amazon.get_variations('B01N5IB20Q')
print(product[0].title)

Search product:

product = amazon.search_products(item_count=25, keywords='speaker')
print(product[14].url)

Get the ASIN from a URL:

from amazon.tools import get_asin
asin = get_asin('https://www.amazon.com/dp/B01N5IB20Q')

Changelog

Version 3.0.0
    - Added search_products and get_variations methods.
    - Removed Amazon API requests limit for all methods.
    - Created AmazonException for better exception handling.
    - Added asynchronous requests compatibility.
    - Added parent_ASIN to product instance.
    - Cleaned code for more consistent style.
    - Updated docstrings for all methods.
    - Updated project structure.

Version 2.1.1
    - Added get_product for single requests.

Version 2.1.0
    - Changed get_product method name to get_products.
    - Removed Amazon 10 products limitation.
    - Added type hints.
    - Solved bug with images exception.
    - Updated documentation.

Version 2.0.1
    - Improved exception handling.

Version 2.0.0
    - New structure for product info, adding all available information from the API.
    - Added raw_data with the information unparsed from the API.
    - Removed Amazon API version from package name to avoid changes in the future.

Version 1.0.0
    - Added support for getting multiple product information.
    - Added compatibiliy with Amazon URL search.
    - New function for getting the ASIN for a given URL.
    - Removed Amazon SDK and added as a requirement.
    - Updated docstrings.
    - Updated README with changelog, more examples and badges.

Version 0.1.1
    - Added currency support for prices.

Version 0.1.0
    -First release.

License

Copyright © 2020 Sergio Abad. See license for details.

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

python-amazon-paapi-3.0.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

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

python_amazon_paapi-3.0.0-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

Details for the file python-amazon-paapi-3.0.0.tar.gz.

File metadata

  • Download URL: python-amazon-paapi-3.0.0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.5.3

File hashes

Hashes for python-amazon-paapi-3.0.0.tar.gz
Algorithm Hash digest
SHA256 d3c163b58aa5f65eeafa7fef16cb67f829c4f7e5dad969bec83b85a6fe860000
MD5 e5e0dcf0347fa100252636d0aa7213af
BLAKE2b-256 59f19c19cf01965d9957c9473345df669f61f333c07787bae7ef76feae6794b4

See more details on using hashes here.

File details

Details for the file python_amazon_paapi-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: python_amazon_paapi-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 24.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.5.3

File hashes

Hashes for python_amazon_paapi-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b88c36c0c1dddc6b2ede09af3949039b2360a5ba019d15a7dcbc6ebcb1c47b8d
MD5 efc8ca13ca512d1f5212e7541e14158f
BLAKE2b-256 40e13ce35efa1f1358c1759b6142b2c5ad21edf00ee2992517fb663c1b04bbc8

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