python-amazon-ad-api 1.0.0__tar.gz → 1.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/PKG-INFO +21 -28
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/README.md +20 -27
- python_amazon_ad_api-1.0.2/ad_api/api/v1/__init__.py +9 -0
- python_amazon_ad_api-1.0.2/ad_api/api/v1/ad_groups.py +201 -0
- python_amazon_ad_api-1.0.2/ad_api/api/v1/ads.py +163 -0
- python_amazon_ad_api-1.0.2/ad_api/api/v1/campaigns.py +180 -0
- python_amazon_ad_api-1.0.2/ad_api/version.py +1 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/python_amazon_ad_api.egg-info/PKG-INFO +21 -28
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/python_amazon_ad_api.egg-info/SOURCES.txt +4 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/setup.cfg +1 -1
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/setup.py +2 -1
- python_amazon_ad_api-1.0.0/ad_api/version.py +0 -1
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/LICENSE +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/__init__.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/__init__.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/account.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/advertising_test_account.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/attribution.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/audiences.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/billing.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/brand_metrics.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/creative_assets.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/dsp/__init__.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/dsp/access_token_client.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/dsp/client.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/dsp/credential_provider.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/dsp/reports.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/eligibility.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/exports.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/history.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/insights.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/invoices.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/localization.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/manager_accounts.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/metadata.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/portfolios.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/portfolios_v3.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/profiles.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/recommendations.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/reports.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/__init__.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/ad_creatives_v4.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/ad_groups.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/ad_groups_v4.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/ads_v4.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/benchmarks.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/bid_recommendations.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/brands.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/campaigns.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/campaigns_v4.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/forecast.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/keywords.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/keywords_recommendations.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/landing_page_asins.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/media.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/moderation.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/negative_keywords.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/negative_product_targeting.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/product_targeting.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/recommendations.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/reports.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/snapshots.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/stores.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/targeting_recommendations.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/themes.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/__init__.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/ad_groups.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/bid_recommendations.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/brand_safety.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/budget_rules.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/campaigns.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/campaigns_budget_usage.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/creatives.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/forecast.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/negative_product_targeting.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/product_ads.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/product_targeting.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/recommendations.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/reports.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/snapshots.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/targeting_recommendations.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/__init__.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/ad_groups.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/ad_groups_v3.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/bid_recommendations.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/bid_recommendations_v3.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/budget_initial_recommendation.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/budget_recommendations.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/budget_rules.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/budget_rules_recommendations.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/campaign_consolidated_recommendations.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/campaign_negative_keywords.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/campaign_negative_keywords_v3.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/campaign_negative_targets.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/campaigns.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/campaigns_budget_usage.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/campaigns_v3.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/campaings_optimization.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/keywords.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/keywords_v3.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/negative_keywords.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/negative_keywords_v3.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/negative_product_targeting.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/negative_product_targeting_v3.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/product_ads.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/product_ads_v3.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/product_recommendations.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/product_targeting.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/product_targeting_v3.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/ranked_keywords_recommendations.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/reports.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/schedule_based_bid_optimization.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/snapshots.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/suggested_keywords.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/stores.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/stream.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/api/validation_configurations.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/auth/__init__.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/auth/access_token_client.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/auth/access_token_response.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/auth/credentials.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/auth/exceptions.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/base/__init__.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/base/api_response.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/base/base_client.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/base/client.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/base/config.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/base/credential_provider.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/base/exceptions.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/base/helpers.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/base/marketplaces.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/ad_api/base/utils.py +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/pyproject.toml +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/python_amazon_ad_api.egg-info/dependency_links.txt +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/python_amazon_ad_api.egg-info/requires.txt +0 -0
- {python_amazon_ad_api-1.0.0 → python_amazon_ad_api-1.0.2}/python_amazon_ad_api.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-amazon-ad-api
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.2
|
|
4
4
|
Summary: Python wrapper for the Amazon Advertising API
|
|
5
5
|
Home-page: https://github.com/denisneuf/python-amazon-ad-api
|
|
6
6
|
Author: Daniel Alvaro
|
|
@@ -299,37 +299,13 @@ There is a new version 3 Portfolios API, please check the [migration guide](http
|
|
|
299
299
|
* [Get test account information](https://python-amazon-ad-api.readthedocs.io/en/latest/api/advertising_test_account.html#ad_api.api.AdvertisingTestAccount.AdvertisingTestAccount.get_test_account)
|
|
300
300
|
|
|
301
301
|
|
|
302
|
-
### Amazon Ads API v1 (new, unified)
|
|
302
|
+
### [Amazon Ads API v1 (new, unified)](https://python-amazon-ad-api.readthedocs.io/en/latest/v1.html)
|
|
303
303
|
|
|
304
304
|
The v1 API lives under `/adsApi/v1/` and is **not** split by product: every call targets the same resource and the product is selected in the request body with `adProductFilter`. It supersedes the per-product v2/v3 endpoints.
|
|
305
305
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
| Method | Endpoint | Body |
|
|
311
|
-
|---|---|---|
|
|
312
|
-
| `query_campaigns` | `POST /adsApi/v1/query/campaigns` | filters + `maxResults`/`nextToken` |
|
|
313
|
-
| `create_campaigns` | `POST /adsApi/v1/create/campaigns` | `campaigns[]` (`adProduct`, `name`, `state` required) |
|
|
314
|
-
| `update_campaigns` | `POST /adsApi/v1/update/campaigns` | `campaigns[]` (`campaignId` required) |
|
|
315
|
-
| `delete_campaigns` | `POST /adsApi/v1/delete/campaigns` | `campaignIds[]` |
|
|
316
|
-
|
|
317
|
-
All four return a **207 MultiStatus** response (except `query_campaigns`, which returns 200), so check the payload for per-entity errors.
|
|
306
|
+
* [Campaigns](https://python-amazon-ad-api.readthedocs.io/en/latest/v1/campaigns.html#ad_api.api.v1.Campaigns.Campaigns.query_campaigns)
|
|
307
|
+
* [Ad Groups](https://python-amazon-ad-api.readthedocs.io/en/latest/v1/ad_groups.html#ad_api.api.v1.AdGroups.AdGroups.query_ad_groups)
|
|
318
308
|
|
|
319
|
-
```python
|
|
320
|
-
from ad_api.api import v1
|
|
321
|
-
|
|
322
|
-
result = v1.Campaigns(credentials=credentials, debug=True).query_campaigns(
|
|
323
|
-
body={
|
|
324
|
-
"adProductFilter": {"include": ["SPONSORED_PRODUCTS"]},
|
|
325
|
-
"stateFilter": {"include": ["ENABLED"]},
|
|
326
|
-
"maxResults": 100,
|
|
327
|
-
}
|
|
328
|
-
)
|
|
329
|
-
|
|
330
|
-
campaigns = result.payload.get("campaigns")
|
|
331
|
-
next_token = result.payload.get("nextToken")
|
|
332
|
-
```
|
|
333
309
|
|
|
334
310
|
### [Modules Available Sponsored Products 2.0](https://python-amazon-ad-api.readthedocs.io/en/latest/sp_v2.html)
|
|
335
311
|
|
|
@@ -409,6 +385,23 @@ Warning: `list_campaigns` is deprecated. Use the v1 `query_campaigns` method ins
|
|
|
409
385
|
|
|
410
386
|
* [Reports](https://python-amazon-ad-api.readthedocs.io/en/latest/dsp/reports.html)
|
|
411
387
|
|
|
388
|
+
### Amazon Ads API v1 - basic example
|
|
389
|
+
|
|
390
|
+
```python
|
|
391
|
+
from ad_api.api import v1
|
|
392
|
+
|
|
393
|
+
result = v1.Campaigns(credentials=credentials, debug=True).query_campaigns(
|
|
394
|
+
body={
|
|
395
|
+
"adProductFilter": {"include": ["SPONSORED_PRODUCTS"]},
|
|
396
|
+
"stateFilter": {"include": ["ENABLED"]},
|
|
397
|
+
"maxResults": 100,
|
|
398
|
+
}
|
|
399
|
+
)
|
|
400
|
+
|
|
401
|
+
campaigns = result.payload.get("campaigns")
|
|
402
|
+
next_token = result.payload.get("nextToken")
|
|
403
|
+
```
|
|
404
|
+
|
|
412
405
|
### Simple Example Usage Campaigns with Credentials (v3, legacy)
|
|
413
406
|
|
|
414
407
|
Warning: this example uses `CampaignsV3.list_campaigns`, which is deprecated. See the v1 `query_campaigns` example above.
|
|
@@ -271,37 +271,13 @@ There is a new version 3 Portfolios API, please check the [migration guide](http
|
|
|
271
271
|
* [Get test account information](https://python-amazon-ad-api.readthedocs.io/en/latest/api/advertising_test_account.html#ad_api.api.AdvertisingTestAccount.AdvertisingTestAccount.get_test_account)
|
|
272
272
|
|
|
273
273
|
|
|
274
|
-
### Amazon Ads API v1 (new, unified)
|
|
274
|
+
### [Amazon Ads API v1 (new, unified)](https://python-amazon-ad-api.readthedocs.io/en/latest/v1.html)
|
|
275
275
|
|
|
276
276
|
The v1 API lives under `/adsApi/v1/` and is **not** split by product: every call targets the same resource and the product is selected in the request body with `adProductFilter`. It supersedes the per-product v2/v3 endpoints.
|
|
277
277
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
| Method | Endpoint | Body |
|
|
283
|
-
|---|---|---|
|
|
284
|
-
| `query_campaigns` | `POST /adsApi/v1/query/campaigns` | filters + `maxResults`/`nextToken` |
|
|
285
|
-
| `create_campaigns` | `POST /adsApi/v1/create/campaigns` | `campaigns[]` (`adProduct`, `name`, `state` required) |
|
|
286
|
-
| `update_campaigns` | `POST /adsApi/v1/update/campaigns` | `campaigns[]` (`campaignId` required) |
|
|
287
|
-
| `delete_campaigns` | `POST /adsApi/v1/delete/campaigns` | `campaignIds[]` |
|
|
288
|
-
|
|
289
|
-
All four return a **207 MultiStatus** response (except `query_campaigns`, which returns 200), so check the payload for per-entity errors.
|
|
278
|
+
* [Campaigns](https://python-amazon-ad-api.readthedocs.io/en/latest/v1/campaigns.html#ad_api.api.v1.Campaigns.Campaigns.query_campaigns)
|
|
279
|
+
* [Ad Groups](https://python-amazon-ad-api.readthedocs.io/en/latest/v1/ad_groups.html#ad_api.api.v1.AdGroups.AdGroups.query_ad_groups)
|
|
290
280
|
|
|
291
|
-
```python
|
|
292
|
-
from ad_api.api import v1
|
|
293
|
-
|
|
294
|
-
result = v1.Campaigns(credentials=credentials, debug=True).query_campaigns(
|
|
295
|
-
body={
|
|
296
|
-
"adProductFilter": {"include": ["SPONSORED_PRODUCTS"]},
|
|
297
|
-
"stateFilter": {"include": ["ENABLED"]},
|
|
298
|
-
"maxResults": 100,
|
|
299
|
-
}
|
|
300
|
-
)
|
|
301
|
-
|
|
302
|
-
campaigns = result.payload.get("campaigns")
|
|
303
|
-
next_token = result.payload.get("nextToken")
|
|
304
|
-
```
|
|
305
281
|
|
|
306
282
|
### [Modules Available Sponsored Products 2.0](https://python-amazon-ad-api.readthedocs.io/en/latest/sp_v2.html)
|
|
307
283
|
|
|
@@ -381,6 +357,23 @@ Warning: `list_campaigns` is deprecated. Use the v1 `query_campaigns` method ins
|
|
|
381
357
|
|
|
382
358
|
* [Reports](https://python-amazon-ad-api.readthedocs.io/en/latest/dsp/reports.html)
|
|
383
359
|
|
|
360
|
+
### Amazon Ads API v1 - basic example
|
|
361
|
+
|
|
362
|
+
```python
|
|
363
|
+
from ad_api.api import v1
|
|
364
|
+
|
|
365
|
+
result = v1.Campaigns(credentials=credentials, debug=True).query_campaigns(
|
|
366
|
+
body={
|
|
367
|
+
"adProductFilter": {"include": ["SPONSORED_PRODUCTS"]},
|
|
368
|
+
"stateFilter": {"include": ["ENABLED"]},
|
|
369
|
+
"maxResults": 100,
|
|
370
|
+
}
|
|
371
|
+
)
|
|
372
|
+
|
|
373
|
+
campaigns = result.payload.get("campaigns")
|
|
374
|
+
next_token = result.payload.get("nextToken")
|
|
375
|
+
```
|
|
376
|
+
|
|
384
377
|
### Simple Example Usage Campaigns with Credentials (v3, legacy)
|
|
385
378
|
|
|
386
379
|
Warning: this example uses `CampaignsV3.list_campaigns`, which is deprecated. See the v1 `query_campaigns` example above.
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
from ad_api.base import Client, sp_endpoint, ApiResponse, Utils
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class AdGroups(Client):
|
|
5
|
+
r"""
|
|
6
|
+
AdGroups(account='default', marketplace: Marketplaces = Marketplaces.EU, credentials=None, debug=False)
|
|
7
|
+
|
|
8
|
+
Amazon Ads API v1 - unified Ad Groups endpoints
|
|
9
|
+
|
|
10
|
+
The v1 API is not split by product: every call goes to the same resource
|
|
11
|
+
(``/adsApi/v1/...``) and the product is selected in the request body via
|
|
12
|
+
``adProductFilter``.
|
|
13
|
+
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
@sp_endpoint('/adsApi/v1/query/adGroups', method='POST')
|
|
17
|
+
def query_ad_groups(self, **kwargs) -> ApiResponse:
|
|
18
|
+
r"""
|
|
19
|
+
query_ad_groups(body: dict) -> ApiResponse
|
|
20
|
+
|
|
21
|
+
Amazon Ads API v1 - Query Ad Groups (operationId: QueryAdGroup)
|
|
22
|
+
|
|
23
|
+
Request Body [Required]
|
|
24
|
+
| **adProductFilter** (dict) : [required]
|
|
25
|
+
| **include** (list<AdProduct>) : Enum [ AMAZON_DSP, SPONSORED_BRANDS, SPONSORED_DISPLAY, SPONSORED_PRODUCTS, SPONSORED_TELEVISION ]
|
|
26
|
+
| **adGroupIdFilter** (dict) [optional]
|
|
27
|
+
| **include** (list<string>) : Ad group identifiers
|
|
28
|
+
| **campaignIdFilter** (dict) [optional]
|
|
29
|
+
| **include** (list<string>) : Campaign identifiers
|
|
30
|
+
| **inventoryTypeFilter** (dict) [optional]
|
|
31
|
+
| **include** (list<InventoryType>) : Enum [ AAP_MOBILE_APP, AMAZON_MOBILE_DISPLAY, AUDIO, AUDIO_AMAZON_DEAL, DISPLAY, LIVE_EVENTS, ONLINE_VIDEO, PODCAST, STANDARD_DISPLAY, STREAMING_TV, STREAMING_TV_AMAZON_DEAL, VIDEO ]
|
|
32
|
+
| **marketplaceScopeFilter** (dict) [optional]
|
|
33
|
+
| **include** (list<MarketplaceScope>) : Enum [ GLOBAL, SINGLE_MARKETPLACE ]
|
|
34
|
+
| **nameFilter** (dict) [optional]
|
|
35
|
+
| **include** (list<string>) : Ad group names
|
|
36
|
+
| **queryTermMatchType** (string) : [required] Enum [ BROAD_MATCH, EXACT_MATCH ]
|
|
37
|
+
| **retailerScopeFilter** (dict) [optional]
|
|
38
|
+
| **include** (list<RetailerScope>) : Enum [ AMAZON, OTHER_RETAILERS ]
|
|
39
|
+
| **stateFilter** (dict) [optional]
|
|
40
|
+
| **include** (list<State>) : Enum [ ARCHIVED, DRAFT, ENABLED, PAUSED ]
|
|
41
|
+
| **maxResults** (int) [optional] Maximum number of records in the response
|
|
42
|
+
| **nextToken** (string) [optional] Token to navigate to the next page
|
|
43
|
+
|
|
44
|
+
Headers
|
|
45
|
+
| **Amazon-Ads-AccountId** (string) [optional] Advertiser account identifier
|
|
46
|
+
|
|
47
|
+
Returns
|
|
48
|
+
ApiResponse
|
|
49
|
+
| **adGroups** (list), **nextToken** (string)
|
|
50
|
+
|
|
51
|
+
"""
|
|
52
|
+
schema_version = 'application/json'
|
|
53
|
+
headers = {"Accept": schema_version, "Content-Type": schema_version}
|
|
54
|
+
body = kwargs.pop('body', None)
|
|
55
|
+
return self._request(kwargs.pop('path'), params=kwargs, headers=headers,
|
|
56
|
+
**({'data': Utils.convert_body(body, False)} if body is not None else {}))
|
|
57
|
+
|
|
58
|
+
@sp_endpoint('/adsApi/v1/create/adGroups', method='POST')
|
|
59
|
+
def create_ad_groups(self, **kwargs) -> ApiResponse:
|
|
60
|
+
r"""
|
|
61
|
+
create_ad_groups(body: dict) -> ApiResponse
|
|
62
|
+
|
|
63
|
+
Amazon Ads API v1 - Create Ad Groups (operationId: CreateAdGroup)
|
|
64
|
+
|
|
65
|
+
Request Body [Required]
|
|
66
|
+
| **adGroups** (list<dict>) : [required] One or more ad group objects.
|
|
67
|
+
Each object requires **adProduct**, **campaignId**, **name** and **state**.
|
|
68
|
+
|
|
69
|
+
Ad group fields
|
|
70
|
+
| **adProduct** (string) : [required] Enum [ AMAZON_DSP, SPONSORED_BRANDS, SPONSORED_DISPLAY, SPONSORED_PRODUCTS, SPONSORED_TELEVISION ]
|
|
71
|
+
| **campaignId** (string) : [required] Identifier of the parent campaign
|
|
72
|
+
| **name** (string) : [required] Name of the ad group
|
|
73
|
+
| **state** (string) : [required] Enum [ DRAFT, ENABLED, PAUSED ]
|
|
74
|
+
| **bid** (dict) [optional]
|
|
75
|
+
| **baseBid** (number) : Base bid value
|
|
76
|
+
| **defaultBid** (number) : Default bid value
|
|
77
|
+
| **maxAverageBid** (number) : Maximum average bid
|
|
78
|
+
| **marketplaceSettings** (list<dict>) : Per marketplace bids
|
|
79
|
+
| **currencyCode** (string) : [required] Enum CurrencyCode (EUR, USD, GBP, ...)
|
|
80
|
+
| **marketplace** (string) : [required] Marketplace
|
|
81
|
+
| **defaultBid** (number) : Default bid for that marketplace
|
|
82
|
+
| **budgets** (list<dict>) [optional] See Campaigns budget shape:
|
|
83
|
+
``budgetType``, ``budgetValue.monetaryBudgetValue.monetaryBudget`` (``currencyCode`` + ``value``), ``recurrenceTimePeriod``
|
|
84
|
+
| **optimization** (dict) [optional]
|
|
85
|
+
| **bidStrategy** (string) : Enum [ MANUAL, NEW_TO_BRAND, PRIORITIZE_KPI_TARGET, RULE_BASED, SALES_DOWN_ONLY, SALES_UP_AND_DOWN, SPEND_BUDGET_IN_FULL, USE_CAMPAIGN_STRATEGY ]
|
|
86
|
+
| **budgetSettings** (dict) : ``budgetAllocation`` (Enum AUTO, MANUAL) and ``dailyMinSpendValue`` (number)
|
|
87
|
+
| **goalSettings** (dict) : ``kpi`` (Enum ADD_TO_CART, APPLICATIONS, CHECKOUTS, CLICKS, CLICK_THROUGH_RATE, COMBINED_RETURN_ON_AD_SPEND, CONTACTS, COST_PER_ACTION, COST_PER_CLICK, COST_PER_CONVERSION_OFF_AMAZON, COST_PER_DETAIL_PAGE_VIEW, COST_PER_FIRST_APP_OPEN, COST_PER_INSTALL, COST_PER_SIGN_UP, COST_PER_UNSKIPPED_IMPRESSION, COST_PER_VIDEO_COMPLETION, DETAIL_PAGE_VIEW_RATE, FREQUENCY_AVERAGE, LEADS, OTHER, PAGE_VIEWS, PURCHASES, REACH, RETURN_ON_AD_SPEND, ROAS, ROAS_COMBINED, ROAS_OFF_AMAZON, ROAS_PROMOTED, SEARCH, SIGN_UP, SUBSCRIBE, TOP_OF_SEARCH_IMPRESSION_SHARE, TOTAL_RETURN_ON_AD_SPEND, VIDEO_COMPLETION_RATE)
|
|
88
|
+
| **pacing** (dict) [optional]
|
|
89
|
+
| **deliveryProfile** (string) : [required] Enum [ ASAP, EVEN, PACE_AHEAD ]
|
|
90
|
+
| **targetingSettings** (dict) [optional]
|
|
91
|
+
| **amazonViewability** (dict) : [required in this object]
|
|
92
|
+
| **includeUnmeasurableImpressions** (boolean) : [required]
|
|
93
|
+
| **viewabilityTier** (string) : [required] Enum [ ALL_TIERS, GREATER_THAN_40_PERCENT, GREATER_THAN_50_PERCENT, GREATER_THAN_60_PERCENT, GREATER_THAN_70_PERCENT, LESS_THAN_40_PERCENT ]
|
|
94
|
+
| **automatedTargetingTactic** (string) : Enum [ AWARENESS, CUSTOMER_ACQUISITION, MAXIMIZE_PERFORMANCE, PROSPECTING, REMARKETING, RETENTION, SEARCH ]
|
|
95
|
+
| **defaultAudienceTargetingMatchType** (string) : Enum [ EXACT, SIMILAR ]
|
|
96
|
+
| **enableLanguageTargeting** (boolean)
|
|
97
|
+
| **tacticsConvertersExclusionType** (string) : Enum [ NO_EXCLUSION, RECENT_CONVERTERS ]
|
|
98
|
+
| **targetedPGDealId** (string)
|
|
99
|
+
| **timeZoneType** (string) : Enum [ ADVERTISER_REGION, VIEWER ]
|
|
100
|
+
| **userLocationSignal** (string) : Enum [ CURRENT, MULTIPLE_SIGNALS ]
|
|
101
|
+
| **videoCompletionTier** (string) : Enum [ ALL_TIERS, GREATER_THAN_10_PERCENT, GREATER_THAN_20_PERCENT, GREATER_THAN_30_PERCENT, GREATER_THAN_40_PERCENT, GREATER_THAN_50_PERCENT, GREATER_THAN_60_PERCENT, GREATER_THAN_70_PERCENT, GREATER_THAN_80_PERCENT, GREATER_THAN_90_PERCENT ]
|
|
102
|
+
| **adSettings** (dict) [optional]
|
|
103
|
+
| **productAttributeSetRefinementConfigurationId** (string)
|
|
104
|
+
| **advertisedProductCategoryIds** (list<string>) [optional]
|
|
105
|
+
| **creativeRotationType** (string) : Enum [ RANDOM, WEIGHTED ]
|
|
106
|
+
| **creativeType** (string) : Enum [ IMAGE, VIDEO ]
|
|
107
|
+
| **inventoryType** (string) : Enum [ AAP_MOBILE_APP, AMAZON_MOBILE_DISPLAY, AUDIO, AUDIO_AMAZON_DEAL, DISPLAY, LIVE_EVENTS, ONLINE_VIDEO, PODCAST, STANDARD_DISPLAY, STREAMING_TV, STREAMING_TV_AMAZON_DEAL, VIDEO ]
|
|
108
|
+
| **marketplaceScope** (string) : Enum [ GLOBAL, SINGLE_MARKETPLACE ]
|
|
109
|
+
| **marketplaces** (list<dict>) : Marketplaces where the ad group runs
|
|
110
|
+
| **marketplaceConfigurations** (list<dict>) : Each with **marketplace** and **overrides** (both required)
|
|
111
|
+
| **startDateTime** (string) : Start date and time
|
|
112
|
+
| **endDateTime** (string) : End date and time
|
|
113
|
+
| **fees** (list<dict>) : Each with **addToBudgetSpentAmount**, **feeType**, **feeValue**, **thirdPartyProvider** (all required)
|
|
114
|
+
| **frequencies** (list<dict>) : Frequency cap definitions
|
|
115
|
+
| **purchaseOrderNumber** (string)
|
|
116
|
+
| **retailerId** (string)
|
|
117
|
+
| **tags** (list<dict>) : Each with **key** and **value** (both required)
|
|
118
|
+
|
|
119
|
+
Headers
|
|
120
|
+
| **Amazon-Ads-AccountId** (string) [optional] Advertiser account identifier
|
|
121
|
+
|
|
122
|
+
Returns
|
|
123
|
+
ApiResponse
|
|
124
|
+
| **207** MultiStatus response with partial errors. Inspect the payload
|
|
125
|
+
to know which ad groups were created and which failed.
|
|
126
|
+
|
|
127
|
+
"""
|
|
128
|
+
schema_version = 'application/json'
|
|
129
|
+
headers = {"Accept": schema_version, "Content-Type": schema_version}
|
|
130
|
+
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
|
|
131
|
+
|
|
132
|
+
@sp_endpoint('/adsApi/v1/update/adGroups', method='POST')
|
|
133
|
+
def update_ad_groups(self, **kwargs) -> ApiResponse:
|
|
134
|
+
r"""
|
|
135
|
+
update_ad_groups(body: dict) -> ApiResponse
|
|
136
|
+
|
|
137
|
+
Amazon Ads API v1 - Update Ad Groups (operationId: UpdateAdGroup)
|
|
138
|
+
|
|
139
|
+
Request Body [Required]
|
|
140
|
+
| **adGroups** (list<dict>) : [required] One or more ad group objects.
|
|
141
|
+
Each object requires **adGroupId** and may include any of the fields below.
|
|
142
|
+
|
|
143
|
+
Ad group fields [optional except adGroupId]
|
|
144
|
+
| **adGroupId** (string) : [required] The identifier of the ad group to update.
|
|
145
|
+
| **adProduct** (string) : Enum [ AMAZON_DSP, SPONSORED_BRANDS, SPONSORED_DISPLAY, SPONSORED_PRODUCTS, SPONSORED_TELEVISION ]
|
|
146
|
+
| **name** (string) : Name of the ad group
|
|
147
|
+
| **state** (string) : Enum [ DRAFT, ENABLED, PAUSED ]
|
|
148
|
+
| **bid** (dict) : ``baseBid``, ``defaultBid``, ``maxAverageBid``, ``marketplaceSettings``
|
|
149
|
+
| **budgets** (list<dict>) : Same shape as in create
|
|
150
|
+
| **optimization** (dict) : ``bidStrategy``, ``budgetSettings``, ``goalSettings``
|
|
151
|
+
| **pacing** (dict) : ``deliveryProfile`` Enum [ ASAP, EVEN, PACE_AHEAD ]
|
|
152
|
+
| **targetingSettings** (dict) : ``amazonViewability``, ``defaultAudienceTargetingMatchType``, ``enableLanguageTargeting``, ``tacticsConvertersExclusionType``, ``targetedPGDealId``, ``timeZoneType``, ``userLocationSignal``, ``videoCompletionTier``
|
|
153
|
+
| **adSettings** (dict) : ``productAttributeSetRefinementConfigurationId``
|
|
154
|
+
| **advertisedProductCategoryIds** (list<string>)
|
|
155
|
+
| **creativeRotationType** (string) : Enum [ RANDOM, WEIGHTED ]
|
|
156
|
+
| **creativeType** (string) : Enum [ IMAGE, VIDEO ]
|
|
157
|
+
| **marketplaceScope** (string) : Enum [ GLOBAL, SINGLE_MARKETPLACE ]
|
|
158
|
+
| **marketplaces** (list<dict>)
|
|
159
|
+
| **marketplaceConfigurations** (list<dict>)
|
|
160
|
+
| **startDateTime** (string)
|
|
161
|
+
| **endDateTime** (string)
|
|
162
|
+
| **fees** (list<dict>)
|
|
163
|
+
| **frequencies** (list<dict>)
|
|
164
|
+
| **purchaseOrderNumber** (string)
|
|
165
|
+
| **tags** (list<dict>)
|
|
166
|
+
|
|
167
|
+
Headers
|
|
168
|
+
| **Amazon-Ads-AccountId** (string) [optional] Advertiser account identifier
|
|
169
|
+
|
|
170
|
+
Returns
|
|
171
|
+
ApiResponse
|
|
172
|
+
| **207** MultiStatus response with partial errors. Inspect the payload
|
|
173
|
+
to know which ad groups were updated and which failed.
|
|
174
|
+
|
|
175
|
+
"""
|
|
176
|
+
schema_version = 'application/json'
|
|
177
|
+
headers = {"Accept": schema_version, "Content-Type": schema_version}
|
|
178
|
+
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
|
|
179
|
+
|
|
180
|
+
@sp_endpoint('/adsApi/v1/delete/adGroups', method='POST')
|
|
181
|
+
def delete_ad_groups(self, **kwargs) -> ApiResponse:
|
|
182
|
+
r"""
|
|
183
|
+
delete_ad_groups(body: dict) -> ApiResponse
|
|
184
|
+
|
|
185
|
+
Amazon Ads API v1 - Delete Ad Groups (operationId: DeleteAdGroup)
|
|
186
|
+
|
|
187
|
+
Request Body [Required]
|
|
188
|
+
| **adGroupIds** (list<string>) : [required] Ad group identifiers to delete
|
|
189
|
+
|
|
190
|
+
Headers
|
|
191
|
+
| **Amazon-Ads-AccountId** (string) [optional] Advertiser account identifier
|
|
192
|
+
|
|
193
|
+
Returns
|
|
194
|
+
ApiResponse
|
|
195
|
+
| **207** MultiStatus response with partial errors. Inspect the payload
|
|
196
|
+
to know which ad group ids succeeded and which failed.
|
|
197
|
+
|
|
198
|
+
"""
|
|
199
|
+
schema_version = 'application/json'
|
|
200
|
+
headers = {"Accept": schema_version, "Content-Type": schema_version}
|
|
201
|
+
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
from ad_api.base import Client, sp_endpoint, ApiResponse, Utils
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Ads(Client):
|
|
5
|
+
r"""
|
|
6
|
+
Ads(account='default', marketplace: Marketplaces = Marketplaces.EU, credentials=None, debug=False)
|
|
7
|
+
|
|
8
|
+
Amazon Ads API v1 - unified Ads endpoints
|
|
9
|
+
|
|
10
|
+
The v1 API is not split by product: every call goes to the same resource
|
|
11
|
+
(``/adsApi/v1/...``) and the product is selected in the request body via
|
|
12
|
+
``adProductFilter``.
|
|
13
|
+
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
@sp_endpoint('/adsApi/v1/query/ads', method='POST')
|
|
17
|
+
def query_ads(self, **kwargs) -> ApiResponse:
|
|
18
|
+
r"""
|
|
19
|
+
query_ads(body: dict) -> ApiResponse
|
|
20
|
+
|
|
21
|
+
Amazon Ads API v1 - Query Ads (operationId: QueryAd)
|
|
22
|
+
|
|
23
|
+
Request Body [Required]
|
|
24
|
+
| **adProductFilter** (dict) : [required]
|
|
25
|
+
| **include** (list<AdProduct>) : Enum [ AMAZON_DSP, SPONSORED_BRANDS, SPONSORED_DISPLAY, SPONSORED_PRODUCTS, SPONSORED_TELEVISION ]
|
|
26
|
+
| **adIdFilter** (dict) [optional]
|
|
27
|
+
| **include** (list<string>) : Ad identifiers
|
|
28
|
+
| **adGroupIdFilter** (dict) [optional]
|
|
29
|
+
| **include** (list<string>) : Ad group identifiers
|
|
30
|
+
| **campaignIdFilter** (dict) [optional]
|
|
31
|
+
| **include** (list<string>) : Campaign identifiers
|
|
32
|
+
| **marketplaceScopeFilter** (dict) [optional]
|
|
33
|
+
| **include** (list<MarketplaceScope>) : Enum [ GLOBAL, SINGLE_MARKETPLACE ]
|
|
34
|
+
| **nameFilter** (dict) [optional]
|
|
35
|
+
| **include** (list<string>) : Ad names
|
|
36
|
+
| **queryTermMatchType** (string) : [required] Enum [ BROAD_MATCH, EXACT_MATCH ]
|
|
37
|
+
| **retailerScopeFilter** (dict) [optional]
|
|
38
|
+
| **include** (list<RetailerScope>) : Enum [ AMAZON, OTHER_RETAILERS ]
|
|
39
|
+
| **stateFilter** (dict) [optional]
|
|
40
|
+
| **include** (list<State>) : Enum [ ARCHIVED, DRAFT, ENABLED, PAUSED ]
|
|
41
|
+
| **maxResults** (int) [optional] Maximum number of records in the response
|
|
42
|
+
| **nextToken** (string) [optional] Token to navigate to the next page
|
|
43
|
+
|
|
44
|
+
Headers
|
|
45
|
+
| **Amazon-Ads-AccountId** (string) [optional] Advertiser account identifier
|
|
46
|
+
|
|
47
|
+
Returns
|
|
48
|
+
ApiResponse
|
|
49
|
+
| **ads** (list), **nextToken** (string)
|
|
50
|
+
|
|
51
|
+
"""
|
|
52
|
+
schema_version = 'application/json'
|
|
53
|
+
headers = {"Accept": schema_version, "Content-Type": schema_version}
|
|
54
|
+
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
|
|
55
|
+
|
|
56
|
+
@sp_endpoint('/adsApi/v1/create/ads', method='POST')
|
|
57
|
+
def create_ads(self, **kwargs) -> ApiResponse:
|
|
58
|
+
r"""
|
|
59
|
+
create_ads(body: dict) -> ApiResponse
|
|
60
|
+
|
|
61
|
+
Amazon Ads API v1 - Create Ads (operationId: CreateAd)
|
|
62
|
+
|
|
63
|
+
Request Body [Required]
|
|
64
|
+
| **ads** (list<dict>) : [required] One or more ad objects.
|
|
65
|
+
Each object requires **adProduct**, **adType**, **creative** and **state**.
|
|
66
|
+
|
|
67
|
+
Ad fields
|
|
68
|
+
| **adProduct** (string) : [required] Enum [ AMAZON_DSP, SPONSORED_BRANDS, SPONSORED_DISPLAY, SPONSORED_PRODUCTS, SPONSORED_TELEVISION ]
|
|
69
|
+
| **adType** (string) : [required] Enum [ AUDIO, COMPONENT, DISPLAY, PRODUCT_AD, THIRD_PARTY, VIDEO ]
|
|
70
|
+
| **creative** (dict) : [required] Exactly one of the six variants below
|
|
71
|
+
| **state** (string) : [required] Enum [ DRAFT, ENABLED, PAUSED ]
|
|
72
|
+
| **adGroupId** (string) [optional] Identifier of the parent ad group
|
|
73
|
+
| **name** (string) [optional] Name of the ad
|
|
74
|
+
| **marketplaceScope** (string) : Enum [ GLOBAL, SINGLE_MARKETPLACE ]
|
|
75
|
+
| **marketplaces** (list<dict>) : Marketplaces where the ad runs
|
|
76
|
+
| **marketplaceConfigurations** (list<dict>) : Per marketplace overrides
|
|
77
|
+
| **tags** (list<dict>) : Each with **key** and **value** (both required)
|
|
78
|
+
|
|
79
|
+
Creative variants (use exactly one, matching ``adType``)
|
|
80
|
+
| **audioCreative** (dict) : For ``AUDIO``
|
|
81
|
+
| **displayCreative** (dict) : For ``DISPLAY``, carries ``standardDisplaySettings``
|
|
82
|
+
| **videoCreative** (dict) : For ``VIDEO``, carries ``onlineVideoSettings`` / ``streamingTvSettings``
|
|
83
|
+
| **thirdPartyCreative** (dict) : For ``THIRD_PARTY``, carries ``thirdPartyDisplaySettings`` / ``thirdPartyVideoSettings``
|
|
84
|
+
| **componentCreative** (dict) : For ``COMPONENT``, carries ``assetBasedCreativeSettings``,
|
|
85
|
+
``autoCollectionSettings``, ``brandGallerySettings``, ``brandStoreSettings``,
|
|
86
|
+
``manualCollectionSettings``, ``productCollectionSettings``,
|
|
87
|
+
``productVideoSettings``, ``responsiveEcommerceSettings``,
|
|
88
|
+
``storeSpotlightSettings``
|
|
89
|
+
| **productCreative** (dict) : For ``PRODUCT_AD``, carries ``productCreativeSettings``
|
|
90
|
+
|
|
91
|
+
Example of the envelope::
|
|
92
|
+
|
|
93
|
+
{"creative": {"productCreative": {"productCreativeSettings": {...}}}}
|
|
94
|
+
|
|
95
|
+
Headers
|
|
96
|
+
| **Amazon-Ads-AccountId** (string) [optional] Advertiser account identifier
|
|
97
|
+
|
|
98
|
+
Returns
|
|
99
|
+
ApiResponse
|
|
100
|
+
| **207** MultiStatus response with partial errors. Inspect the payload
|
|
101
|
+
to know which ads were created and which failed.
|
|
102
|
+
|
|
103
|
+
"""
|
|
104
|
+
schema_version = 'application/json'
|
|
105
|
+
headers = {"Accept": schema_version, "Content-Type": schema_version}
|
|
106
|
+
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
|
|
107
|
+
|
|
108
|
+
@sp_endpoint('/adsApi/v1/update/ads', method='POST')
|
|
109
|
+
def update_ads(self, **kwargs) -> ApiResponse:
|
|
110
|
+
r"""
|
|
111
|
+
update_ads(body: dict) -> ApiResponse
|
|
112
|
+
|
|
113
|
+
Amazon Ads API v1 - Update Ads (operationId: UpdateAd)
|
|
114
|
+
|
|
115
|
+
Request Body [Required]
|
|
116
|
+
| **ads** (list<dict>) : [required] One or more ad objects.
|
|
117
|
+
Each object requires **adId** and may include any of the fields below.
|
|
118
|
+
|
|
119
|
+
Ad fields [optional except adId]
|
|
120
|
+
| **adId** (string) : [required] The identifier of the ad to update.
|
|
121
|
+
| **creative** (dict) : Same six-variant envelope as in create
|
|
122
|
+
| **name** (string) : Name of the ad
|
|
123
|
+
| **state** (string) : Enum [ DRAFT, ENABLED, PAUSED ]
|
|
124
|
+
| **marketplaceScope** (string) : Enum [ GLOBAL, SINGLE_MARKETPLACE ]
|
|
125
|
+
| **marketplaces** (list<dict>)
|
|
126
|
+
| **marketplaceConfigurations** (list<dict>)
|
|
127
|
+
| **tags** (list<dict>)
|
|
128
|
+
|
|
129
|
+
Headers
|
|
130
|
+
| **Amazon-Ads-AccountId** (string) [optional] Advertiser account identifier
|
|
131
|
+
|
|
132
|
+
Returns
|
|
133
|
+
ApiResponse
|
|
134
|
+
| **207** MultiStatus response with partial errors. Inspect the payload
|
|
135
|
+
to know which ads were updated and which failed.
|
|
136
|
+
|
|
137
|
+
"""
|
|
138
|
+
schema_version = 'application/json'
|
|
139
|
+
headers = {"Accept": schema_version, "Content-Type": schema_version}
|
|
140
|
+
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
|
|
141
|
+
|
|
142
|
+
@sp_endpoint('/adsApi/v1/delete/ads', method='POST')
|
|
143
|
+
def delete_ads(self, **kwargs) -> ApiResponse:
|
|
144
|
+
r"""
|
|
145
|
+
delete_ads(body: dict) -> ApiResponse
|
|
146
|
+
|
|
147
|
+
Amazon Ads API v1 - Delete Ads (operationId: DeleteAd)
|
|
148
|
+
|
|
149
|
+
Request Body [Required]
|
|
150
|
+
| **adIds** (list<string>) : [required] Ad identifiers to delete
|
|
151
|
+
|
|
152
|
+
Headers
|
|
153
|
+
| **Amazon-Ads-AccountId** (string) [optional] Advertiser account identifier
|
|
154
|
+
|
|
155
|
+
Returns
|
|
156
|
+
ApiResponse
|
|
157
|
+
| **207** MultiStatus response with partial errors. Inspect the payload
|
|
158
|
+
to know which ad ids succeeded and which failed.
|
|
159
|
+
|
|
160
|
+
"""
|
|
161
|
+
schema_version = 'application/json'
|
|
162
|
+
headers = {"Accept": schema_version, "Content-Type": schema_version}
|
|
163
|
+
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
|