Skip to main content

Python Amazon Creators API

A Python wrapper for Amazon's product APIs. This package supports both the legacy Product Advertising API 5.0 and the new Amazon Creators API.

PyPI Python License Downloads

[!IMPORTANT] Migration Advisory: The amazon_paapi module is deprecated. Amazon is transitioning from the Product Advertising API (PAAPI) to the new Creators API. Please migrate to the amazon_creatorsapi module for new projects. See the Migration Guide for more information.

Features

  • 🎯 Simple object-oriented interface for easy integration
  • Async/await support for high-performance applications
  • �🔍 Product search by keywords, categories, or browse nodes
  • 📦 Product details via ASIN or Amazon URL
  • 🔄 Item variations support (size, color, etc.)
  • 💰 OffersV2 support for enhanced pricing and offer details
  • 🌍 20+ countries supported
  • 🛡️ 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_creatorsapi import AmazonCreatorsApi, Country

# Initialize with your Creators API credentials
api = AmazonCreatorsApi(
    credential_id="your_credential_id",
    credential_secret="your_credential_secret",
    version="2.2",
    tag="your-affiliate-tag",
    country=Country.US,
)

# Get product information by ASIN
items = api.get_items(["B01N5IB20Q"])
print(items[0].item_info.title.display_value)

# Or use Amazon URLs directly
items = api.get_items(["https://www.amazon.com/dp/B01N5IB20Q"])

Usage Examples

Get Multiple Items

items = api.get_items(["B01N5IB20Q", "B01F9G43WU"])
for item in items:
    print(item.images.primary.large.url)

Search Products

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

Get Product Variations

# Using ASIN
variations = api.get_variations("B01N5IB20Q")

# Or using Amazon URL
variations = api.get_variations("https://www.amazon.com/dp/B01N5IB20Q")

for item in variations.items:
    print(item.detail_page_url)

Get Browse Node Information

nodes = api.get_browse_nodes(["667049031"])
for node in nodes:
    print(node.display_name)

Get the ASIN from URL

from amazon_creatorsapi import get_asin

asin = get_asin("https://www.amazon.com/dp/B01N5IB20Q")

Using OffersV2 Resources

items = api.get_items(["B01N5IB20Q"])
item = items[0]
if item.offers_v2 and item.offers_v2.listings:
    listing = item.offers_v2.listings[0]
    print(listing.price.money.amount)
    print(listing.merchant_info.name)

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 = AmazonCreatorsApi(ID, SECRET, VERSION, TAG, COUNTRY, throttling=4)  # Makes 1 request every 4 seconds
amazon = AmazonCreatorsApi(ID, SECRET, VERSION, TAG, COUNTRY, throttling=0)  # No wait time between requests

Async Support

For async/await applications, use the async version of the API with httpx:

pip install python-amazon-paapi[async] --upgrade

The async API provides the same methods as the synchronous version, but they must be called with await:

from amazon_creatorsapi.aio import AsyncAmazonCreatorsApi
from amazon_creatorsapi import Country

# Use as async context manager (recommended for connection pooling)
async with AsyncAmazonCreatorsApi(
    credential_id="your_credential_id",
    credential_secret="your_credential_secret",
    version="2.2",
    tag="your-affiliate-tag",
    country=Country.US,
) as api:
    items = await api.get_items(["B01N5IB20Q"])
    results = await api.search_items(keywords="laptop")
    variations = await api.get_variations("B01N5IB20Q")
    nodes = await api.get_browse_nodes(["667049031"])

# Or use without context manager (creates new connection per request)
api = AsyncAmazonCreatorsApi(ID, SECRET, VERSION, TAG, COUNTRY)
items = await api.get_items(["B01N5IB20Q"])

Note: All synchronous methods and parameters work identically in async mode. Use async with for better performance when making multiple API calls.

Working with Models

All SDK models are re-exported through amazon_creatorsapi.models for convenient access:

from amazon_creatorsapi.models import (
    Item,
    Condition,
    SortBy,
    GetItemsResource,
    SearchItemsResource,
)

# Use Condition enum for filtering
items = api.get_items(["B01N5IB20Q"], condition=Condition.NEW)

# Use SortBy enum for search ordering
results = api.search_items(keywords="laptop", sort_by=SortBy.PRICE_LOW_TO_HIGH)

# Specify which resources to retrieve
from amazon_creatorsapi.models import GetItemsResource
resources = [GetItemsResource.ITEMINFO_TITLE, GetItemsResource.OFFERS_LISTINGS_PRICE]
items = api.get_items(["B01N5IB20Q"], resources=resources)

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 API credentials for integration tests.

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

License

MIT License © 2026 Sergio Abad

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-6.3.0.tar.gz (231.2 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-6.3.0-py3-none-any.whl (425.2 kB view details)

Uploaded Python 3

File details

Details for the file python_amazon_paapi-6.3.0.tar.gz.

File metadata

  • Download URL: python_amazon_paapi-6.3.0.tar.gz
  • Upload date:
  • Size: 231.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for python_amazon_paapi-6.3.0.tar.gz
Algorithm Hash digest
SHA256 e525d69efcbe4f9566ec2b9b43fa3183c484d166d3852edb38b4df9c0b19cf1f
MD5 e3da89b1fd1923025d78e03f5aca3017
BLAKE2b-256 f3bfb1d24c88304c6e3bad3d44585e42b95a5f53a915d8eb95dc270ce0457e30

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_amazon_paapi-6.3.0.tar.gz:

Publisher: release.yml on sergioteula/python-amazon-paapi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for python_amazon_paapi-6.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7cd852084a49d53c3ba2195531fccbc8c7f4124b2e82e2fda02b53d3b8de521
MD5 44649ebd7cc80a40f66a0e9e75366802
BLAKE2b-256 3e393a741264d8bfc7978250ed9b206bbbac42d6dc3206208dc45849ed3a97c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_amazon_paapi-6.3.0-py3-none-any.whl:

Publisher: release.yml on sergioteula/python-amazon-paapi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

6.3.0 This release

2 files

6.2.0

2 files

6.1.0

2 files

6.0.0

2 files

5.2.0

2 files

5.1.0

2 files

5.0.1

2 files

5.0.0

2 files

4.3.2

2 files

4.3.1

2 files

4.3.0

2 files

4.2.2

2 files

4.2.1

2 files

4.2.0

2 files

4.1.1

2 files

4.1.0

2 files

4.0.0

2 files

3.3.4

2 files

3.3.3

2 files

3.3.2

2 files

3.3.1

2 files

3.3.0

2 files

3.2.0

2 files

3.1.0

2 files

3.0.2

2 files

3.0.1

2 files

3.0.0

2 files

2.1.1

2 files

2.1.0

2 files

2.0.1

2 files

2.0.0

2 files

Supported by

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