Coder Social home page Coder Social logo

python-amazon-paapi's Introduction

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 Amazon API Codecov Support PyPI - Downloads

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.

python-amazon-paapi's People

Contributors

ak4zh avatar barbax7 avatar blob810 avatar fijter avatar gutfeeling avatar orangain avatar sergioteula avatar viktorfa avatar ypcrumble avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.