python-amazon-ad-api 2.2.3__tar.gz → 2.2.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-2.2.4/PKG-INFO +373 -0
- python_amazon_ad_api-2.2.4/README.md +345 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/__init__.py +2 -0
- python_amazon_ad_api-2.2.4/ad_api/api/brand_home.py +135 -0
- python_amazon_ad_api-2.2.4/ad_api/version.py +1 -0
- python_amazon_ad_api-2.2.4/python_amazon_ad_api.egg-info/PKG-INFO +373 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/python_amazon_ad_api.egg-info/SOURCES.txt +1 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/setup.cfg +1 -1
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/setup.py +1 -1
- python_amazon_ad_api-2.2.3/PKG-INFO +0 -570
- python_amazon_ad_api-2.2.3/README.md +0 -542
- python_amazon_ad_api-2.2.3/ad_api/version.py +0 -1
- python_amazon_ad_api-2.2.3/python_amazon_ad_api.egg-info/PKG-INFO +0 -570
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/LICENSE +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/__init__.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/account.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/account_budgets.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/advertising_invitations.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/advertising_test_account.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/advertising_user_permissions.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/attribution.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/audiences.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/billing.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/brand_benchmarks.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/brand_metrics.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/creative_assets.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/dsp_advertiser.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/eligibility.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/exports.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/history.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/insights.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/localization.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/manager_accounts.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/marketing_mix_modeling.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/metadata.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/portfolios.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/portfolios_v3.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/profiles.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/recommendations.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/reports.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/__init__.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/ad_creatives_v4.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/ad_groups.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/ad_groups_v4.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/ads_v4.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/benchmarks.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/bid_recommendations.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/brands.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/budget_rules.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/campaigns.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/campaigns_v4.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/forecast.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/keywords.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/keywords_recommendations.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/landing_page_asins.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/media.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/migration.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/negative_keywords.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/negative_product_targeting.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/optimization_rules.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/product_targeting.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/recommendations.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/reports.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/stores.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/targeting_categories.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/targeting_recommendations.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sb/themes.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sd/__init__.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sd/ad_groups.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sd/bid_recommendations.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sd/brand_safety.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sd/budget_rules.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sd/campaigns.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sd/campaigns_budget_usage.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sd/creatives.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sd/forecast.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sd/negative_product_targeting.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sd/product_ads.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sd/product_targeting.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sd/recommendations.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sd/reports.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sd/snapshots.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sd/targeting_recommendations.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sp/__init__.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sp/ad_groups_v3.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sp/bid_recommendations_v3.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sp/budget_initial_recommendation.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sp/budget_recommendations.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sp/budget_rules.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sp/budget_rules_recommendations.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sp/campaign_consolidated_recommendations.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sp/campaign_negative_keywords_v3.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sp/campaign_negative_targets.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sp/campaigns_budget_usage.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sp/campaigns_v3.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sp/campaings_optimization.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sp/global_recommendations.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sp/keyword_groups_recommendations.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sp/keywords_v3.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sp/negative_keywords_v3.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sp/negative_product_targeting_v3.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sp/product_ads_v3.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sp/product_recommendations.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sp/product_targeting_v3.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sp/ranked_keywords_recommendations.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sp/schedule_based_bid_optimization.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/sp/target_promotion_groups.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/st/__init__.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/st/ad_groups.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/st/ads.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/st/campaigns.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/st/creatives.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/st/creatives_moderations.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/st/creatives_preview.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/st/forecasts.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/st/locations.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/st/targets.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/stores.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/stream.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/v1/__init__.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/v1/ad_associations.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/v1/ad_extensions.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/v1/ad_groups.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/v1/ads.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/v1/advertiser_accounts.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/v1/brand_store_edition_publish_versions.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/v1/brand_store_editions.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/v1/brand_store_pages.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/v1/brand_stores.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/v1/campaigns.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/v1/geo_locations.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/v1/label_object_associations.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/v1/labels.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/v1/location_indexes.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/v1/manager_accounts.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/v1/portfolios.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/v1/recommendation_types.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/v1/recommendations.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/v1/reports.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/v1/selling_accounts.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/v1/targets.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/api/validation_configurations.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/auth/__init__.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/auth/access_token_client.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/auth/access_token_response.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/auth/credentials.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/auth/exceptions.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/base/__init__.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/base/api_response.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/base/client.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/base/config.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/base/credential_provider.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/base/exceptions.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/base/helpers.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/base/marketplaces.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/base/utils.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/shared/__init__.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/ad_api/shared/base_client.py +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/pyproject.toml +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/python_amazon_ad_api.egg-info/dependency_links.txt +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/python_amazon_ad_api.egg-info/requires.txt +0 -0
- {python_amazon_ad_api-2.2.3 → python_amazon_ad_api-2.2.4}/python_amazon_ad_api.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: python-amazon-ad-api
|
|
3
|
+
Version: 2.2.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.35.0,>=2.27.1
|
|
16
|
+
Requires-Dist: six<1.18,>=1.16
|
|
17
|
+
Requires-Dist: cachetools<8.1,>=5.0
|
|
18
|
+
Requires-Dist: pycryptodome<4.7,>=3.13
|
|
19
|
+
Requires-Dist: pytz<2027.0,>=2021.3
|
|
20
|
+
Requires-Dist: confuse<2.4,>=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
|
+
|
|
29
|
+
# PYTHON-AMAZON-AD-API
|
|
30
|
+
|
|
31
|
+

|
|
32
|
+

|
|
33
|
+

|
|
34
|
+
[](https://python-amazon-ad-api.readthedocs.io/en/latest/?badge=latest)
|
|
35
|
+

|
|
36
|
+
[](https://pepy.tech/project/python-amazon-ad-api)
|
|
37
|
+
[](https://pepy.tech/project/python-amazon-ad-api)
|
|
38
|
+
|
|
39
|
+
## Amazon's Advertising API
|
|
40
|
+
|
|
41
|
+
A python 3 wrapper to access Amazon's Advertising API with an easy-to-use interface.
|
|
42
|
+
|
|
43
|
+
### Install
|
|
44
|
+
|
|
45
|
+
[](https://pypi.org/project/python-amazon-ad-api/)
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
pip install python-amazon-ad-api
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Donate
|
|
52
|
+
|
|
53
|
+
If you find this project is useful consider donating or [sponsor](https://github.com/sponsors/denisneuf) it to keep on going on it, thank you.
|
|
54
|
+
|
|
55
|
+
[](https://www.paypal.com/donate?hosted_button_id=G3KB6M2G9YV9C)
|
|
56
|
+
|
|
57
|
+

|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
### Overview
|
|
61
|
+
|
|
62
|
+
You need obtain your own credentials with Amazon that may include an amazon developer account and access as seller or vendor. Please view the checklist of [Amazon Ads API onboarding overview](https://advertising.amazon.com/API/docs/en-us/setting-up/overview)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
### Code Credentials
|
|
66
|
+
You can use your credentials as follows passing it to the client as a dict. Please review the full [documentation](https://github.com/sponsors/denisneuf) to see all posibilities to include your credentials.
|
|
67
|
+
|
|
68
|
+
```javascript
|
|
69
|
+
from ad_api.api import ads_api_v1
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
my_credentials = dict(
|
|
73
|
+
refresh_token='your-refresh_token',
|
|
74
|
+
client_id='your-client_id',
|
|
75
|
+
client_secret='your-client_secret',
|
|
76
|
+
profile_id='your-profile_id',
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
info = {
|
|
80
|
+
"adProductFilter":
|
|
81
|
+
{
|
|
82
|
+
"include": [
|
|
83
|
+
"SPONSORED_PRODUCTS"
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
"stateFilter":
|
|
87
|
+
{
|
|
88
|
+
"include": [
|
|
89
|
+
"ENABLED"
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
result = ads_api_v1.Campaigns(credentials=my_credentials).query_campaigns(
|
|
95
|
+
body=info
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### YAML Credentials
|
|
101
|
+
Use a credentials.yml file with your credentials for more convenience and manage diferent accounts or profiles. Amazon requires one profile per marketplace so it is helpful to keep all in one file and switch directly from the code, using the account.
|
|
102
|
+
|
|
103
|
+
Create a file credentials.yml
|
|
104
|
+
|
|
105
|
+
```javascript
|
|
106
|
+
version: '1.0'
|
|
107
|
+
|
|
108
|
+
default:
|
|
109
|
+
refresh_token: 'your-refresh-token'
|
|
110
|
+
client_id: 'your-client-id'
|
|
111
|
+
client_secret: 'your-client-secret'
|
|
112
|
+
profile_id: 'your-profile-id'
|
|
113
|
+
|
|
114
|
+
germany:
|
|
115
|
+
refresh_token: 'other-refresh-token'
|
|
116
|
+
client_id: 'other-client-id'
|
|
117
|
+
client_secret: 'other-client-secret'
|
|
118
|
+
profile_id: 'other-profile-id'
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Python code
|
|
123
|
+
|
|
124
|
+
```python
|
|
125
|
+
from ad_api.api import ads_api_v1
|
|
126
|
+
|
|
127
|
+
info = {
|
|
128
|
+
"adProductFilter":
|
|
129
|
+
{
|
|
130
|
+
"include": [
|
|
131
|
+
"SPONSORED_PRODUCTS"
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
# Leave empty will use the 'default' account
|
|
137
|
+
result=ads_api_v1.Campaigns().query_campaigns(body=info)
|
|
138
|
+
# will use germany account data
|
|
139
|
+
result=ads_api_v1.Campaigns(account="germany").query_campaigns(body=info)
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
### Search path for credentials.yml
|
|
145
|
+
|
|
146
|
+
* macOS and Other Unix: `~/.config/python-ad-api`
|
|
147
|
+
* Windows: `%APPDATA%\python-ad-api` where the <cite>APPDATA</cite> environment variable falls
|
|
148
|
+
back to `%HOME%\AppData\Roaming` if undefined
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
[Confuse Help](https://confuse.readthedocs.io/en/latest/usage.html#search-paths)
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
### Marketplaces
|
|
155
|
+
|
|
156
|
+
Marketplaces are used to define basically the [API endpoints](https://advertising.amazon.com/API/docs/en-us/info/api-overview#api-endpoints) Amazon need to use depending on the regions, by default it will use EU so if you are using one of the marketplaces that are under the Europe (EU). Covers UK, FR, IT, ES, DE, NL, AE, SE, PL, and TR marketplaces you can skip. If you are using either North America (NA) or Far East (FE), you will need import from base and pass the marketplace as follows:
|
|
157
|
+
|
|
158
|
+
```python
|
|
159
|
+
from ad_api.api import ads_api_v1
|
|
160
|
+
from ad_api.base import Marketplaces
|
|
161
|
+
|
|
162
|
+
info = {
|
|
163
|
+
"adProductFilter":
|
|
164
|
+
{
|
|
165
|
+
"include": [
|
|
166
|
+
"SPONSORED_PRODUCTS"
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
# You can pass NA or US, CA, MX or BR for North America and JP, AU or SG for Far East
|
|
172
|
+
result=ads_api_v1.Campaigns(marketplace=Marketplaces.NA).query_campaigns(body=info)
|
|
173
|
+
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Exceptions
|
|
177
|
+
|
|
178
|
+
You can use a [try](https://docs.python.org/3.10/reference/compound_stmts.html#try) except statement when you call the API and catch exceptions if some problem ocurred:
|
|
179
|
+
|
|
180
|
+
```python
|
|
181
|
+
from ad_api.api import ads_api_v1
|
|
182
|
+
from ad_api.base import AdvertisingApiException
|
|
183
|
+
|
|
184
|
+
info = {
|
|
185
|
+
"adProductFilter":
|
|
186
|
+
{
|
|
187
|
+
"include": [
|
|
188
|
+
"SPONSORED_PRODUCTS"
|
|
189
|
+
]
|
|
190
|
+
},
|
|
191
|
+
"stateFilter":
|
|
192
|
+
{
|
|
193
|
+
"include": [
|
|
194
|
+
"ENABLED"
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
try:
|
|
200
|
+
|
|
201
|
+
result = ads_api_v1.Campaigns().query_campaigns(
|
|
202
|
+
body=info
|
|
203
|
+
)
|
|
204
|
+
|
|
205
|
+
logging.info(result)
|
|
206
|
+
|
|
207
|
+
except AdvertisingApiException as error:
|
|
208
|
+
logging.info(error)
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Debug
|
|
212
|
+
|
|
213
|
+
Use debug=True if you want see some logs like the header you submit to the api endpoint, the method and path used among the params and the data submitted if any, to trace some possible errors. Note that the header includes the Authorization bearer token, so do not leave debug output in shared logs.
|
|
214
|
+
|
|
215
|
+
```python
|
|
216
|
+
from ad_api.api import ads_api_v1
|
|
217
|
+
from ad_api.base import AdvertisingApiException
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
info = {
|
|
221
|
+
"adProductFilter":
|
|
222
|
+
{
|
|
223
|
+
"include": [
|
|
224
|
+
"SPONSORED_PRODUCTS"
|
|
225
|
+
]
|
|
226
|
+
},
|
|
227
|
+
"stateFilter":
|
|
228
|
+
{
|
|
229
|
+
"include": [
|
|
230
|
+
"ENABLED"
|
|
231
|
+
]
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
try:
|
|
236
|
+
|
|
237
|
+
result = ads_api_v1.Campaigns(debug=True).query_campaigns(
|
|
238
|
+
body=info
|
|
239
|
+
)
|
|
240
|
+
|
|
241
|
+
logging.info(result)
|
|
242
|
+
|
|
243
|
+
except AdvertisingApiException as error:
|
|
244
|
+
logging.info(error)
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
### Migrating from 1.x
|
|
249
|
+
|
|
250
|
+
`ad_api.api.Invoices` no longer exists. Amazon serves `/invoices` and
|
|
251
|
+
`/invoices/{invoiceId}` from the same contract as the rest of billing, so both
|
|
252
|
+
methods moved to `Billing`:
|
|
253
|
+
|
|
254
|
+
```python
|
|
255
|
+
# before
|
|
256
|
+
from ad_api.api import Invoices
|
|
257
|
+
Invoices(account=store).list_invoices()
|
|
258
|
+
|
|
259
|
+
# now
|
|
260
|
+
from ad_api.api import Billing
|
|
261
|
+
Billing(account=store).list_invoices()
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### What is covered
|
|
265
|
+
|
|
266
|
+
Every Amazon Ads API family this package speaks to, and how many modules it
|
|
267
|
+
ships. The per-module detail, with the contract and the vendor page of each
|
|
268
|
+
one, lives in the documentation:
|
|
269
|
+
|
|
270
|
+
**[python-amazon-ad-api.readthedocs.io](https://python-amazon-ad-api.readthedocs.io/en/latest/)**
|
|
271
|
+
|
|
272
|
+
| Family | Modules | Docs |
|
|
273
|
+
|---|---|---|
|
|
274
|
+
| Amazon Ads API v0 | 30 | [v0](https://python-amazon-ad-api.readthedocs.io/en/latest/v0.html) |
|
|
275
|
+
| Amazon Ads API v1 | 19 | [v1](https://python-amazon-ad-api.readthedocs.io/en/latest/v1.html) |
|
|
276
|
+
|
|
277
|
+
Coverage against the whole vendor tree, entries implemented and pending, is on
|
|
278
|
+
[Coverage](https://python-amazon-ad-api.readthedocs.io/en/latest/v0/not_implemented.html)
|
|
279
|
+
and the tree itself on
|
|
280
|
+
[Full Vendor tree](https://python-amazon-ad-api.readthedocs.io/en/latest/v0/full_vendor_tree.html).
|
|
281
|
+
|
|
282
|
+
### Amazon Ads API v1 - basic example
|
|
283
|
+
|
|
284
|
+
Both `v1` and `ads_api_v1` name the same namespace, so pick whichever reads
|
|
285
|
+
clearer: `from ad_api.api import v1` is shorter, and `ads_api_v1` makes it
|
|
286
|
+
obvious at the call site that the v1 API is being used.
|
|
287
|
+
|
|
288
|
+
```python
|
|
289
|
+
from ad_api.api import v1
|
|
290
|
+
|
|
291
|
+
result = v1.Campaigns(credentials=credentials, debug=True).query_campaigns(
|
|
292
|
+
body={
|
|
293
|
+
"adProductFilter": {"include": ["SPONSORED_PRODUCTS"]},
|
|
294
|
+
"stateFilter": {"include": ["ENABLED"]},
|
|
295
|
+
"maxResults": 100,
|
|
296
|
+
}
|
|
297
|
+
)
|
|
298
|
+
|
|
299
|
+
campaigns = result.payload.get("campaigns")
|
|
300
|
+
next_token = result.payload.get("nextToken")
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Simple Example Usage Campaigns with Credentials (v3, legacy)
|
|
304
|
+
|
|
305
|
+
> This example uses `CampaignsV3.list_campaigns`, which is deprecated. See the v1 `query_campaigns` example above.
|
|
306
|
+
|
|
307
|
+
```python
|
|
308
|
+
import logging
|
|
309
|
+
from ad_api.base import AdvertisingApiException
|
|
310
|
+
from ad_api.api import sponsored_products
|
|
311
|
+
|
|
312
|
+
logging.basicConfig(
|
|
313
|
+
level=logging.DEBUG,
|
|
314
|
+
format="%(asctime)s:%(levelname)s:%(message)s"
|
|
315
|
+
)
|
|
316
|
+
|
|
317
|
+
def sp_list_campaigns_v3(info: dict = None):
|
|
318
|
+
|
|
319
|
+
credentials = dict(
|
|
320
|
+
refresh_token='your-refresh_token',
|
|
321
|
+
client_id='your-client_id',
|
|
322
|
+
client_secret='your-client_secret',
|
|
323
|
+
profile_id='your-profile_id',
|
|
324
|
+
)
|
|
325
|
+
|
|
326
|
+
try:
|
|
327
|
+
result = sponsored_products.CampaignsV3(credentials=credentials, debug=True).list_campaigns(
|
|
328
|
+
body=info
|
|
329
|
+
)
|
|
330
|
+
payload = result.payload
|
|
331
|
+
return payload
|
|
332
|
+
except AdvertisingApiException as error:
|
|
333
|
+
logging.error(error)
|
|
334
|
+
logging.error(error.code)
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
state_filter = \
|
|
338
|
+
{
|
|
339
|
+
"stateFilter":
|
|
340
|
+
{
|
|
341
|
+
"include": [
|
|
342
|
+
"ENABLED"
|
|
343
|
+
]
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
enabled_campaigns = sp_list_campaigns_v3(state_filter).get("campaigns")
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
for campaign in enabled_campaigns:
|
|
351
|
+
logging.info(campaign)
|
|
352
|
+
|
|
353
|
+
logging.info(len(campaigns))
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
### API NOTICE
|
|
360
|
+
|
|
361
|
+
This API is based on the [API Client](https://github.com/saleweaver/rapid_rest_client) created by [@saleweaver](https://github.com/saleweaver) but adapted to amazon advertising authentication requeriments
|
|
362
|
+
|
|
363
|
+
### DISCLAIMER
|
|
364
|
+
|
|
365
|
+
We are not affiliated with Amazon but they used our api :)
|
|
366
|
+
|
|
367
|
+
### LICENSE
|
|
368
|
+
|
|
369
|
+

|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
*Last release: v2.2.3*
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
# PYTHON-AMAZON-AD-API
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+
[](https://python-amazon-ad-api.readthedocs.io/en/latest/?badge=latest)
|
|
7
|
+

|
|
8
|
+
[](https://pepy.tech/project/python-amazon-ad-api)
|
|
9
|
+
[](https://pepy.tech/project/python-amazon-ad-api)
|
|
10
|
+
|
|
11
|
+
## Amazon's Advertising API
|
|
12
|
+
|
|
13
|
+
A python 3 wrapper to access Amazon's Advertising API with an easy-to-use interface.
|
|
14
|
+
|
|
15
|
+
### Install
|
|
16
|
+
|
|
17
|
+
[](https://pypi.org/project/python-amazon-ad-api/)
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
pip install python-amazon-ad-api
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Donate
|
|
24
|
+
|
|
25
|
+
If you find this project is useful consider donating or [sponsor](https://github.com/sponsors/denisneuf) it to keep on going on it, thank you.
|
|
26
|
+
|
|
27
|
+
[](https://www.paypal.com/donate?hosted_button_id=G3KB6M2G9YV9C)
|
|
28
|
+
|
|
29
|
+

|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Overview
|
|
33
|
+
|
|
34
|
+
You need obtain your own credentials with Amazon that may include an amazon developer account and access as seller or vendor. Please view the checklist of [Amazon Ads API onboarding overview](https://advertising.amazon.com/API/docs/en-us/setting-up/overview)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Code Credentials
|
|
38
|
+
You can use your credentials as follows passing it to the client as a dict. Please review the full [documentation](https://github.com/sponsors/denisneuf) to see all posibilities to include your credentials.
|
|
39
|
+
|
|
40
|
+
```javascript
|
|
41
|
+
from ad_api.api import ads_api_v1
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
my_credentials = dict(
|
|
45
|
+
refresh_token='your-refresh_token',
|
|
46
|
+
client_id='your-client_id',
|
|
47
|
+
client_secret='your-client_secret',
|
|
48
|
+
profile_id='your-profile_id',
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
info = {
|
|
52
|
+
"adProductFilter":
|
|
53
|
+
{
|
|
54
|
+
"include": [
|
|
55
|
+
"SPONSORED_PRODUCTS"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
"stateFilter":
|
|
59
|
+
{
|
|
60
|
+
"include": [
|
|
61
|
+
"ENABLED"
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
result = ads_api_v1.Campaigns(credentials=my_credentials).query_campaigns(
|
|
67
|
+
body=info
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### YAML Credentials
|
|
73
|
+
Use a credentials.yml file with your credentials for more convenience and manage diferent accounts or profiles. Amazon requires one profile per marketplace so it is helpful to keep all in one file and switch directly from the code, using the account.
|
|
74
|
+
|
|
75
|
+
Create a file credentials.yml
|
|
76
|
+
|
|
77
|
+
```javascript
|
|
78
|
+
version: '1.0'
|
|
79
|
+
|
|
80
|
+
default:
|
|
81
|
+
refresh_token: 'your-refresh-token'
|
|
82
|
+
client_id: 'your-client-id'
|
|
83
|
+
client_secret: 'your-client-secret'
|
|
84
|
+
profile_id: 'your-profile-id'
|
|
85
|
+
|
|
86
|
+
germany:
|
|
87
|
+
refresh_token: 'other-refresh-token'
|
|
88
|
+
client_id: 'other-client-id'
|
|
89
|
+
client_secret: 'other-client-secret'
|
|
90
|
+
profile_id: 'other-profile-id'
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Python code
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
from ad_api.api import ads_api_v1
|
|
98
|
+
|
|
99
|
+
info = {
|
|
100
|
+
"adProductFilter":
|
|
101
|
+
{
|
|
102
|
+
"include": [
|
|
103
|
+
"SPONSORED_PRODUCTS"
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
# Leave empty will use the 'default' account
|
|
109
|
+
result=ads_api_v1.Campaigns().query_campaigns(body=info)
|
|
110
|
+
# will use germany account data
|
|
111
|
+
result=ads_api_v1.Campaigns(account="germany").query_campaigns(body=info)
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
### Search path for credentials.yml
|
|
117
|
+
|
|
118
|
+
* macOS and Other Unix: `~/.config/python-ad-api`
|
|
119
|
+
* Windows: `%APPDATA%\python-ad-api` where the <cite>APPDATA</cite> environment variable falls
|
|
120
|
+
back to `%HOME%\AppData\Roaming` if undefined
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
[Confuse Help](https://confuse.readthedocs.io/en/latest/usage.html#search-paths)
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
### Marketplaces
|
|
127
|
+
|
|
128
|
+
Marketplaces are used to define basically the [API endpoints](https://advertising.amazon.com/API/docs/en-us/info/api-overview#api-endpoints) Amazon need to use depending on the regions, by default it will use EU so if you are using one of the marketplaces that are under the Europe (EU). Covers UK, FR, IT, ES, DE, NL, AE, SE, PL, and TR marketplaces you can skip. If you are using either North America (NA) or Far East (FE), you will need import from base and pass the marketplace as follows:
|
|
129
|
+
|
|
130
|
+
```python
|
|
131
|
+
from ad_api.api import ads_api_v1
|
|
132
|
+
from ad_api.base import Marketplaces
|
|
133
|
+
|
|
134
|
+
info = {
|
|
135
|
+
"adProductFilter":
|
|
136
|
+
{
|
|
137
|
+
"include": [
|
|
138
|
+
"SPONSORED_PRODUCTS"
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
# You can pass NA or US, CA, MX or BR for North America and JP, AU or SG for Far East
|
|
144
|
+
result=ads_api_v1.Campaigns(marketplace=Marketplaces.NA).query_campaigns(body=info)
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Exceptions
|
|
149
|
+
|
|
150
|
+
You can use a [try](https://docs.python.org/3.10/reference/compound_stmts.html#try) except statement when you call the API and catch exceptions if some problem ocurred:
|
|
151
|
+
|
|
152
|
+
```python
|
|
153
|
+
from ad_api.api import ads_api_v1
|
|
154
|
+
from ad_api.base import AdvertisingApiException
|
|
155
|
+
|
|
156
|
+
info = {
|
|
157
|
+
"adProductFilter":
|
|
158
|
+
{
|
|
159
|
+
"include": [
|
|
160
|
+
"SPONSORED_PRODUCTS"
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
"stateFilter":
|
|
164
|
+
{
|
|
165
|
+
"include": [
|
|
166
|
+
"ENABLED"
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
try:
|
|
172
|
+
|
|
173
|
+
result = ads_api_v1.Campaigns().query_campaigns(
|
|
174
|
+
body=info
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
logging.info(result)
|
|
178
|
+
|
|
179
|
+
except AdvertisingApiException as error:
|
|
180
|
+
logging.info(error)
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Debug
|
|
184
|
+
|
|
185
|
+
Use debug=True if you want see some logs like the header you submit to the api endpoint, the method and path used among the params and the data submitted if any, to trace some possible errors. Note that the header includes the Authorization bearer token, so do not leave debug output in shared logs.
|
|
186
|
+
|
|
187
|
+
```python
|
|
188
|
+
from ad_api.api import ads_api_v1
|
|
189
|
+
from ad_api.base import AdvertisingApiException
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
info = {
|
|
193
|
+
"adProductFilter":
|
|
194
|
+
{
|
|
195
|
+
"include": [
|
|
196
|
+
"SPONSORED_PRODUCTS"
|
|
197
|
+
]
|
|
198
|
+
},
|
|
199
|
+
"stateFilter":
|
|
200
|
+
{
|
|
201
|
+
"include": [
|
|
202
|
+
"ENABLED"
|
|
203
|
+
]
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
try:
|
|
208
|
+
|
|
209
|
+
result = ads_api_v1.Campaigns(debug=True).query_campaigns(
|
|
210
|
+
body=info
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
logging.info(result)
|
|
214
|
+
|
|
215
|
+
except AdvertisingApiException as error:
|
|
216
|
+
logging.info(error)
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
### Migrating from 1.x
|
|
221
|
+
|
|
222
|
+
`ad_api.api.Invoices` no longer exists. Amazon serves `/invoices` and
|
|
223
|
+
`/invoices/{invoiceId}` from the same contract as the rest of billing, so both
|
|
224
|
+
methods moved to `Billing`:
|
|
225
|
+
|
|
226
|
+
```python
|
|
227
|
+
# before
|
|
228
|
+
from ad_api.api import Invoices
|
|
229
|
+
Invoices(account=store).list_invoices()
|
|
230
|
+
|
|
231
|
+
# now
|
|
232
|
+
from ad_api.api import Billing
|
|
233
|
+
Billing(account=store).list_invoices()
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### What is covered
|
|
237
|
+
|
|
238
|
+
Every Amazon Ads API family this package speaks to, and how many modules it
|
|
239
|
+
ships. The per-module detail, with the contract and the vendor page of each
|
|
240
|
+
one, lives in the documentation:
|
|
241
|
+
|
|
242
|
+
**[python-amazon-ad-api.readthedocs.io](https://python-amazon-ad-api.readthedocs.io/en/latest/)**
|
|
243
|
+
|
|
244
|
+
| Family | Modules | Docs |
|
|
245
|
+
|---|---|---|
|
|
246
|
+
| Amazon Ads API v0 | 30 | [v0](https://python-amazon-ad-api.readthedocs.io/en/latest/v0.html) |
|
|
247
|
+
| Amazon Ads API v1 | 19 | [v1](https://python-amazon-ad-api.readthedocs.io/en/latest/v1.html) |
|
|
248
|
+
|
|
249
|
+
Coverage against the whole vendor tree, entries implemented and pending, is on
|
|
250
|
+
[Coverage](https://python-amazon-ad-api.readthedocs.io/en/latest/v0/not_implemented.html)
|
|
251
|
+
and the tree itself on
|
|
252
|
+
[Full Vendor tree](https://python-amazon-ad-api.readthedocs.io/en/latest/v0/full_vendor_tree.html).
|
|
253
|
+
|
|
254
|
+
### Amazon Ads API v1 - basic example
|
|
255
|
+
|
|
256
|
+
Both `v1` and `ads_api_v1` name the same namespace, so pick whichever reads
|
|
257
|
+
clearer: `from ad_api.api import v1` is shorter, and `ads_api_v1` makes it
|
|
258
|
+
obvious at the call site that the v1 API is being used.
|
|
259
|
+
|
|
260
|
+
```python
|
|
261
|
+
from ad_api.api import v1
|
|
262
|
+
|
|
263
|
+
result = v1.Campaigns(credentials=credentials, debug=True).query_campaigns(
|
|
264
|
+
body={
|
|
265
|
+
"adProductFilter": {"include": ["SPONSORED_PRODUCTS"]},
|
|
266
|
+
"stateFilter": {"include": ["ENABLED"]},
|
|
267
|
+
"maxResults": 100,
|
|
268
|
+
}
|
|
269
|
+
)
|
|
270
|
+
|
|
271
|
+
campaigns = result.payload.get("campaigns")
|
|
272
|
+
next_token = result.payload.get("nextToken")
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Simple Example Usage Campaigns with Credentials (v3, legacy)
|
|
276
|
+
|
|
277
|
+
> This example uses `CampaignsV3.list_campaigns`, which is deprecated. See the v1 `query_campaigns` example above.
|
|
278
|
+
|
|
279
|
+
```python
|
|
280
|
+
import logging
|
|
281
|
+
from ad_api.base import AdvertisingApiException
|
|
282
|
+
from ad_api.api import sponsored_products
|
|
283
|
+
|
|
284
|
+
logging.basicConfig(
|
|
285
|
+
level=logging.DEBUG,
|
|
286
|
+
format="%(asctime)s:%(levelname)s:%(message)s"
|
|
287
|
+
)
|
|
288
|
+
|
|
289
|
+
def sp_list_campaigns_v3(info: dict = None):
|
|
290
|
+
|
|
291
|
+
credentials = dict(
|
|
292
|
+
refresh_token='your-refresh_token',
|
|
293
|
+
client_id='your-client_id',
|
|
294
|
+
client_secret='your-client_secret',
|
|
295
|
+
profile_id='your-profile_id',
|
|
296
|
+
)
|
|
297
|
+
|
|
298
|
+
try:
|
|
299
|
+
result = sponsored_products.CampaignsV3(credentials=credentials, debug=True).list_campaigns(
|
|
300
|
+
body=info
|
|
301
|
+
)
|
|
302
|
+
payload = result.payload
|
|
303
|
+
return payload
|
|
304
|
+
except AdvertisingApiException as error:
|
|
305
|
+
logging.error(error)
|
|
306
|
+
logging.error(error.code)
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
state_filter = \
|
|
310
|
+
{
|
|
311
|
+
"stateFilter":
|
|
312
|
+
{
|
|
313
|
+
"include": [
|
|
314
|
+
"ENABLED"
|
|
315
|
+
]
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
enabled_campaigns = sp_list_campaigns_v3(state_filter).get("campaigns")
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
for campaign in enabled_campaigns:
|
|
323
|
+
logging.info(campaign)
|
|
324
|
+
|
|
325
|
+
logging.info(len(campaigns))
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### API NOTICE
|
|
332
|
+
|
|
333
|
+
This API is based on the [API Client](https://github.com/saleweaver/rapid_rest_client) created by [@saleweaver](https://github.com/saleweaver) but adapted to amazon advertising authentication requeriments
|
|
334
|
+
|
|
335
|
+
### DISCLAIMER
|
|
336
|
+
|
|
337
|
+
We are not affiliated with Amazon but they used our api :)
|
|
338
|
+
|
|
339
|
+
### LICENSE
|
|
340
|
+
|
|
341
|
+

|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
---
|
|
345
|
+
*Last release: v2.2.3*
|