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 interacting with Amazon using the official API in an easier way.

PyPI Python License Support Amazon API

If you are still using the old version, go here for documentation or check our migration guide.

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 browse nodes information.
  • Get multiple results at once without the 10 items limitation from Amazon.
  • Configurable throttling to avoid requests exceptions.
  • Type hints to help you coding.
  • Support for all available countries.
  • Ask for new features through the issues section.
  • Join our Telegram group for support or development.
  • Check the documentation for reference.

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)
item = amazon.get_items('B01N5IB20Q')[0]
print(item.item_info.title.display_value) # Item title

Get multiple items information:

items = amazon.get_items(['B01N5IB20Q', 'B01F9G43WU'])
for item in items:
    print(item.images.primary.large.url) # Primary image url
    print(item.offers.listings[0].price.amount) # Current price

Use URL insted of ASIN:

item = amazon.get_items('https://www.amazon.com/dp/B01N5IB20Q')

Get item variations:

variations = amazon.get_variations('B01N5IB20Q')
for item in variations.items:
    print(item.detail_page_url) # Affiliate url

Search items:

search_result = amazon.search_items(keywords='nintendo')
for item in search_result.items:
    print(item.item_info.product_info.color) # Item color

Get browse node information:

browse_nodes = amazon.get_browse_nodes(['667049031', '599385031'])
for browse_node in browse_nodes:
    print(browse_node.display_name) # The name of the node

Get the ASIN from URL:

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

Throttling:

Throttling value represents the wait time in seconds between API calls, being the default value 1 second. Use it to avoid reaching Amazon request limits.

amazon = AmazonApi(KEY, SECRET, TAG, COUNTRY, throttling=4)  # Makes 1 request every 4 seconds
amazon = AmazonApi(KEY, SECRET, TAG, COUNTRY, throttling=0)  # No wait time between requests

License

Copyright © 2021 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-4.2.1.tar.gz (119.7 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-4.2.1-py3-none-any.whl (369.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: python-amazon-paapi-4.2.1.tar.gz
  • Upload date:
  • Size: 119.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for python-amazon-paapi-4.2.1.tar.gz
Algorithm Hash digest
SHA256 e231ad52247d141ed38ba1710f6daa08e6e3fe52654a6ac2ffd5e0740940392d
MD5 8891a29fc2b5175ce84928c36e34b887
BLAKE2b-256 e1d5939258b6709afa3873ca3e4a33d8169d4bd8a6aaf134835e1bc28775e768

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_amazon_paapi-4.2.1-py3-none-any.whl
  • Upload date:
  • Size: 369.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for python_amazon_paapi-4.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 deb3915ce6cd0649bf9ef0fae3f792fa50bdc0f2ef6b1606172cdeac6b64b19a
MD5 d797f59273b423eced18e8483acfacea
BLAKE2b-256 2195364a47afb4033c3d4d6b2f1a2b3e36c9a18d3c8a05e5fcf82e489ab45e74

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