python-amazon-ad-api 0.6.3__tar.gz → 0.6.4__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-0.6.3/python_amazon_ad_api.egg-info → python_amazon_ad_api-0.6.4}/PKG-INFO +89 -30
- python_amazon_ad_api-0.6.3/PKG-INFO → python_amazon_ad_api-0.6.4/README.md +78 -47
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/__init__.py +1 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/portfolios.py +6 -0
- python_amazon_ad_api-0.6.4/ad_api/api/portfolios_v3.py +68 -0
- python_amazon_ad_api-0.6.3/README.md → python_amazon_ad_api-0.6.4/python_amazon_ad_api.egg-info/PKG-INFO +106 -26
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/python_amazon_ad_api.egg-info/SOURCES.txt +1 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/python_amazon_ad_api.egg-info/requires.txt +2 -2
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/setup.cfg +1 -1
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/setup.py +3 -3
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/LICENSE +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/__init__.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/account.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/advertising_test_account.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/attribution.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/audiences.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/billing.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/brand_metrics.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/creative_assets.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/dsp/__init__.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/dsp/access_token_client.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/dsp/client.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/dsp/credential_provider.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/dsp/reports.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/eligibility.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/exports.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/history.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/insights.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/invoices.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/localization.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/manager_accounts.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/metadata.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/profiles.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/recommendations.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/reports.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/__init__.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/ad_creatives_v4.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/ad_groups.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/ad_groups_v4.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/ads_v4.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/benchmarks.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/bid_recommendations.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/brands.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/campaigns.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/campaigns_v4.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/forecast.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/keywords.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/keywords_recommendations.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/landing_page_asins.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/media.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/moderation.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/negative_keywords.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/negative_product_targeting.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/product_targeting.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/recommendations.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/reports.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/snapshots.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/stores.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/targeting_recommendations.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/__init__.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/ad_groups.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/bid_recommendations.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/brand_safety.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/budget_rules.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/campaigns.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/campaigns_budget_usage.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/creatives.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/forecast.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/negative_product_targeting.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/product_ads.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/product_targeting.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/recommendations.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/reports.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/snapshots.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/targeting_recommendations.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/__init__.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/ad_groups.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/ad_groups_v3.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/bid_recommendations.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/bid_recommendations_v3.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/budget_initial_recommendation.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/budget_recommendations.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/budget_rules.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/budget_rules_recommendations.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/campaign_consolidated_recommendations.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/campaign_negative_keywords.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/campaign_negative_keywords_v3.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/campaign_negative_targets.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/campaigns.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/campaigns_budget_usage.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/campaigns_v3.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/campaings_optimization.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/keywords.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/keywords_v3.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/negative_keywords.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/negative_keywords_v3.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/negative_product_targeting.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/negative_product_targeting_v3.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/product_ads.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/product_ads_v3.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/product_recommendations.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/product_targeting.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/product_targeting_v3.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/ranked_keywords_recommendations.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/reports.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/schedule_based_bid_optimization.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/snapshots.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/suggested_keywords.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/stores.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/stream.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/validation_configurations.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/auth/__init__.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/auth/access_token_client.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/auth/access_token_response.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/auth/credentials.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/auth/exceptions.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/base/__init__.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/base/api_response.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/base/base_client.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/base/client.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/base/config.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/base/credential_provider.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/base/exceptions.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/base/helpers.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/base/marketplaces.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/base/utils.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/version.py +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/pyproject.toml +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/python_amazon_ad_api.egg-info/dependency_links.txt +0 -0
- {python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/python_amazon_ad_api.egg-info/top_level.txt +0 -0
{python_amazon_ad_api-0.6.3/python_amazon_ad_api.egg-info → python_amazon_ad_api-0.6.4}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: python-amazon-ad-api
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.4
|
|
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
|
|
@@ -15,9 +15,16 @@ License-File: LICENSE
|
|
|
15
15
|
Requires-Dist: requests<2.33.0,>=2.27.1
|
|
16
16
|
Requires-Dist: six<1.18,>=1.16
|
|
17
17
|
Requires-Dist: cachetools<5.6,>=5.0
|
|
18
|
-
Requires-Dist: pycryptodome<3.
|
|
19
|
-
Requires-Dist: pytz<
|
|
18
|
+
Requires-Dist: pycryptodome<3.23,>=3.13
|
|
19
|
+
Requires-Dist: pytz<2026.0,>=2021.3
|
|
20
20
|
Requires-Dist: confuse<2.1,>=1.7
|
|
21
|
+
Dynamic: author
|
|
22
|
+
Dynamic: author-email
|
|
23
|
+
Dynamic: home-page
|
|
24
|
+
Dynamic: license
|
|
25
|
+
Dynamic: license-file
|
|
26
|
+
Dynamic: requires-dist
|
|
27
|
+
Dynamic: summary
|
|
21
28
|
|
|
22
29
|
# PYTHON-AMAZON-AD-API
|
|
23
30
|
|
|
@@ -69,7 +76,19 @@ my_credentials = dict(
|
|
|
69
76
|
profile_id='your-profile_id',
|
|
70
77
|
)
|
|
71
78
|
|
|
72
|
-
|
|
79
|
+
info = \
|
|
80
|
+
{
|
|
81
|
+
"stateFilter":
|
|
82
|
+
{
|
|
83
|
+
"include": [
|
|
84
|
+
"ENABLED"
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
result = sponsored_products.CampaignsV3(credentials=my_credentials).list_campaigns(
|
|
90
|
+
body=info
|
|
91
|
+
)
|
|
73
92
|
|
|
74
93
|
```
|
|
75
94
|
|
|
@@ -101,9 +120,9 @@ Python code
|
|
|
101
120
|
from ad_api.api import sponsored_products
|
|
102
121
|
|
|
103
122
|
# Leave empty will use the 'default' account
|
|
104
|
-
result=sponsored_products.
|
|
123
|
+
result=sponsored_products.CampaignsV3().list_campaigns()
|
|
105
124
|
# will use germany account data
|
|
106
|
-
result=sponsored_products.
|
|
125
|
+
result=sponsored_products.CampaignsV3(account="germany").list_campaigns()
|
|
107
126
|
```
|
|
108
127
|
|
|
109
128
|
|
|
@@ -127,7 +146,7 @@ from ad_api.api import sponsored_products
|
|
|
127
146
|
from ad_api.base import Marketplaces
|
|
128
147
|
|
|
129
148
|
# You can pass NA or US, CA, MX or BR for North America and JP, AU or SG for Far East
|
|
130
|
-
result=sponsored_products.
|
|
149
|
+
result=sponsored_products.CampaignsV3(marketplace=Marketplaces.NA).list_campaigns()
|
|
131
150
|
|
|
132
151
|
```
|
|
133
152
|
|
|
@@ -139,10 +158,20 @@ You can use a [try](https://docs.python.org/3.10/reference/compound_stmts.html#t
|
|
|
139
158
|
from ad_api.api import sponsored_products
|
|
140
159
|
from ad_api.base import AdvertisingApiException
|
|
141
160
|
|
|
161
|
+
info = \
|
|
162
|
+
{
|
|
163
|
+
"stateFilter":
|
|
164
|
+
{
|
|
165
|
+
"include": [
|
|
166
|
+
"ENABLED"
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
142
171
|
try:
|
|
143
172
|
|
|
144
|
-
result = sponsored_products.
|
|
145
|
-
|
|
173
|
+
result = sponsored_products.CampaignsV3().list_campaigns(
|
|
174
|
+
body=info
|
|
146
175
|
)
|
|
147
176
|
|
|
148
177
|
logging.info(result)
|
|
@@ -159,10 +188,21 @@ Use debug=True if you want see some logs like the header you submit to the api e
|
|
|
159
188
|
from ad_api.api import sponsored_products
|
|
160
189
|
from ad_api.base import AdvertisingApiException
|
|
161
190
|
|
|
191
|
+
|
|
192
|
+
info = \
|
|
193
|
+
{
|
|
194
|
+
"stateFilter":
|
|
195
|
+
{
|
|
196
|
+
"include": [
|
|
197
|
+
"ENABLED"
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
162
202
|
try:
|
|
163
203
|
|
|
164
|
-
result = sponsored_products.
|
|
165
|
-
|
|
204
|
+
result = sponsored_products.CampaignsV3(debug=True).list_campaigns(
|
|
205
|
+
body=info
|
|
166
206
|
)
|
|
167
207
|
|
|
168
208
|
logging.info(result)
|
|
@@ -222,7 +262,12 @@ curl \
|
|
|
222
262
|
|
|
223
263
|
* [Profiles](https://python-amazon-ad-api.readthedocs.io/en/latest/api/profiles.html)
|
|
224
264
|
* [Manager Accounts](https://python-amazon-ad-api.readthedocs.io/en/latest/api/manager_accounts.html)
|
|
265
|
+
|
|
266
|
+
Warning: [PLANNED DEPRECATION 1/3/2025]
|
|
267
|
+
There is a new version 3 Portfolios API, please check the [migration guide](https://advertising.amazon.com/API/docs/en-us/reference/migration-guides/portfolios-v2-v3).
|
|
268
|
+
|
|
225
269
|
* [Portfolios](https://python-amazon-ad-api.readthedocs.io/en/latest/api/portfolios.html)
|
|
270
|
+
* [PortfoliosV3](https://python-amazon-ad-api.readthedocs.io/en/latest/api/portfoliosV3.html)
|
|
226
271
|
* [Invoices](https://python-amazon-ad-api.readthedocs.io/en/latest/api/invoices.html)
|
|
227
272
|
* [Billing](https://python-amazon-ad-api.readthedocs.io/en/latest/api/billing.html)
|
|
228
273
|
* [Audiences](https://python-amazon-ad-api.readthedocs.io/en/latest/api/audiences.html)
|
|
@@ -334,38 +379,52 @@ There is a new version 3 of Sponsored Product API, please check the [migration g
|
|
|
334
379
|
```python
|
|
335
380
|
import logging
|
|
336
381
|
from ad_api.base import AdvertisingApiException
|
|
337
|
-
from ad_api.api
|
|
382
|
+
from ad_api.api import sponsored_products
|
|
338
383
|
|
|
339
384
|
logging.basicConfig(
|
|
340
385
|
level=logging.DEBUG,
|
|
341
386
|
format="%(asctime)s:%(levelname)s:%(message)s"
|
|
342
387
|
)
|
|
343
388
|
|
|
389
|
+
def sp_list_campaigns_v3(info: dict = None):
|
|
344
390
|
|
|
345
|
-
credentials = dict(
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
)
|
|
391
|
+
credentials = dict(
|
|
392
|
+
refresh_token='your-refresh_token',
|
|
393
|
+
client_id='your-client_id',
|
|
394
|
+
client_secret='your-client_secret',
|
|
395
|
+
profile_id='your-profile_id',
|
|
396
|
+
)
|
|
351
397
|
|
|
352
|
-
try:
|
|
398
|
+
try:
|
|
399
|
+
result = sponsored_products.CampaignsV3(credentials=credentials, debug=True).list_campaigns(
|
|
400
|
+
body=info
|
|
401
|
+
)
|
|
402
|
+
payload = result.payload
|
|
403
|
+
return payload
|
|
404
|
+
except AdvertisingApiException as error:
|
|
405
|
+
logging.error(error)
|
|
406
|
+
logging.error(error.code)
|
|
353
407
|
|
|
354
|
-
states = 'enabled'
|
|
355
408
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
409
|
+
state_filter = \
|
|
410
|
+
{
|
|
411
|
+
"stateFilter":
|
|
412
|
+
{
|
|
413
|
+
"include": [
|
|
414
|
+
"ENABLED"
|
|
415
|
+
]
|
|
416
|
+
}
|
|
417
|
+
}
|
|
359
418
|
|
|
360
|
-
|
|
361
|
-
for campaign in campaigns:
|
|
362
|
-
logging.info(campaign)
|
|
419
|
+
enabled_campaigns = sp_list_campaigns_v3(state_filter).get("campaigns")
|
|
363
420
|
|
|
364
|
-
|
|
421
|
+
|
|
422
|
+
for campaign in enabled_campaigns:
|
|
423
|
+
logging.info(campaign)
|
|
424
|
+
|
|
425
|
+
logging.info(len(campaigns))
|
|
365
426
|
|
|
366
427
|
|
|
367
|
-
except AdvertisingApiException as error:
|
|
368
|
-
logging.info(error)
|
|
369
428
|
|
|
370
429
|
```
|
|
371
430
|
|
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: python-amazon-ad-api
|
|
3
|
-
Version: 0.6.3
|
|
4
|
-
Summary: Python wrapper for the Amazon Advertising API
|
|
5
|
-
Home-page: https://github.com/denisneuf/python-amazon-ad-api
|
|
6
|
-
Author: Daniel Alvaro
|
|
7
|
-
Author-email: denisneuf@hotmail.com
|
|
8
|
-
License: MIT
|
|
9
|
-
Project-URL: Bug Tracker, https://github.com/denisneuf/python-amazon-ad-api/issues
|
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
-
Classifier: Operating System :: OS Independent
|
|
13
|
-
Description-Content-Type: text/markdown
|
|
14
|
-
License-File: LICENSE
|
|
15
|
-
Requires-Dist: requests<2.33.0,>=2.27.1
|
|
16
|
-
Requires-Dist: six<1.18,>=1.16
|
|
17
|
-
Requires-Dist: cachetools<5.6,>=5.0
|
|
18
|
-
Requires-Dist: pycryptodome<3.22,>=3.13
|
|
19
|
-
Requires-Dist: pytz<2025.0,>=2021.3
|
|
20
|
-
Requires-Dist: confuse<2.1,>=1.7
|
|
21
|
-
|
|
22
1
|
# PYTHON-AMAZON-AD-API
|
|
23
2
|
|
|
24
3
|

|
|
@@ -69,7 +48,19 @@ my_credentials = dict(
|
|
|
69
48
|
profile_id='your-profile_id',
|
|
70
49
|
)
|
|
71
50
|
|
|
72
|
-
|
|
51
|
+
info = \
|
|
52
|
+
{
|
|
53
|
+
"stateFilter":
|
|
54
|
+
{
|
|
55
|
+
"include": [
|
|
56
|
+
"ENABLED"
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
result = sponsored_products.CampaignsV3(credentials=my_credentials).list_campaigns(
|
|
62
|
+
body=info
|
|
63
|
+
)
|
|
73
64
|
|
|
74
65
|
```
|
|
75
66
|
|
|
@@ -101,9 +92,9 @@ Python code
|
|
|
101
92
|
from ad_api.api import sponsored_products
|
|
102
93
|
|
|
103
94
|
# Leave empty will use the 'default' account
|
|
104
|
-
result=sponsored_products.
|
|
95
|
+
result=sponsored_products.CampaignsV3().list_campaigns()
|
|
105
96
|
# will use germany account data
|
|
106
|
-
result=sponsored_products.
|
|
97
|
+
result=sponsored_products.CampaignsV3(account="germany").list_campaigns()
|
|
107
98
|
```
|
|
108
99
|
|
|
109
100
|
|
|
@@ -127,7 +118,7 @@ from ad_api.api import sponsored_products
|
|
|
127
118
|
from ad_api.base import Marketplaces
|
|
128
119
|
|
|
129
120
|
# You can pass NA or US, CA, MX or BR for North America and JP, AU or SG for Far East
|
|
130
|
-
result=sponsored_products.
|
|
121
|
+
result=sponsored_products.CampaignsV3(marketplace=Marketplaces.NA).list_campaigns()
|
|
131
122
|
|
|
132
123
|
```
|
|
133
124
|
|
|
@@ -139,10 +130,20 @@ You can use a [try](https://docs.python.org/3.10/reference/compound_stmts.html#t
|
|
|
139
130
|
from ad_api.api import sponsored_products
|
|
140
131
|
from ad_api.base import AdvertisingApiException
|
|
141
132
|
|
|
133
|
+
info = \
|
|
134
|
+
{
|
|
135
|
+
"stateFilter":
|
|
136
|
+
{
|
|
137
|
+
"include": [
|
|
138
|
+
"ENABLED"
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
142
143
|
try:
|
|
143
144
|
|
|
144
|
-
result = sponsored_products.
|
|
145
|
-
|
|
145
|
+
result = sponsored_products.CampaignsV3().list_campaigns(
|
|
146
|
+
body=info
|
|
146
147
|
)
|
|
147
148
|
|
|
148
149
|
logging.info(result)
|
|
@@ -159,10 +160,21 @@ Use debug=True if you want see some logs like the header you submit to the api e
|
|
|
159
160
|
from ad_api.api import sponsored_products
|
|
160
161
|
from ad_api.base import AdvertisingApiException
|
|
161
162
|
|
|
163
|
+
|
|
164
|
+
info = \
|
|
165
|
+
{
|
|
166
|
+
"stateFilter":
|
|
167
|
+
{
|
|
168
|
+
"include": [
|
|
169
|
+
"ENABLED"
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
162
174
|
try:
|
|
163
175
|
|
|
164
|
-
result = sponsored_products.
|
|
165
|
-
|
|
176
|
+
result = sponsored_products.CampaignsV3(debug=True).list_campaigns(
|
|
177
|
+
body=info
|
|
166
178
|
)
|
|
167
179
|
|
|
168
180
|
logging.info(result)
|
|
@@ -222,7 +234,12 @@ curl \
|
|
|
222
234
|
|
|
223
235
|
* [Profiles](https://python-amazon-ad-api.readthedocs.io/en/latest/api/profiles.html)
|
|
224
236
|
* [Manager Accounts](https://python-amazon-ad-api.readthedocs.io/en/latest/api/manager_accounts.html)
|
|
237
|
+
|
|
238
|
+
Warning: [PLANNED DEPRECATION 1/3/2025]
|
|
239
|
+
There is a new version 3 Portfolios API, please check the [migration guide](https://advertising.amazon.com/API/docs/en-us/reference/migration-guides/portfolios-v2-v3).
|
|
240
|
+
|
|
225
241
|
* [Portfolios](https://python-amazon-ad-api.readthedocs.io/en/latest/api/portfolios.html)
|
|
242
|
+
* [PortfoliosV3](https://python-amazon-ad-api.readthedocs.io/en/latest/api/portfoliosV3.html)
|
|
226
243
|
* [Invoices](https://python-amazon-ad-api.readthedocs.io/en/latest/api/invoices.html)
|
|
227
244
|
* [Billing](https://python-amazon-ad-api.readthedocs.io/en/latest/api/billing.html)
|
|
228
245
|
* [Audiences](https://python-amazon-ad-api.readthedocs.io/en/latest/api/audiences.html)
|
|
@@ -334,38 +351,52 @@ There is a new version 3 of Sponsored Product API, please check the [migration g
|
|
|
334
351
|
```python
|
|
335
352
|
import logging
|
|
336
353
|
from ad_api.base import AdvertisingApiException
|
|
337
|
-
from ad_api.api
|
|
354
|
+
from ad_api.api import sponsored_products
|
|
338
355
|
|
|
339
356
|
logging.basicConfig(
|
|
340
357
|
level=logging.DEBUG,
|
|
341
358
|
format="%(asctime)s:%(levelname)s:%(message)s"
|
|
342
359
|
)
|
|
343
360
|
|
|
361
|
+
def sp_list_campaigns_v3(info: dict = None):
|
|
344
362
|
|
|
345
|
-
credentials = dict(
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
)
|
|
363
|
+
credentials = dict(
|
|
364
|
+
refresh_token='your-refresh_token',
|
|
365
|
+
client_id='your-client_id',
|
|
366
|
+
client_secret='your-client_secret',
|
|
367
|
+
profile_id='your-profile_id',
|
|
368
|
+
)
|
|
351
369
|
|
|
352
|
-
try:
|
|
370
|
+
try:
|
|
371
|
+
result = sponsored_products.CampaignsV3(credentials=credentials, debug=True).list_campaigns(
|
|
372
|
+
body=info
|
|
373
|
+
)
|
|
374
|
+
payload = result.payload
|
|
375
|
+
return payload
|
|
376
|
+
except AdvertisingApiException as error:
|
|
377
|
+
logging.error(error)
|
|
378
|
+
logging.error(error.code)
|
|
353
379
|
|
|
354
|
-
states = 'enabled'
|
|
355
380
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
381
|
+
state_filter = \
|
|
382
|
+
{
|
|
383
|
+
"stateFilter":
|
|
384
|
+
{
|
|
385
|
+
"include": [
|
|
386
|
+
"ENABLED"
|
|
387
|
+
]
|
|
388
|
+
}
|
|
389
|
+
}
|
|
359
390
|
|
|
360
|
-
|
|
361
|
-
for campaign in campaigns:
|
|
362
|
-
logging.info(campaign)
|
|
391
|
+
enabled_campaigns = sp_list_campaigns_v3(state_filter).get("campaigns")
|
|
363
392
|
|
|
364
|
-
|
|
393
|
+
|
|
394
|
+
for campaign in enabled_campaigns:
|
|
395
|
+
logging.info(campaign)
|
|
396
|
+
|
|
397
|
+
logging.info(len(campaigns))
|
|
365
398
|
|
|
366
399
|
|
|
367
|
-
except AdvertisingApiException as error:
|
|
368
|
-
logging.info(error)
|
|
369
400
|
|
|
370
401
|
```
|
|
371
402
|
|
|
@@ -10,6 +10,7 @@ from .creative_assets import CreativeAssets
|
|
|
10
10
|
from .localization import Localization
|
|
11
11
|
from .audiences import Audiences
|
|
12
12
|
from .portfolios import Portfolios
|
|
13
|
+
from .portfolios_v3 import PortfoliosV3
|
|
13
14
|
from .insights import Insights
|
|
14
15
|
from . import sp as sponsored_products
|
|
15
16
|
from . import sb as sponsored_brands
|
|
@@ -5,6 +5,7 @@ class Portfolios(Client):
|
|
|
5
5
|
""" """
|
|
6
6
|
|
|
7
7
|
@sp_endpoint('/v2/portfolios', method='GET')
|
|
8
|
+
@Utils.deprecated
|
|
8
9
|
def list_portfolios(self, **kwargs) -> ApiResponse:
|
|
9
10
|
r"""
|
|
10
11
|
|
|
@@ -27,6 +28,7 @@ class Portfolios(Client):
|
|
|
27
28
|
return self._request(kwargs.pop('path'), params=kwargs)
|
|
28
29
|
|
|
29
30
|
@sp_endpoint('/v2/portfolios/extended', method='GET')
|
|
31
|
+
@Utils.deprecated
|
|
30
32
|
def list_portfolios_extended(self, **kwargs) -> ApiResponse:
|
|
31
33
|
r"""
|
|
32
34
|
list_portfolios_extended(**kwargs) -> ApiResponse
|
|
@@ -47,6 +49,7 @@ class Portfolios(Client):
|
|
|
47
49
|
return self._request(kwargs.pop('path'), params=kwargs)
|
|
48
50
|
|
|
49
51
|
@sp_endpoint('/v2/portfolios/{}', method='GET')
|
|
52
|
+
@Utils.deprecated
|
|
50
53
|
def get_portfolio(self, portfolioId, **kwargs) -> ApiResponse:
|
|
51
54
|
r"""
|
|
52
55
|
get_portfolio(portfolioId) -> ApiResponse
|
|
@@ -59,6 +62,7 @@ class Portfolios(Client):
|
|
|
59
62
|
return self._request(fill_query_params(kwargs.pop('path'), portfolioId), params=kwargs)
|
|
60
63
|
|
|
61
64
|
@sp_endpoint('/v2/portfolios/extended/{}', method='GET')
|
|
65
|
+
@Utils.deprecated
|
|
62
66
|
def get_portfolio_extended(self, portfolioId, **kwargs) -> ApiResponse:
|
|
63
67
|
r"""
|
|
64
68
|
get_portfolio_extended(portfolioId) -> ApiResponse
|
|
@@ -71,6 +75,7 @@ class Portfolios(Client):
|
|
|
71
75
|
return self._request(fill_query_params(kwargs.pop('path'), portfolioId), params=kwargs)
|
|
72
76
|
|
|
73
77
|
@sp_endpoint('/v2/portfolios', method='POST')
|
|
78
|
+
@Utils.deprecated
|
|
74
79
|
def create_portfolios(self, **kwargs) -> ApiResponse:
|
|
75
80
|
r"""
|
|
76
81
|
|
|
@@ -98,6 +103,7 @@ class Portfolios(Client):
|
|
|
98
103
|
return self._request(kwargs.pop('path'), data=body, params=kwargs)
|
|
99
104
|
|
|
100
105
|
@sp_endpoint('/v2/portfolios', method='PUT')
|
|
106
|
+
@Utils.deprecated
|
|
101
107
|
def edit_portfolios(self, **kwargs) -> ApiResponse:
|
|
102
108
|
r"""
|
|
103
109
|
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
from ad_api.base import Client, sp_endpoint, ApiResponse, Utils
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class PortfoliosV3(Client):
|
|
5
|
+
""" """
|
|
6
|
+
|
|
7
|
+
@sp_endpoint('/portfolios/list', method='POST')
|
|
8
|
+
def list_portfolios(self, version: int = 3, prefer: bool = False, **kwargs) -> ApiResponse:
|
|
9
|
+
r"""
|
|
10
|
+
|
|
11
|
+
list_portfolios(body: (str, dict)) -> ApiResponse
|
|
12
|
+
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
schema_version = 'application/vnd.spPortfolio.v' + str(version) + '+json'
|
|
16
|
+
headers = {"Accept": schema_version, "Content-Type": schema_version}
|
|
17
|
+
prefer_value = 'return=representation'
|
|
18
|
+
if prefer:
|
|
19
|
+
headers.update({"Prefer": prefer_value})
|
|
20
|
+
|
|
21
|
+
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@sp_endpoint('/portfolios', method='POST')
|
|
26
|
+
def create_portfolios(self, version: int = 3, prefer: bool = False, **kwargs) -> ApiResponse:
|
|
27
|
+
r"""
|
|
28
|
+
|
|
29
|
+
create_portfolios(body: (str, dict)) -> ApiResponse
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
"""
|
|
33
|
+
schema_version = 'application/vnd.spPortfolio.v' + str(version) + '+json'
|
|
34
|
+
headers = {"Accept": schema_version, "Content-Type": schema_version}
|
|
35
|
+
prefer_value = 'return=representation'
|
|
36
|
+
if prefer:
|
|
37
|
+
headers.update({"Prefer": prefer_value})
|
|
38
|
+
|
|
39
|
+
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
|
|
40
|
+
|
|
41
|
+
@sp_endpoint('/portfolios', method='PUT')
|
|
42
|
+
def edit_portfolios(self, version: int = 3, prefer: bool = False, **kwargs) -> ApiResponse:
|
|
43
|
+
r"""
|
|
44
|
+
|
|
45
|
+
edit_portfolios(body: (str, dict)) -> ApiResponse
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
"""
|
|
49
|
+
schema_version = 'application/vnd.spPortfolio.v' + str(version) + '+json'
|
|
50
|
+
headers = {"Accept": schema_version, "Content-Type": schema_version}
|
|
51
|
+
prefer_value = 'return=representation'
|
|
52
|
+
if prefer:
|
|
53
|
+
headers.update({"Prefer": prefer_value})
|
|
54
|
+
|
|
55
|
+
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
@sp_endpoint('/portfolios/budget/usage', method='POST')
|
|
59
|
+
def get_budget_usage_for_portfolios(self, version: int = 1, **kwargs) -> ApiResponse:
|
|
60
|
+
r"""
|
|
61
|
+
|
|
62
|
+
get_budget_usage_for_portfolios(body: (str, dict)) -> ApiResponse
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
"""
|
|
66
|
+
schema_version = 'application/vnd.portfoliobudgetusage.v' + str(version) + '+json'
|
|
67
|
+
headers = {"Accept": schema_version, "Content-Type": schema_version}
|
|
68
|
+
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
|
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: python-amazon-ad-api
|
|
3
|
+
Version: 0.6.4
|
|
4
|
+
Summary: Python wrapper for the Amazon Advertising API
|
|
5
|
+
Home-page: https://github.com/denisneuf/python-amazon-ad-api
|
|
6
|
+
Author: Daniel Alvaro
|
|
7
|
+
Author-email: denisneuf@hotmail.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Bug Tracker, https://github.com/denisneuf/python-amazon-ad-api/issues
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Requires-Dist: requests<2.33.0,>=2.27.1
|
|
16
|
+
Requires-Dist: six<1.18,>=1.16
|
|
17
|
+
Requires-Dist: cachetools<5.6,>=5.0
|
|
18
|
+
Requires-Dist: pycryptodome<3.23,>=3.13
|
|
19
|
+
Requires-Dist: pytz<2026.0,>=2021.3
|
|
20
|
+
Requires-Dist: confuse<2.1,>=1.7
|
|
21
|
+
Dynamic: author
|
|
22
|
+
Dynamic: author-email
|
|
23
|
+
Dynamic: home-page
|
|
24
|
+
Dynamic: license
|
|
25
|
+
Dynamic: license-file
|
|
26
|
+
Dynamic: requires-dist
|
|
27
|
+
Dynamic: summary
|
|
28
|
+
|
|
1
29
|
# PYTHON-AMAZON-AD-API
|
|
2
30
|
|
|
3
31
|

|
|
@@ -48,7 +76,19 @@ my_credentials = dict(
|
|
|
48
76
|
profile_id='your-profile_id',
|
|
49
77
|
)
|
|
50
78
|
|
|
51
|
-
|
|
79
|
+
info = \
|
|
80
|
+
{
|
|
81
|
+
"stateFilter":
|
|
82
|
+
{
|
|
83
|
+
"include": [
|
|
84
|
+
"ENABLED"
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
result = sponsored_products.CampaignsV3(credentials=my_credentials).list_campaigns(
|
|
90
|
+
body=info
|
|
91
|
+
)
|
|
52
92
|
|
|
53
93
|
```
|
|
54
94
|
|
|
@@ -80,9 +120,9 @@ Python code
|
|
|
80
120
|
from ad_api.api import sponsored_products
|
|
81
121
|
|
|
82
122
|
# Leave empty will use the 'default' account
|
|
83
|
-
result=sponsored_products.
|
|
123
|
+
result=sponsored_products.CampaignsV3().list_campaigns()
|
|
84
124
|
# will use germany account data
|
|
85
|
-
result=sponsored_products.
|
|
125
|
+
result=sponsored_products.CampaignsV3(account="germany").list_campaigns()
|
|
86
126
|
```
|
|
87
127
|
|
|
88
128
|
|
|
@@ -106,7 +146,7 @@ from ad_api.api import sponsored_products
|
|
|
106
146
|
from ad_api.base import Marketplaces
|
|
107
147
|
|
|
108
148
|
# You can pass NA or US, CA, MX or BR for North America and JP, AU or SG for Far East
|
|
109
|
-
result=sponsored_products.
|
|
149
|
+
result=sponsored_products.CampaignsV3(marketplace=Marketplaces.NA).list_campaigns()
|
|
110
150
|
|
|
111
151
|
```
|
|
112
152
|
|
|
@@ -118,10 +158,20 @@ You can use a [try](https://docs.python.org/3.10/reference/compound_stmts.html#t
|
|
|
118
158
|
from ad_api.api import sponsored_products
|
|
119
159
|
from ad_api.base import AdvertisingApiException
|
|
120
160
|
|
|
161
|
+
info = \
|
|
162
|
+
{
|
|
163
|
+
"stateFilter":
|
|
164
|
+
{
|
|
165
|
+
"include": [
|
|
166
|
+
"ENABLED"
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
121
171
|
try:
|
|
122
172
|
|
|
123
|
-
result = sponsored_products.
|
|
124
|
-
|
|
173
|
+
result = sponsored_products.CampaignsV3().list_campaigns(
|
|
174
|
+
body=info
|
|
125
175
|
)
|
|
126
176
|
|
|
127
177
|
logging.info(result)
|
|
@@ -138,10 +188,21 @@ Use debug=True if you want see some logs like the header you submit to the api e
|
|
|
138
188
|
from ad_api.api import sponsored_products
|
|
139
189
|
from ad_api.base import AdvertisingApiException
|
|
140
190
|
|
|
191
|
+
|
|
192
|
+
info = \
|
|
193
|
+
{
|
|
194
|
+
"stateFilter":
|
|
195
|
+
{
|
|
196
|
+
"include": [
|
|
197
|
+
"ENABLED"
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
141
202
|
try:
|
|
142
203
|
|
|
143
|
-
result = sponsored_products.
|
|
144
|
-
|
|
204
|
+
result = sponsored_products.CampaignsV3(debug=True).list_campaigns(
|
|
205
|
+
body=info
|
|
145
206
|
)
|
|
146
207
|
|
|
147
208
|
logging.info(result)
|
|
@@ -201,7 +262,12 @@ curl \
|
|
|
201
262
|
|
|
202
263
|
* [Profiles](https://python-amazon-ad-api.readthedocs.io/en/latest/api/profiles.html)
|
|
203
264
|
* [Manager Accounts](https://python-amazon-ad-api.readthedocs.io/en/latest/api/manager_accounts.html)
|
|
265
|
+
|
|
266
|
+
Warning: [PLANNED DEPRECATION 1/3/2025]
|
|
267
|
+
There is a new version 3 Portfolios API, please check the [migration guide](https://advertising.amazon.com/API/docs/en-us/reference/migration-guides/portfolios-v2-v3).
|
|
268
|
+
|
|
204
269
|
* [Portfolios](https://python-amazon-ad-api.readthedocs.io/en/latest/api/portfolios.html)
|
|
270
|
+
* [PortfoliosV3](https://python-amazon-ad-api.readthedocs.io/en/latest/api/portfoliosV3.html)
|
|
205
271
|
* [Invoices](https://python-amazon-ad-api.readthedocs.io/en/latest/api/invoices.html)
|
|
206
272
|
* [Billing](https://python-amazon-ad-api.readthedocs.io/en/latest/api/billing.html)
|
|
207
273
|
* [Audiences](https://python-amazon-ad-api.readthedocs.io/en/latest/api/audiences.html)
|
|
@@ -313,38 +379,52 @@ There is a new version 3 of Sponsored Product API, please check the [migration g
|
|
|
313
379
|
```python
|
|
314
380
|
import logging
|
|
315
381
|
from ad_api.base import AdvertisingApiException
|
|
316
|
-
from ad_api.api
|
|
382
|
+
from ad_api.api import sponsored_products
|
|
317
383
|
|
|
318
384
|
logging.basicConfig(
|
|
319
385
|
level=logging.DEBUG,
|
|
320
386
|
format="%(asctime)s:%(levelname)s:%(message)s"
|
|
321
387
|
)
|
|
322
388
|
|
|
389
|
+
def sp_list_campaigns_v3(info: dict = None):
|
|
323
390
|
|
|
324
|
-
credentials = dict(
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
)
|
|
391
|
+
credentials = dict(
|
|
392
|
+
refresh_token='your-refresh_token',
|
|
393
|
+
client_id='your-client_id',
|
|
394
|
+
client_secret='your-client_secret',
|
|
395
|
+
profile_id='your-profile_id',
|
|
396
|
+
)
|
|
330
397
|
|
|
331
|
-
try:
|
|
398
|
+
try:
|
|
399
|
+
result = sponsored_products.CampaignsV3(credentials=credentials, debug=True).list_campaigns(
|
|
400
|
+
body=info
|
|
401
|
+
)
|
|
402
|
+
payload = result.payload
|
|
403
|
+
return payload
|
|
404
|
+
except AdvertisingApiException as error:
|
|
405
|
+
logging.error(error)
|
|
406
|
+
logging.error(error.code)
|
|
332
407
|
|
|
333
|
-
states = 'enabled'
|
|
334
408
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
409
|
+
state_filter = \
|
|
410
|
+
{
|
|
411
|
+
"stateFilter":
|
|
412
|
+
{
|
|
413
|
+
"include": [
|
|
414
|
+
"ENABLED"
|
|
415
|
+
]
|
|
416
|
+
}
|
|
417
|
+
}
|
|
338
418
|
|
|
339
|
-
|
|
340
|
-
for campaign in campaigns:
|
|
341
|
-
logging.info(campaign)
|
|
419
|
+
enabled_campaigns = sp_list_campaigns_v3(state_filter).get("campaigns")
|
|
342
420
|
|
|
343
|
-
|
|
421
|
+
|
|
422
|
+
for campaign in enabled_campaigns:
|
|
423
|
+
logging.info(campaign)
|
|
424
|
+
|
|
425
|
+
logging.info(len(campaigns))
|
|
344
426
|
|
|
345
427
|
|
|
346
|
-
except AdvertisingApiException as error:
|
|
347
|
-
logging.info(error)
|
|
348
428
|
|
|
349
429
|
```
|
|
350
430
|
|
|
@@ -2,13 +2,13 @@ from setuptools import setup
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name='python-amazon-ad-api',
|
|
5
|
-
version='0.6.
|
|
5
|
+
version='0.6.4',
|
|
6
6
|
install_requires=[
|
|
7
7
|
"requests>=2.27.1,<2.33.0",
|
|
8
8
|
"six>=1.16,<1.18",
|
|
9
9
|
"cachetools>=5.0,<5.6",
|
|
10
|
-
"pycryptodome>=3.13,<3.
|
|
11
|
-
"pytz>=2021.3,<
|
|
10
|
+
"pycryptodome>=3.13,<3.23",
|
|
11
|
+
"pytz>=2021.3,<2026.0",
|
|
12
12
|
"confuse>=1.7,<2.1",
|
|
13
13
|
],
|
|
14
14
|
packages=[
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/advertising_test_account.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/dsp/access_token_client.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/dsp/credential_provider.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/bid_recommendations.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/keywords_recommendations.py
RENAMED
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/landing_page_asins.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/negative_keywords.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/product_targeting.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sb/targeting_recommendations.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/bid_recommendations.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/campaigns_budget_usage.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/product_targeting.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sd/targeting_recommendations.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/bid_recommendations.py
RENAMED
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/bid_recommendations_v3.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/budget_recommendations.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/campaign_negative_targets.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/campaigns_budget_usage.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/campaings_optimization.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/negative_keywords.py
RENAMED
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/negative_keywords_v3.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/product_recommendations.py
RENAMED
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/product_targeting.py
RENAMED
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/product_targeting_v3.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/sp/suggested_keywords.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/api/validation_configurations.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/auth/access_token_client.py
RENAMED
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/auth/access_token_response.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-0.6.3 → python_amazon_ad_api-0.6.4}/ad_api/base/credential_provider.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|