![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
amazon-ads-api-connector
Advanced tools
A simple Python wrapper for the latest version of the Amazon Ads API for Sponsored Products campaign management.
This module covers the key endpoints for managing Sponsored Products campaigns. This includes methods for authentication, pagination and report generation. It features keyword and negative keyword targeting, as well as product ASIN targeting and auto campaigns.
Please note that this module does not yet support Sponsored Brands and Sponsored Display campaigns.
Amazon Ads API Connector is available on PyPI:
pip install amazon-ads-api-connector
The primary class of the module is AmazonAdsAPIConnector
. This class provides methods to create, list, update and delete
It furthermore provides methods to get keyword recommendations
, which include bid recommendations for keyword targets, as well as bid recommendations for ad groups
, which include bid recommendations for auto campaigns.
And lastly, it provides also methods to request and retrieve reports via the API.
To create an instance of the AmazonAdsAPIConnector
, you need to pass your Amazon Ads API credentials as a dictionary. The dictionary must contain the following keys:
refresh_token
client_id
client_secret
profile_id
Upon initialization, the AmazonAdsAPIConnector object will create a new access token. This access token will be valid for 60 minutes, however, the object automatically requests a new access token in case it has expired when trying to make a new request.
You furthermore need to specify the region of your Amazon Ads account. The region is specified by the Region
enum, which is part of the amazon_ads_api_connector
module. The Amazon Ads API supports the following regions:
Region.NA
Region.EU
Region.FE
For more information about the Amazon Ads API, please visit the official documentation.
from amazon_ads_api_connector import AmazonAdsAPIConnector, Region
api = AmazonAdsAPIConnector(
{
"refresh_token": "your_refresh_token",
"client_id": "your_client_id",
"client_secret": "your_client_secret",
"profile_id": "your_profile_id",
},
Region.EU,
)
campaigns = api.list_campaigns()
api.create_campaign(
campaigns=[
{
"name": "My Campaign",
"targetingType": "MANUAL",
"state": "ENABLED",
"dynamicBidding": {
"strategy": "LEGACY_FOR_SALES",
},
"bugdget": {
"budgetType": "DAILY",
"budget": 0,
},
},
]
)
Please note that all create and update methods expect a list of dictionaries as their only argument. This reflects the fact that the Amazon Ads API allows to create or update multiple objects at once. To ensure the greatest possible flexibility, the structure of the list and the dictionaries corresponds to the structure specified by the API and described in the API documentation. For more information about the structure of the lists and dictionaries, as well for information on data limits per request, please visit the official documentation.
The module contains classes which represent basic configurations of the available report types:
CampaignsReport
TargetingReport
SearchTermReport
AdvertisedProductReport
PurchasedProductReport
For more information about the report types, please visit the official documentation.
To request a report you need to pass an instance of one of these classes to the create_report
method of the AmazonAdsAPIConnector
class. To customize the report, change the properties of the class instance before passing it to the create_report
method.
from amazon_ads_api_connector import SearchTermReport
report_configuration = SearchTermReport("2023-10-01", "2023-10-07")
res = api.create_report(report_configuration)
report = api.get_report(res)
Please note that report gerneration is asynchronous. The create_report
method returns a dictionary containing the report ID. The get_report
takes this dictionary as an argument and returns the report once it is completed and available. The completion of a report usually takes a few minutes and can take up to 3 hours.
This module depends on the httpx
library, which is not included in the Python standard library, but will be installed automatically when you install the amazon-ads-api-connector
package.
I am not affiliated with Amazon in any way. This module is an independent project that aims to provide a simple and easy-to-use interface to the Amazon Ads API for Sponsored Products campaign management. I do not guarantee the correctness or completeness of the module. Use it at your own risk.
FAQs
API wrapper for the Amazon Ads API
We found that amazon-ads-api-connector demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.