Skip to content

Commit 00d6dc9

Browse files
committed
refactor: Remove deprecated PAAPI content from README, update migration guide link, and add a throttling example.
1 parent 85c3e83 commit 00d6dc9

1 file changed

Lines changed: 13 additions & 95 deletions

File tree

README.md

Lines changed: 13 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ A Python wrapper for Amazon's product APIs. This package supports both the legac
88
[![Downloads](https://img.shields.io/pypi/dm/python-amazon-paapi?label=Downloads)](https://pypi.org/project/python-amazon-paapi/)
99

1010
> [!IMPORTANT]
11-
> **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](#migration-from-paapi-to-creators-api) below.
11+
> **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](https://python-amazon-paapi.readthedocs.io/en/latest/pages/migration-guide-6.html) for more information.
1212
1313
## Features
1414

@@ -29,11 +29,7 @@ pip install python-amazon-paapi --upgrade
2929

3030
---
3131

32-
## Amazon Creators API (Recommended)
33-
34-
The Creators API is Amazon's new API for affiliate product data, designed to replace the legacy PAAPI.
35-
36-
### Quick Start
32+
## Quick Start
3733

3834
```python
3935
from amazon_creatorsapi import AmazonCreatorsApi, Country
@@ -55,6 +51,8 @@ print(items[0].item_info.title.display_value)
5551
items = api.get_items(["https://www.amazon.com/dp/B01N5IB20Q"])
5652
```
5753

54+
## Usage Examples
55+
5856
### Search Products
5957

6058
```python
@@ -95,6 +93,15 @@ if item.offers_v2 and item.offers_v2.listings:
9593
print(listing.merchant_info.name)
9694
```
9795

96+
### Throttling
97+
98+
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.
99+
100+
```python
101+
amazon = AmazonCreatorsApi(ID, SECRET, VERSION, TAG, COUNTRY, throttling=4) # Makes 1 request every 4 seconds
102+
amazon = AmazonCreatorsApi(ID, SECRET, VERSION, TAG, COUNTRY, throttling=0) # No wait time between requests
103+
```
104+
98105
### Working with Models
99106

100107
All SDK models are re-exported through `amazon_creatorsapi.models` for convenient access:
@@ -120,95 +127,6 @@ resources = [GetItemsResource.ITEMINFO_TITLE, GetItemsResource.OFFERS_LISTINGS_P
120127
items = api.get_items(["B01N5IB20Q"], resources=resources)
121128
```
122129

123-
## Legacy PAAPI (Deprecated)
124-
125-
> [!WARNING]
126-
> The `amazon_paapi` module is deprecated and will be removed in a future version. Please migrate to `amazon_creatorsapi`.
127-
128-
### Quick Start
129-
130-
```python
131-
from amazon_paapi import AmazonApi
132-
133-
amazon = AmazonApi(KEY, SECRET, TAG, COUNTRY)
134-
item = amazon.get_items('B01N5IB20Q')[0]
135-
print(item.item_info.title.display_value)
136-
```
137-
138-
### Usage Examples
139-
140-
<details>
141-
<summary>Click to expand legacy PAAPI examples</summary>
142-
143-
#### Get Multiple Products
144-
145-
```python
146-
items = amazon.get_items(['B01N5IB20Q', 'B01F9G43WU'])
147-
for item in items:
148-
print(item.images.primary.large.url)
149-
```
150-
151-
#### Use Amazon URL Instead of ASIN
152-
153-
```python
154-
item = amazon.get_items('https://www.amazon.com/dp/B01N5IB20Q')
155-
```
156-
157-
#### Search Products
158-
159-
```python
160-
results = amazon.search_items(keywords='nintendo switch')
161-
for item in results.items:
162-
print(item.item_info.title.display_value)
163-
```
164-
165-
#### Extract ASIN from URL
166-
167-
```python
168-
from amazon_paapi import get_asin
169-
170-
asin = get_asin('https://www.amazon.com/dp/B01N5IB20Q')
171-
# Returns: 'B01N5IB20Q'
172-
```
173-
174-
#### Configure Throttling
175-
176-
```python
177-
amazon = AmazonApi(KEY, SECRET, TAG, COUNTRY, throttling=4)
178-
```
179-
180-
</details>
181-
182-
---
183-
184-
## Migration from PAAPI to Creators API
185-
186-
### Code Changes
187-
188-
**Before (PAAPI):**
189-
190-
```python
191-
from amazon_paapi import AmazonApi
192-
193-
amazon = AmazonApi(api_key, api_secret, tag, country)
194-
items = amazon.get_items('B01N5IB20Q')
195-
```
196-
197-
**After (Creators API):**
198-
199-
```python
200-
from amazon_creatorsapi import AmazonCreatorsApi
201-
202-
api = AmazonCreatorsApi(
203-
credential_id=credential_id,
204-
credential_secret=credential_secret,
205-
version="2.2",
206-
tag=tag,
207-
country=country,
208-
)
209-
items = api.get_items(["B01N5IB20Q"])
210-
```
211-
212130
---
213131

214132
## Documentation

0 commit comments

Comments
 (0)