python-amazon-ad-api 1.0.1__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.
Files changed (136) hide show
  1. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/PKG-INFO +21 -28
  2. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/README.md +20 -27
  3. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/v1/__init__.py +2 -0
  4. python_amazon_ad_api-1.0.2/ad_api/api/v1/ads.py +163 -0
  5. python_amazon_ad_api-1.0.2/ad_api/version.py +1 -0
  6. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/python_amazon_ad_api.egg-info/PKG-INFO +21 -28
  7. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/python_amazon_ad_api.egg-info/SOURCES.txt +1 -0
  8. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/setup.cfg +1 -1
  9. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/setup.py +1 -1
  10. python_amazon_ad_api-1.0.1/ad_api/version.py +0 -1
  11. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/LICENSE +0 -0
  12. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/__init__.py +0 -0
  13. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/__init__.py +0 -0
  14. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/account.py +0 -0
  15. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/advertising_test_account.py +0 -0
  16. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/attribution.py +0 -0
  17. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/audiences.py +0 -0
  18. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/billing.py +0 -0
  19. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/brand_metrics.py +0 -0
  20. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/creative_assets.py +0 -0
  21. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/dsp/__init__.py +0 -0
  22. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/dsp/access_token_client.py +0 -0
  23. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/dsp/client.py +0 -0
  24. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/dsp/credential_provider.py +0 -0
  25. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/dsp/reports.py +0 -0
  26. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/eligibility.py +0 -0
  27. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/exports.py +0 -0
  28. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/history.py +0 -0
  29. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/insights.py +0 -0
  30. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/invoices.py +0 -0
  31. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/localization.py +0 -0
  32. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/manager_accounts.py +0 -0
  33. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/metadata.py +0 -0
  34. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/portfolios.py +0 -0
  35. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/portfolios_v3.py +0 -0
  36. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/profiles.py +0 -0
  37. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/recommendations.py +0 -0
  38. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/reports.py +0 -0
  39. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/__init__.py +0 -0
  40. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/ad_creatives_v4.py +0 -0
  41. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/ad_groups.py +0 -0
  42. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/ad_groups_v4.py +0 -0
  43. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/ads_v4.py +0 -0
  44. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/benchmarks.py +0 -0
  45. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/bid_recommendations.py +0 -0
  46. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/brands.py +0 -0
  47. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/campaigns.py +0 -0
  48. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/campaigns_v4.py +0 -0
  49. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/forecast.py +0 -0
  50. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/keywords.py +0 -0
  51. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/keywords_recommendations.py +0 -0
  52. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/landing_page_asins.py +0 -0
  53. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/media.py +0 -0
  54. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/moderation.py +0 -0
  55. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/negative_keywords.py +0 -0
  56. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/negative_product_targeting.py +0 -0
  57. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/product_targeting.py +0 -0
  58. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/recommendations.py +0 -0
  59. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/reports.py +0 -0
  60. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/snapshots.py +0 -0
  61. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/stores.py +0 -0
  62. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/targeting_recommendations.py +0 -0
  63. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sb/themes.py +0 -0
  64. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/__init__.py +0 -0
  65. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/ad_groups.py +0 -0
  66. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/bid_recommendations.py +0 -0
  67. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/brand_safety.py +0 -0
  68. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/budget_rules.py +0 -0
  69. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/campaigns.py +0 -0
  70. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/campaigns_budget_usage.py +0 -0
  71. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/creatives.py +0 -0
  72. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/forecast.py +0 -0
  73. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/negative_product_targeting.py +0 -0
  74. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/product_ads.py +0 -0
  75. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/product_targeting.py +0 -0
  76. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/recommendations.py +0 -0
  77. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/reports.py +0 -0
  78. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/snapshots.py +0 -0
  79. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sd/targeting_recommendations.py +0 -0
  80. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/__init__.py +0 -0
  81. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/ad_groups.py +0 -0
  82. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/ad_groups_v3.py +0 -0
  83. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/bid_recommendations.py +0 -0
  84. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/bid_recommendations_v3.py +0 -0
  85. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/budget_initial_recommendation.py +0 -0
  86. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/budget_recommendations.py +0 -0
  87. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/budget_rules.py +0 -0
  88. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/budget_rules_recommendations.py +0 -0
  89. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/campaign_consolidated_recommendations.py +0 -0
  90. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/campaign_negative_keywords.py +0 -0
  91. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/campaign_negative_keywords_v3.py +0 -0
  92. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/campaign_negative_targets.py +0 -0
  93. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/campaigns.py +0 -0
  94. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/campaigns_budget_usage.py +0 -0
  95. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/campaigns_v3.py +0 -0
  96. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/campaings_optimization.py +0 -0
  97. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/keywords.py +0 -0
  98. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/keywords_v3.py +0 -0
  99. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/negative_keywords.py +0 -0
  100. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/negative_keywords_v3.py +0 -0
  101. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/negative_product_targeting.py +0 -0
  102. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/negative_product_targeting_v3.py +0 -0
  103. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/product_ads.py +0 -0
  104. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/product_ads_v3.py +0 -0
  105. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/product_recommendations.py +0 -0
  106. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/product_targeting.py +0 -0
  107. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/product_targeting_v3.py +0 -0
  108. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/ranked_keywords_recommendations.py +0 -0
  109. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/reports.py +0 -0
  110. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/schedule_based_bid_optimization.py +0 -0
  111. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/snapshots.py +0 -0
  112. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/sp/suggested_keywords.py +0 -0
  113. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/stores.py +0 -0
  114. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/stream.py +0 -0
  115. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/v1/ad_groups.py +0 -0
  116. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/v1/campaigns.py +0 -0
  117. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/api/validation_configurations.py +0 -0
  118. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/auth/__init__.py +0 -0
  119. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/auth/access_token_client.py +0 -0
  120. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/auth/access_token_response.py +0 -0
  121. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/auth/credentials.py +0 -0
  122. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/auth/exceptions.py +0 -0
  123. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/base/__init__.py +0 -0
  124. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/base/api_response.py +0 -0
  125. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/base/base_client.py +0 -0
  126. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/base/client.py +0 -0
  127. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/base/config.py +0 -0
  128. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/base/credential_provider.py +0 -0
  129. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/base/exceptions.py +0 -0
  130. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/base/helpers.py +0 -0
  131. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/base/marketplaces.py +0 -0
  132. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/ad_api/base/utils.py +0 -0
  133. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/pyproject.toml +0 -0
  134. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/python_amazon_ad_api.egg-info/dependency_links.txt +0 -0
  135. {python_amazon_ad_api-1.0.1 → python_amazon_ad_api-1.0.2}/python_amazon_ad_api.egg-info/requires.txt +0 -0
  136. {python_amazon_ad_api-1.0.1 → 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.1
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
- ```python
307
- from ad_api.api import v1
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
- ```python
279
- from ad_api.api import v1
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.
@@ -1,7 +1,9 @@
1
1
  from .campaigns import Campaigns
2
2
  from .ad_groups import AdGroups
3
+ from .ads import Ads
3
4
 
4
5
  __all__ = [
5
6
  "Campaigns",
6
7
  "AdGroups",
8
+ "Ads",
7
9
  ]
@@ -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)
@@ -0,0 +1 @@
1
+ __version__ = "1.0.2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-amazon-ad-api
3
- Version: 1.0.1
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
- ```python
307
- from ad_api.api import v1
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.
@@ -110,6 +110,7 @@ ad_api/api/sp/snapshots.py
110
110
  ad_api/api/sp/suggested_keywords.py
111
111
  ad_api/api/v1/__init__.py
112
112
  ad_api/api/v1/ad_groups.py
113
+ ad_api/api/v1/ads.py
113
114
  ad_api/api/v1/campaigns.py
114
115
  ad_api/auth/__init__.py
115
116
  ad_api/auth/access_token_client.py
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = python-amazon-ad-api
3
- version = 1.0.1
3
+ version = 1.0.2
4
4
  author = Daniel Alvaro
5
5
  author_email = denisneuf@hotmail.com
6
6
  description = Python wrapper for the Amazon Advertising API
@@ -2,7 +2,7 @@ from setuptools import setup
2
2
 
3
3
  setup(
4
4
  name='python-amazon-ad-api',
5
- version='1.0.1',
5
+ version='1.0.2',
6
6
  install_requires=[
7
7
  "requests>=2.27.1,<2.35.0",
8
8
  "six>=1.16,<1.18",
@@ -1 +0,0 @@
1
- __version__ = "1.0.1"