Skip to content

sergioteula/python-amazon-paapi

Repository files navigation

Python Amazon PAAPI

A simple Python wrapper for the Amazon Product Advertising API 5.0. Easily interact with Amazon's official API to retrieve product information, search for items, and more.

PyPI Python License Amazon API Downloads

Features

  • 🎯 Simple object-oriented interface for easy integration
  • πŸ” Product search by keywords, categories, or browse nodes
  • πŸ“¦ Product details via ASIN or Amazon URL
  • πŸ”„ Item variations support (size, color, etc.)
  • 🌍 20+ countries supported (full list)
  • ⚑ Batch requests to get multiple items without the 10-item limit
  • πŸ›‘οΈ Built-in throttling to avoid API rate limits
  • πŸ“ Full type hints for better IDE support

Installation

pip install python-amazon-paapi --upgrade

Quick Start

from amazon_paapi import AmazonApi

# Initialize the API (get credentials from Amazon Associates)
amazon = AmazonApi(KEY, SECRET, TAG, COUNTRY)

# Get product information by ASIN
item = amazon.get_items('B01N5IB20Q')[0]
print(item.item_info.title.display_value)

Usage Examples

Get Multiple Products

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

Use Amazon URL Instead of ASIN

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

Search Products

results = amazon.search_items(keywords='nintendo switch')
for item in results.items:
    print(item.item_info.title.display_value)

Get Product Variations

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

Get Browse Node Information

nodes = amazon.get_browse_nodes(['667049031', '599385031'])
for node in nodes:
    print(node.display_name)

Extract ASIN from URL

from amazon_paapi import get_asin

asin = get_asin('https://www.amazon.com/dp/B01N5IB20Q')
# Returns: 'B01N5IB20Q'

Configure Throttling

Control the wait time between API calls to avoid rate limits:

# Wait 4 seconds between requests
amazon = AmazonApi(KEY, SECRET, TAG, COUNTRY, throttling=4)

# No throttling (use with caution)
amazon = AmazonApi(KEY, SECRET, TAG, COUNTRY, throttling=0)

Documentation

Contributing

Contributions are welcome! To get started:

  1. Install uv package manager
  2. Clone and set up the project:
git clone https://github.com/sergioteula/python-amazon-paapi.git
cd python-amazon-paapi
uv sync
uv run pre-commit install
  1. Copy .env.template to .env and add your Amazon API credentials for integration tests.

Pre-commit hooks will automatically run Ruff, mypy, and tests before each commit.

License

MIT License Β© 2026 Sergio Abad