Amazon Product Advertising API 5.0 wrapper for Python
Project description
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.
[!IMPORTANT] Migration Advisory: The
amazon_paapimodule is deprecated. Amazon is transitioning from the Product Advertising API (PAAPI) to the new Creators API. Please migrate to theamazon_creatorsapimodule for new projects. See the Migration Guide for more information.
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.)
- 💰 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
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:
- Install uv package manager
- 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
- Copy
.env.templateto.envand 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_amazon_paapi-6.0.0.tar.gz.
File metadata
- Download URL: python_amazon_paapi-6.0.0.tar.gz
- Upload date:
- Size: 212.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3eb64f9d4a81f4713a8431734451a16a0ffd184736c314c8ecb4cb6c822b49d
|
|
| MD5 |
5537713f0a8f527688add60bf5873705
|
|
| BLAKE2b-256 |
1876953898fc29af609c94c6ac06faf6ce5655243261fad90c7c52c3d3dd559f
|
Provenance
The following attestation bundles were made for python_amazon_paapi-6.0.0.tar.gz:
Publisher:
release.yml on sergioteula/python-amazon-paapi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_amazon_paapi-6.0.0.tar.gz -
Subject digest:
d3eb64f9d4a81f4713a8431734451a16a0ffd184736c314c8ecb4cb6c822b49d - Sigstore transparency entry: 869031597
- Sigstore integration time:
-
Permalink:
sergioteula/python-amazon-paapi@07be5e924259b9dc22f27a5e5dc6c36c076f7388 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/sergioteula
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@07be5e924259b9dc22f27a5e5dc6c36c076f7388 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file python_amazon_paapi-6.0.0-py3-none-any.whl.
File metadata
- Download URL: python_amazon_paapi-6.0.0-py3-none-any.whl
- Upload date:
- Size: 411.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5cabe608ed6eaf8135a193a13f63a71d559a5f7851ce485a6fbf80b727c86ac
|
|
| MD5 |
eb658477648eefec5a6bfb8e22d20b6e
|
|
| BLAKE2b-256 |
239688a26cd19b3b75193845111494936adcb82d90d20d183481916a159bfaab
|
Provenance
The following attestation bundles were made for python_amazon_paapi-6.0.0-py3-none-any.whl:
Publisher:
release.yml on sergioteula/python-amazon-paapi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_amazon_paapi-6.0.0-py3-none-any.whl -
Subject digest:
d5cabe608ed6eaf8135a193a13f63a71d559a5f7851ce485a6fbf80b727c86ac - Sigstore transparency entry: 869031603
- Sigstore integration time:
-
Permalink:
sergioteula/python-amazon-paapi@07be5e924259b9dc22f27a5e5dc6c36c076f7388 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/sergioteula
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@07be5e924259b9dc22f27a5e5dc6c36c076f7388 -
Trigger Event:
workflow_dispatch
-
Statement type: