python-amazon-ad-api 1.0.4__py3-none-any.whl → 1.0.6__py3-none-any.whl
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.
- ad_api/api/sp/__init__.py +5 -29
- ad_api/api/sp/campaign_negative_targets.py +1 -1
- ad_api/version.py +1 -1
- {python_amazon_ad_api-1.0.4.dist-info → python_amazon_ad_api-1.0.6.dist-info}/METADATA +4 -14
- {python_amazon_ad_api-1.0.4.dist-info → python_amazon_ad_api-1.0.6.dist-info}/RECORD +8 -25
- ad_api/api/dsp/__init__.py +0 -11
- ad_api/api/dsp/access_token_client.py +0 -6
- ad_api/api/dsp/client.py +0 -13
- ad_api/api/dsp/credential_provider.py +0 -15
- ad_api/api/dsp/reports.py +0 -71
- ad_api/api/sp/ad_groups.py +0 -158
- ad_api/api/sp/bid_recommendations.py +0 -81
- ad_api/api/sp/campaign_negative_keywords.py +0 -155
- ad_api/api/sp/campaigns.py +0 -398
- ad_api/api/sp/keywords.py +0 -172
- ad_api/api/sp/negative_keywords.py +0 -164
- ad_api/api/sp/negative_product_targeting.py +0 -163
- ad_api/api/sp/product_ads.py +0 -154
- ad_api/api/sp/product_targeting.py +0 -323
- ad_api/api/sp/reports.py +0 -65
- ad_api/api/sp/snapshots.py +0 -54
- ad_api/api/sp/suggested_keywords.py +0 -86
- {python_amazon_ad_api-1.0.4.dist-info → python_amazon_ad_api-1.0.6.dist-info}/WHEEL +0 -0
- {python_amazon_ad_api-1.0.4.dist-info → python_amazon_ad_api-1.0.6.dist-info}/licenses/LICENSE +0 -0
- {python_amazon_ad_api-1.0.4.dist-info → python_amazon_ad_api-1.0.6.dist-info}/top_level.txt +0 -0
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
from ad_api.base import Client, sp_endpoint, fill_query_params, ApiResponse, Utils
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class Targets(Client):
|
|
5
|
-
"""Amazon Advertising API - Sponsored Products - Product Targetting
|
|
6
|
-
|
|
7
|
-
Use the Amazon Advertising API for Sponsored Products for campaign, ad group, keyword, negative keyword, and product
|
|
8
|
-
ad management operations. For more information about Sponsored Products, see the Sponsored Products Support Center.
|
|
9
|
-
For onboarding information, see the account setup topic.
|
|
10
|
-
|
|
11
|
-
Version 2.0
|
|
12
|
-
|
|
13
|
-
Doc: https://advertising.amazon.com/API/docs/en-us/sponsored-products/2-0/openapi#/Product%20targeting
|
|
14
|
-
This specification is available for download from the `Advertising API Sponsored Products 2.0
|
|
15
|
-
<https://d3a0d0y2hgofx6.cloudfront.net/openapi/en-us/sponsored-products/2-0/openapi.yaml>`_.
|
|
16
|
-
|
|
17
|
-
Version 3.0
|
|
18
|
-
|
|
19
|
-
Doc: https://advertising.amazon.com/API/docs/en-us/sponsored-products/3-0/openapi/prod#/Product%20Targeting
|
|
20
|
-
This specification is available for download from the `Advertising API Sponsored Products 3.0
|
|
21
|
-
<https://dtrnk0o2zy01c.cloudfront.net/openapi/en-us/dest/SponsoredProducts_prod_3p.json>`_.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"""
|
|
25
|
-
|
|
26
|
-
@sp_endpoint('/v2/sp/targets', method='POST')
|
|
27
|
-
@Utils.deprecated
|
|
28
|
-
def create_products_targets(self, **kwargs) -> ApiResponse:
|
|
29
|
-
r"""
|
|
30
|
-
Creates one or more targeting expressions.
|
|
31
|
-
|
|
32
|
-
body: | REQUIRED {'description': 'An array of asins objects.}'
|
|
33
|
-
|
|
34
|
-
| '**campaignId**': *number*, {'description': 'The number or recommendations returned in a single page.'}
|
|
35
|
-
| '**adGroupId**': *number*, {'description': 'The page number in the result set to return.'}
|
|
36
|
-
| '**expression**'
|
|
37
|
-
| '**value**': *string*, {'description': 'The expression value.'}
|
|
38
|
-
| '**type**': *string*, {'description': '[ queryBroadMatches, queryPhraseMatches, queryExactMatches, asinCategorySameAs, asinBrandSameAs, asinPriceLessThan, asinPriceBetween, asinPriceGreaterThan, asinReviewRatingLessThan, asinReviewRatingBetween, asinReviewRatingGreaterThan, asinSameAs, queryBroadRelMatches, queryHighRelMatches, asinSubstituteRelated, asinAccessoryRelated, asinAgeRangeSameAs, asinGenreSameAs, asinIsPrimeShippingEligible ]'}
|
|
39
|
-
| '**resolvedExpression**'
|
|
40
|
-
| '**value**': *string*, {'description': 'The expression value.'}
|
|
41
|
-
| '**type**': *string*, {'description': '[ queryBroadMatches, queryPhraseMatches, queryExactMatches, asinCategorySameAs, asinBrandSameAs, asinPriceLessThan, asinPriceBetween, asinPriceGreaterThan, asinReviewRatingLessThan, asinReviewRatingBetween, asinReviewRatingGreaterThan, asinSameAs, queryBroadRelMatches, queryHighRelMatches, asinSubstituteRelated, asinAccessoryRelated, asinAgeRangeSameAs, asinGenreSameAs, asinIsPrimeShippingEligible ]'}
|
|
42
|
-
| '**expressionType**': *string*, {'description': '[ auto, manual ]'}
|
|
43
|
-
| '**bid**': *number*, {'description': 'The bid for ads sourced using the target. Min / Max 0.02 / 1000'}
|
|
44
|
-
|
|
45
|
-
Returns:
|
|
46
|
-
|
|
47
|
-
ApiResponse
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"""
|
|
51
|
-
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs)
|
|
52
|
-
|
|
53
|
-
@sp_endpoint('/v2/sp/targets', method='PUT')
|
|
54
|
-
@Utils.deprecated
|
|
55
|
-
def edit_products_targets(self, **kwargs) -> ApiResponse:
|
|
56
|
-
r"""
|
|
57
|
-
Updates one or more targeting clauses.
|
|
58
|
-
|
|
59
|
-
body: | REQUIRED {'description': 'An array of asins objects.}'
|
|
60
|
-
|
|
61
|
-
| '**targetId**': *number*, {'description': 'The target id.'}
|
|
62
|
-
| '**state**': *string*, {'description': '[ enabled, paused, archived ]'}
|
|
63
|
-
| '**expression**'
|
|
64
|
-
| '**value**': *string*, {'description': 'The expression value.'}
|
|
65
|
-
| '**type**': *string*, {'description': '[ queryBroadMatches, queryPhraseMatches, queryExactMatches, asinCategorySameAs, asinBrandSameAs, asinPriceLessThan, asinPriceBetween, asinPriceGreaterThan, asinReviewRatingLessThan, asinReviewRatingBetween, asinReviewRatingGreaterThan, asinSameAs, queryBroadRelMatches, queryHighRelMatches, asinSubstituteRelated, asinAccessoryRelated, asinAgeRangeSameAs, asinGenreSameAs, asinIsPrimeShippingEligible ]'}
|
|
66
|
-
| '**resolvedExpression**'
|
|
67
|
-
| '**value**': *string*, {'description': 'The expression value.'}
|
|
68
|
-
| '**type**': *string*, {'description': '[ queryBroadMatches, queryPhraseMatches, queryExactMatches, asinCategorySameAs, asinBrandSameAs, asinPriceLessThan, asinPriceBetween, asinPriceGreaterThan, asinReviewRatingLessThan, asinReviewRatingBetween, asinReviewRatingGreaterThan, asinSameAs, queryBroadRelMatches, queryHighRelMatches, asinSubstituteRelated, asinAccessoryRelated, asinAgeRangeSameAs, asinGenreSameAs, asinIsPrimeShippingEligible ]'}
|
|
69
|
-
| '**expressionType**': *string*, {'description': '[ auto, manual ]'}
|
|
70
|
-
| '**bid**': *number*, {'description': 'The bid for ads sourced using the target. Min / Max 0.02 / 1000'}
|
|
71
|
-
|
|
72
|
-
Returns:
|
|
73
|
-
|
|
74
|
-
ApiResponse
|
|
75
|
-
|
|
76
|
-
"""
|
|
77
|
-
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs)
|
|
78
|
-
|
|
79
|
-
@sp_endpoint('/v2/sp/targets', method='GET')
|
|
80
|
-
@Utils.deprecated
|
|
81
|
-
def list_products_targets(self, **kwargs) -> ApiResponse:
|
|
82
|
-
r"""
|
|
83
|
-
Gets a list of targeting clauses filtered by specified criteria.
|
|
84
|
-
|
|
85
|
-
query **startIndex**:*integer* | Optional. 0-indexed record offset for the result set. Default value : 0
|
|
86
|
-
|
|
87
|
-
query **count**:*integer* | Optional. Number of records to include in the paged response. Defaults to max page size.
|
|
88
|
-
|
|
89
|
-
query **stateFilter**:*string* | Optional. The returned array is filtered to include only ad groups with state set to one of the values in the specified comma-delimited list. Available values : enabled, paused, archived, enabled, paused, enabled, archived, paused, archived, enabled, paused, archived Default value : enabled, paused, archived.
|
|
90
|
-
|
|
91
|
-
query **campaignIdFilter**:*string* | Optional. A comma-delimited list of campaign identifiers.
|
|
92
|
-
|
|
93
|
-
query **adGroupIdFilter**:*string* | Optional. Restricts results to keywords associated with ad groups specified by identifier in the comma-delimited list.
|
|
94
|
-
|
|
95
|
-
query **targetIdFilter**:*string* | Optional. A comma-delimited list of target identifiers.
|
|
96
|
-
|
|
97
|
-
Returns:
|
|
98
|
-
|
|
99
|
-
ApiResponse
|
|
100
|
-
|
|
101
|
-
"""
|
|
102
|
-
return self._request(kwargs.pop('path'), params=kwargs)
|
|
103
|
-
|
|
104
|
-
@sp_endpoint('/v2/sp/targets/{}', method='GET')
|
|
105
|
-
@Utils.deprecated
|
|
106
|
-
def get_products_target(self, targetId, **kwargs) -> ApiResponse:
|
|
107
|
-
r"""
|
|
108
|
-
Get a targeting clause specified by identifier.
|
|
109
|
-
|
|
110
|
-
path **targetId**:*number* | Required. The target identifier.
|
|
111
|
-
|
|
112
|
-
Returns:
|
|
113
|
-
|
|
114
|
-
ApiResponse
|
|
115
|
-
|
|
116
|
-
"""
|
|
117
|
-
return self._request(fill_query_params(kwargs.pop('path'), targetId), params=kwargs)
|
|
118
|
-
|
|
119
|
-
@sp_endpoint('/v2/sp/targets/{}', method='DELETE')
|
|
120
|
-
@Utils.deprecated
|
|
121
|
-
def delete_products_target(self, targetId, **kwargs) -> ApiResponse:
|
|
122
|
-
r"""
|
|
123
|
-
Archives a targeting clause.
|
|
124
|
-
|
|
125
|
-
path **targetId**:*number* | Required. The target identifier.
|
|
126
|
-
|
|
127
|
-
Returns:
|
|
128
|
-
|
|
129
|
-
ApiResponse
|
|
130
|
-
|
|
131
|
-
"""
|
|
132
|
-
return self._request(fill_query_params(kwargs.pop('path'), targetId), params=kwargs)
|
|
133
|
-
|
|
134
|
-
@sp_endpoint('/v2/sp/targets/extended', method='GET')
|
|
135
|
-
@Utils.deprecated
|
|
136
|
-
def list_products_targets_extended(self, **kwargs) -> ApiResponse:
|
|
137
|
-
r"""
|
|
138
|
-
Gets a list of targeting clauses filtered by specified criteria.
|
|
139
|
-
|
|
140
|
-
query **startIndex**:*integer* | Optional. 0-indexed record offset for the result set. Default value : 0
|
|
141
|
-
|
|
142
|
-
query **count**:*integer* | Optional. Number of records to include in the paged response. Defaults to max page size.
|
|
143
|
-
|
|
144
|
-
query **stateFilter**:*string* | Optional. The returned array is filtered to include only ad groups with state set to one of the values in the specified comma-delimited list. Available values : enabled, paused, archived, enabled, paused, enabled, archived, paused, archived, enabled, paused, archived Default value : enabled, paused, archived.
|
|
145
|
-
|
|
146
|
-
query **campaignIdFilter**:*string* | Optional. A comma-delimited list of campaign identifiers.
|
|
147
|
-
|
|
148
|
-
query **adGroupIdFilter**:*string* | Optional. Restricts results to keywords associated with ad groups specified by identifier in the comma-delimited list.
|
|
149
|
-
|
|
150
|
-
query **targetIdFilter**:*string* | Optional. A comma-delimited list of target identifiers.
|
|
151
|
-
|
|
152
|
-
Returns:
|
|
153
|
-
|
|
154
|
-
ApiResponse
|
|
155
|
-
|
|
156
|
-
"""
|
|
157
|
-
return self._request(kwargs.pop('path'), params=kwargs)
|
|
158
|
-
|
|
159
|
-
@sp_endpoint('/v2/sp/targets/extended/{}', method='GET')
|
|
160
|
-
@Utils.deprecated
|
|
161
|
-
def get_products_target_extended(self, targetId, **kwargs) -> ApiResponse:
|
|
162
|
-
r"""
|
|
163
|
-
Get a targeting clause specified by identifier.
|
|
164
|
-
|
|
165
|
-
path **targetId**:*number* | Required. The target identifier.
|
|
166
|
-
|
|
167
|
-
Returns:
|
|
168
|
-
|
|
169
|
-
ApiResponse
|
|
170
|
-
|
|
171
|
-
"""
|
|
172
|
-
return self._request(fill_query_params(kwargs.pop('path'), targetId), params=kwargs)
|
|
173
|
-
|
|
174
|
-
@sp_endpoint('/v2/sp/targets/productRecommendations', method='POST')
|
|
175
|
-
@Utils.deprecated
|
|
176
|
-
def get_products_targets_recommendations(self, **kwargs) -> ApiResponse:
|
|
177
|
-
r"""
|
|
178
|
-
|
|
179
|
-
Gets a list of recommended products for targeting.
|
|
180
|
-
|
|
181
|
-
body: | REQUIRED {'description': 'An array of asins objects.}'
|
|
182
|
-
|
|
183
|
-
| '**pageSize**': *number*, {'description': 'The number or recommendations returned in a single page.'}
|
|
184
|
-
| '**pageNumber**': *number*, {'description': 'The page number in the result set to return.'}
|
|
185
|
-
| '**asins**': list>*string*, {'description': 'A list of ASINs.'}
|
|
186
|
-
|
|
187
|
-
Returns:
|
|
188
|
-
|
|
189
|
-
ApiResponse
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
"""
|
|
193
|
-
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs)
|
|
194
|
-
|
|
195
|
-
@sp_endpoint('/v2/sp/targets/brands', method='GET')
|
|
196
|
-
@Utils.deprecated
|
|
197
|
-
def get_brand_targets(self, **kwargs) -> ApiResponse:
|
|
198
|
-
r"""
|
|
199
|
-
Gets a list of recommended products for targeting.
|
|
200
|
-
|
|
201
|
-
path **keyword**:*string* | Optional Unique exclude categoryId. A keyword for which to get recommended brands.
|
|
202
|
-
path **categoryId**:*number* | Optional Unique exclude keyword. Gets the top 50 brands for the specified category identifier.
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
Returns:
|
|
206
|
-
|
|
207
|
-
ApiResponse
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
"""
|
|
211
|
-
return self._request(kwargs.pop('path'), params=kwargs)
|
|
212
|
-
|
|
213
|
-
"""
|
|
214
|
-
Sponsored Products Targeting API. v3.0
|
|
215
|
-
"""
|
|
216
|
-
|
|
217
|
-
@sp_endpoint('/sp/targets/categories/recommendations', method='POST')
|
|
218
|
-
def list_products_targets_categories_recommendations(self, **kwargs) -> ApiResponse:
|
|
219
|
-
r"""
|
|
220
|
-
|
|
221
|
-
Returns a list of category recommendations for the input list of ASINs. Use this API to discover relevant categories to target. To find ASINs, either use the Product Metadata API or browse the Amazon Retail Website.
|
|
222
|
-
|
|
223
|
-
| header **Prefer**:*string* | Used to indicate the behavior preferred by the client but is not required for successful completion of the request. Supported values will be updated in the future.
|
|
224
|
-
|
|
225
|
-
body: | REQUIRED {'description': 'An array of asins objects.}'
|
|
226
|
-
|
|
227
|
-
| '**asins**': list>*string*, {'description': 'List of input ASINs. This API does not check if the ASINs are valid ASINs. maxItems: 10000.'}
|
|
228
|
-
| '**includeAncestor**': *boolean*, {'description': 'Enable this if you would like to retrieve categories which are ancestor nodes of the original recommended categories. This may increase the number of categories returned, but decrease the relevancy of those categories.'}
|
|
229
|
-
|
|
230
|
-
Returns:
|
|
231
|
-
|
|
232
|
-
ApiResponse
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
"""
|
|
236
|
-
contentType = 'application/vnd.spproducttargeting.v3+json'
|
|
237
|
-
headers = {'Content-Type': contentType}
|
|
238
|
-
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
|
|
239
|
-
|
|
240
|
-
@sp_endpoint('/sp/negativeTargets/brands/recommendations', method='GET')
|
|
241
|
-
def list_negative_targets_brands_recommendations(self, **kwargs) -> ApiResponse:
|
|
242
|
-
r"""
|
|
243
|
-
Returns brands recommended for negative targeting. Only available for Sellers and Vendors. These recommendations include your own brands because targeting your own brands usually results in lower performance than targeting competitors' brands.
|
|
244
|
-
|
|
245
|
-
| header **Prefer**:*string* | Used to indicate the behavior preferred by the client but is not required for successful completion of the request. Supported values will be updated in the future.
|
|
246
|
-
|
|
247
|
-
Returns:
|
|
248
|
-
|
|
249
|
-
ApiResponse
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
"""
|
|
253
|
-
contentType = 'application/vnd.spproducttargeting.v3+json'
|
|
254
|
-
headers = {'Content-Type': contentType}
|
|
255
|
-
return self._request(kwargs.pop('path'), params=kwargs, headers=headers)
|
|
256
|
-
|
|
257
|
-
@sp_endpoint('/sp/targets/products/count', method='POST')
|
|
258
|
-
def get_products_targets_count(self, **kwargs) -> ApiResponse:
|
|
259
|
-
r"""
|
|
260
|
-
Get number of targetable asins based on refinements provided by the user. Please use the GetTargetableCategories API or the GetCategoryRecommendationsForASINs API to retrieve the category ID. Please use the GetRefinementsByCategory API to retrieve refinements data for a category.
|
|
261
|
-
|
|
262
|
-
| header **Prefer**:*string* | Used to indicate the behavior preferred by the client but is not required for successful completion of the request. Supported values will be updated in the future.
|
|
263
|
-
|
|
264
|
-
Returns:
|
|
265
|
-
|
|
266
|
-
ApiResponse
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
"""
|
|
270
|
-
|
|
271
|
-
contentType = 'application/vnd.spproducttargeting.v3+json'
|
|
272
|
-
headers = {'Content-Type': contentType}
|
|
273
|
-
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
|
|
274
|
-
|
|
275
|
-
@sp_endpoint('/sp/targets/categories', method='GET')
|
|
276
|
-
def list_targets_categories(self, **kwargs) -> ApiResponse:
|
|
277
|
-
r"""
|
|
278
|
-
Returns all targetable categories. This API returns a large JSON string containing a tree of category nodes. Each category node has the fields - category id, category name, and child categories.
|
|
279
|
-
|
|
280
|
-
| header **Prefer**:*string* | Used to indicate the behavior preferred by the client but is not required for successful completion of the request. Supported values will be updated in the future.
|
|
281
|
-
|
|
282
|
-
Returns:
|
|
283
|
-
|
|
284
|
-
ApiResponse
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
"""
|
|
288
|
-
return self._request(kwargs.pop('path'), params=kwargs, headers=False)
|
|
289
|
-
|
|
290
|
-
@sp_endpoint('/sp/negativeTargets/brands/search', method='POST')
|
|
291
|
-
def list_negative_targets_brands_search(self, **kwargs) -> ApiResponse:
|
|
292
|
-
r"""
|
|
293
|
-
Returns brands related to keyword input for negative targeting.
|
|
294
|
-
|
|
295
|
-
| header **Prefer**:*string* | Used to indicate the behavior preferred by the client but is not required for successful completion of the request. Supported values will be updated in the future.
|
|
296
|
-
|
|
297
|
-
Returns:
|
|
298
|
-
|
|
299
|
-
ApiResponse
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
"""
|
|
303
|
-
|
|
304
|
-
contentType = 'application/vnd.spproducttargeting.v3+json'
|
|
305
|
-
headers = {'Content-Type': contentType}
|
|
306
|
-
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
|
|
307
|
-
|
|
308
|
-
@sp_endpoint('/sp/targets/category/{}/refinements', method='GET')
|
|
309
|
-
def list_products_targets_category_refinements(self, categoryId, **kwargs) -> ApiResponse:
|
|
310
|
-
r"""
|
|
311
|
-
Get a targeting clause specified by identifier.
|
|
312
|
-
|
|
313
|
-
| path **categoryId**:*string* | Required. The target identifier.
|
|
314
|
-
| header **Prefer**:*string* | Used to indicate the behavior preferred by the client but is not required for successful completion of the request. Supported values will be updated in the future.
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
Returns:
|
|
318
|
-
|
|
319
|
-
ApiResponse
|
|
320
|
-
|
|
321
|
-
"""
|
|
322
|
-
|
|
323
|
-
return self._request(fill_query_params(kwargs.pop('path'), categoryId), params=kwargs, headers=False)
|
ad_api/api/sp/reports.py
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
from ad_api.base import Client, sp_endpoint, fill_query_params, ApiResponse, Utils
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class Reports(Client):
|
|
5
|
-
"""Sponsored Products Reports
|
|
6
|
-
|
|
7
|
-
Documentation: https://advertising.amazon.com/API/docs/en-us/sponsored-products/2-0/openapi#/Reports
|
|
8
|
-
|
|
9
|
-
Use the Amazon Advertising API for Sponsored Products for campaign, ad group, keyword, negative keyword, and product ad management operations. For more information about Sponsored Products, see the Sponsored Products Support Center. For onboarding information, see the account setup topic.
|
|
10
|
-
"""
|
|
11
|
-
|
|
12
|
-
@sp_endpoint('/v2/sp/{}/report', method='POST')
|
|
13
|
-
@Utils.deprecated
|
|
14
|
-
def post_report(self, recordType, **kwargs) -> ApiResponse:
|
|
15
|
-
r"""
|
|
16
|
-
Requests a Sponsored Products report.
|
|
17
|
-
|
|
18
|
-
Request the creation of a performance report for all entities of a single type which have performance data to report. Record types can be one of campaigns, adGroups, keywords, productAds, asins, and targets. Note that for asin reports, the report currently can not include metrics associated with both keywords and targets. If the targetingId value is set in the request, the report filters on targets and does not return sales associated with keywords. If the targetingId value is not set in the request, the report filters on keywords and does not return sales associated with targets. Therefore, the default behavior filters the report on keywords. Also note that if both keywordId and targetingId values are passed, the report filters on targets only and does not return keywords.
|
|
19
|
-
|
|
20
|
-
Keyword Args
|
|
21
|
-
| path **recordType** (integer): The type of entity for which the report should be generated. Available values : campaigns, adGroups, keywords, productAds, asins, targets [required]
|
|
22
|
-
|
|
23
|
-
Request body
|
|
24
|
-
| **stateFilter** (string): [optional] Filters the response to include reports with state set to one of the values in the comma-delimited list. Note that this filter is only valid for reports of the following type and segment. Asins and targets report types are not supported. Enum [ enabled, paused, archived ].
|
|
25
|
-
| **campaignType** (list > string): [required] Enum: The type of campaign. Only required for asins report - don't use with other report types. [sponsoredProducts]
|
|
26
|
-
| **segment** (string) Dimension on which the report is segmented. Note that Search-terms report for auto-targeted campaigns created before 11/14/2018 can be accessed from the /v2/sp/keywords/report resource. Search-terms report for auto-targeted campaigns generated on-and-after 11/14/2018 can be accessed from the /v2/sp/targets/report resource. Also, keyword search terms reports only return search terms that have generated at least one click or one sale. Enum [ query, placement ].
|
|
27
|
-
| **reportDate** (string): [optional] The date for which to retrieve the performance report in YYYYMMDD format. The time zone is specified by the profile used to request the report. If this date is today, then the performance report may contain partial information. Reports are not available for data older than 60 days. For details on data latency, see the Service Guarantees in the developer notes section.
|
|
28
|
-
| **metrics** (string) [optional] A comma-separated list of the metrics to be included in the report. The following tables summarize report metrics which can be requested via the reports interface. Different report types can use different metrics. Note that ASIN reports only return data for either keywords or targets, but not both.
|
|
29
|
-
|
|
30
|
-
Returns:
|
|
31
|
-
ApiResponse
|
|
32
|
-
|
|
33
|
-
"""
|
|
34
|
-
return self._request(fill_query_params(kwargs.pop('path'), recordType), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs)
|
|
35
|
-
|
|
36
|
-
@sp_endpoint('/v2/reports/{}', method='GET')
|
|
37
|
-
def get_report(self, reportId, **kwargs) -> ApiResponse:
|
|
38
|
-
r"""
|
|
39
|
-
Gets a previously requested report specified by identifier.
|
|
40
|
-
|
|
41
|
-
Keyword Args
|
|
42
|
-
| path **reportId** (number): The report identifier. [required]
|
|
43
|
-
|
|
44
|
-
Returns:
|
|
45
|
-
ApiResponse
|
|
46
|
-
"""
|
|
47
|
-
return self._request(fill_query_params(kwargs.pop('path'), reportId), params=kwargs)
|
|
48
|
-
|
|
49
|
-
def download_report(self, **kwargs) -> ApiResponse:
|
|
50
|
-
r"""
|
|
51
|
-
Downloads the report previously get report specified by location (this is not part of the official Amazon Advertising API, is a helper method to download the report). Take in mind that a direct download of location returned in get_report will return 401 - Unauthorized.
|
|
52
|
-
|
|
53
|
-
kwarg parameter **file** if not provided will take the default amazon name from path download (add a path with slash / if you want a specific folder, do not add extension as the return will provide the right extension based on format choosed if needed)
|
|
54
|
-
|
|
55
|
-
kwarg parameter **format** if not provided a format will return a url to download the report (this url has a expiration time)
|
|
56
|
-
|
|
57
|
-
Keyword Args
|
|
58
|
-
| **url** (string): The location obatined from get_report [required]
|
|
59
|
-
| **file** (string): The path to save the file if mode is download json, zip or gzip. [optional]
|
|
60
|
-
| **format** (string): The mode to download the report: data (list), raw, url, json, zip, gzip. Default (url) [optional]
|
|
61
|
-
|
|
62
|
-
Returns:
|
|
63
|
-
ApiResponse
|
|
64
|
-
"""
|
|
65
|
-
return self._download(self, params=kwargs)
|
ad_api/api/sp/snapshots.py
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
from ad_api.base import Client, sp_endpoint, fill_query_params, ApiResponse, Utils
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class Snapshots(Client):
|
|
5
|
-
"""
|
|
6
|
-
Use the Amazon Advertising API for Sponsored Products for campaign, ad group, keyword, negative keyword, and product ad management operations. For more information about Sponsored Products, see the Sponsored Products Support Center. For onboarding information, see the account setup topic.
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
@sp_endpoint('/v2/sp/{}/snapshot', method='POST')
|
|
10
|
-
def post_snapshot(self, recordType, **kwargs) -> ApiResponse:
|
|
11
|
-
"""
|
|
12
|
-
Request a file-based snapshot of all entities of the specified type in the account satisfying the filtering criteria.
|
|
13
|
-
|
|
14
|
-
Keyword Args
|
|
15
|
-
| path **recordType** (integer): The type of entity for which the snapshot is generated. Available values : campaigns, adGroups, keywords, negativeKeywords, campaignNegativeKeywords, productAds, targets, negativeTargets [required]
|
|
16
|
-
|
|
17
|
-
Request body
|
|
18
|
-
| **stateFilter** (string): [required] [ enabled, paused, archived, enabled, paused, enabled, archived, paused, archived, enabled, paused, archived ].
|
|
19
|
-
|
|
20
|
-
Returns:
|
|
21
|
-
ApiResponse
|
|
22
|
-
"""
|
|
23
|
-
return self._request(fill_query_params(kwargs.pop('path'), recordType), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs)
|
|
24
|
-
|
|
25
|
-
@sp_endpoint('/v2/snapshots/{}', method='GET')
|
|
26
|
-
def get_snapshot(self, snapshotId, **kwargs) -> ApiResponse:
|
|
27
|
-
r"""
|
|
28
|
-
Gets the status of a requested snapshot.
|
|
29
|
-
|
|
30
|
-
Keyword Args
|
|
31
|
-
| path **snapshotId** (number): The snapshot identifier. [required]
|
|
32
|
-
|
|
33
|
-
Returns:
|
|
34
|
-
ApiResponse
|
|
35
|
-
"""
|
|
36
|
-
return self._request(fill_query_params(kwargs.pop('path'), snapshotId), params=kwargs)
|
|
37
|
-
|
|
38
|
-
def download_snapshot(self, **kwargs) -> ApiResponse:
|
|
39
|
-
r"""
|
|
40
|
-
Downloads the snapshot previously get report specified by location (this is not part of the official Amazon Advertising API, is a helper method to download the snapshot). Take in mind that a direct download of location returned in get_snapshot will return 401 - Unauthorized.
|
|
41
|
-
|
|
42
|
-
kwarg parameter **file** if not provided will take the default amazon name from path download (add a path with slash / if you want a specific folder, do not add extension as the return will provide the right extension based on format choosed if needed)
|
|
43
|
-
|
|
44
|
-
kwarg parameter **format** if not provided a format will return a url to download the snapshot (this url has a expiration time)
|
|
45
|
-
|
|
46
|
-
Keyword Args
|
|
47
|
-
| **url** (string): The location obatined from get_snapshot [required]
|
|
48
|
-
| **file** (string): The path to save the file if mode is download json, zip or gzip. [optional]
|
|
49
|
-
| **format** (string): The mode to download the snapshot: data (list), raw, url, json, zip, gzip. Default (url) [optional]
|
|
50
|
-
|
|
51
|
-
Returns:
|
|
52
|
-
ApiResponse
|
|
53
|
-
"""
|
|
54
|
-
return self._download(self, params=kwargs)
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
from ad_api.base import Client, sp_endpoint, fill_query_params, ApiResponse, Utils
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class SuggestedKeywords(Client):
|
|
5
|
-
@sp_endpoint('/v2/sp/adGroups/{}/suggested/keywords', method='GET')
|
|
6
|
-
def get_keywords(self, adGroupId, **kwargs) -> ApiResponse:
|
|
7
|
-
r"""
|
|
8
|
-
get_keywords_request(self, adGroupId, \*\*kwargs) -> ApiResponse
|
|
9
|
-
|
|
10
|
-
Gets suggested keywords for the specified ad group.
|
|
11
|
-
|
|
12
|
-
path adGroupId:*number* | Required. The identifier of a valid ad group.
|
|
13
|
-
|
|
14
|
-
query maxNumSuggestions:*integer* | Optional. The maxiumum number of suggested keywords for the response. Default value 100.
|
|
15
|
-
|
|
16
|
-
query adStateFilter:*string* | Optional. Filters results to ad groups with state matching the comma-delimited list. Available values : enabled, paused, archived, enabled, paused, enabled, archived, paused, archived, enabled, paused, archived.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Returns:
|
|
20
|
-
|
|
21
|
-
ApiResponse
|
|
22
|
-
|
|
23
|
-
"""
|
|
24
|
-
return self._request(fill_query_params(kwargs.pop('path'), adGroupId), params=kwargs)
|
|
25
|
-
|
|
26
|
-
@sp_endpoint('/v2/sp/adGroups/{}/suggested/keywords/extended', method='GET')
|
|
27
|
-
def get_keywords_extended(self, adGroupId, **kwargs) -> ApiResponse:
|
|
28
|
-
r"""
|
|
29
|
-
get_keywords_extended(self, adGroupId, \*\*kwargs) -> ApiResponse
|
|
30
|
-
|
|
31
|
-
Gets suggested keywords with extended data for the specified ad group.
|
|
32
|
-
|
|
33
|
-
path adGroupId:*number* | Required. The identifier of a valid ad group.
|
|
34
|
-
|
|
35
|
-
query maxNumSuggestions:*integer* | Optional. The maxiumum number of suggested keywords for the response. Default value 100.
|
|
36
|
-
|
|
37
|
-
query suggestBids:*string* | Optional. Set to yes to include a suggest bid for the suggested keyword in the response. Otherwise, set to no. Available values : yes, no. Default value : no.
|
|
38
|
-
|
|
39
|
-
query adStateFilter:*string* | Optional. Filters results to ad groups with state matching the comma-delimited list. Available values : enabled, paused, archived, enabled, paused, enabled, archived, paused, archived, enabled, paused, archived.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
Returns:
|
|
43
|
-
|
|
44
|
-
ApiResponse
|
|
45
|
-
|
|
46
|
-
"""
|
|
47
|
-
return self._request(fill_query_params(kwargs.pop('path'), adGroupId), params=kwargs)
|
|
48
|
-
|
|
49
|
-
@sp_endpoint('/v2/sp/asins/{}/suggested/keywords', method='GET')
|
|
50
|
-
def get_asin_keywords(self, asinValue, **kwargs) -> ApiResponse:
|
|
51
|
-
r"""
|
|
52
|
-
get_asin_keywords(self, asinValue, \*\*kwargs) -> ApiResponse
|
|
53
|
-
|
|
54
|
-
Gets suggested keywords for the specified ad group.
|
|
55
|
-
|
|
56
|
-
path asinValue:*string* | Required. An ASIN.
|
|
57
|
-
|
|
58
|
-
query maxNumSuggestions:*integer* | Optional. The maxiumum number of suggested keywords for the response. Default value 100.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
Returns:
|
|
62
|
-
|
|
63
|
-
ApiResponse
|
|
64
|
-
|
|
65
|
-
"""
|
|
66
|
-
return self._request(fill_query_params(kwargs.pop('path'), asinValue), params=kwargs)
|
|
67
|
-
|
|
68
|
-
@sp_endpoint('/v2/sp/asins/suggested/keywords', method='POST')
|
|
69
|
-
def get_asins_keywords(self, **kwargs) -> ApiResponse:
|
|
70
|
-
r"""
|
|
71
|
-
get_asins_keywords(self, \*\*kwargs) -> ApiResponse:
|
|
72
|
-
|
|
73
|
-
Gets suggested keyword for a specified list of ASINs.
|
|
74
|
-
|
|
75
|
-
body: | REQUIRED {'description': 'An object with ASINs.}'
|
|
76
|
-
|
|
77
|
-
| 'asins': *string*, {'description': 'A list of ASINs.'}
|
|
78
|
-
| 'maxNumSuggestions': *integer*, {'description': 'The maximum number of suggested keywords in the response. minItems: 1. maxItems: 1000. default: 100'}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
Returns:
|
|
82
|
-
|
|
83
|
-
ApiResponse
|
|
84
|
-
|
|
85
|
-
"""
|
|
86
|
-
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs)
|
|
File without changes
|
{python_amazon_ad_api-1.0.4.dist-info → python_amazon_ad_api-1.0.6.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|