{"id":28618418,"url":"https://github.com/denisneuf/python-amazon-ad-api","last_synced_at":"2026-04-02T19:20:55.860Z","repository":{"id":37265353,"uuid":"405245377","full_name":"denisneuf/python-amazon-ad-api","owner":"denisneuf","description":"Python Amazon Advertising API","archived":false,"fork":false,"pushed_at":"2026-03-31T01:43:58.000Z","size":932,"stargazers_count":183,"open_issues_count":0,"forks_count":75,"subscribers_count":8,"default_branch":"main","last_synced_at":"2026-03-31T04:53:30.605Z","etag":null,"topics":["advertising","amazon","api","python"],"latest_commit_sha":null,"homepage":"https://python-amazon-ad-api.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/denisneuf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"denisneuf","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2021-09-11T00:27:51.000Z","updated_at":"2026-03-31T01:43:21.000Z","dependencies_parsed_at":"2023-02-15T14:45:59.646Z","dependency_job_id":"9c1f41d5-6d23-498d-907b-8aa8f54f4edc","html_url":"https://github.com/denisneuf/python-amazon-ad-api","commit_stats":{"total_commits":439,"total_committers":11,"mean_commits":39.90909090909091,"dds":"0.21867881548974943","last_synced_commit":"483de05abf877c9a6ea5580a47a1f4bc440e55dd"},"previous_names":[],"tags_count":84,"template":false,"template_full_name":null,"purl":"pkg:github/denisneuf/python-amazon-ad-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denisneuf%2Fpython-amazon-ad-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denisneuf%2Fpython-amazon-ad-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denisneuf%2Fpython-amazon-ad-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denisneuf%2Fpython-amazon-ad-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/denisneuf","download_url":"https://codeload.github.com/denisneuf/python-amazon-ad-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denisneuf%2Fpython-amazon-ad-api/sbom","scorecard":{"id":334123,"data":{"date":"2025-08-11","repo":{"name":"github.com/denisneuf/python-amazon-ad-api","commit":"5ef72366b2b6a20720c9c921295d330f8a279e90"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.6,"checks":[{"name":"Maintained","score":10,"reason":"13 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":1,"reason":"Found 2/11 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:29","Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:28","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/dependabot-automerge.yml:1","Warn: no topLevel permission defined: .github/workflows/main.yml:1","Warn: no topLevel permission defined: .github/workflows/python-publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":1,"reason":"dependency not pinned by hash detected -- score normalized to 1","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/denisneuf/python-amazon-ad-api/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/denisneuf/python-amazon-ad-api/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/denisneuf/python-amazon-ad-api/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:71: update your workflow using https://app.stepsecurity.io/secureworkflow/denisneuf/python-amazon-ad-api/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/dependabot-automerge.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/denisneuf/python-amazon-ad-api/dependabot-automerge.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/dependabot-automerge.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/denisneuf/python-amazon-ad-api/dependabot-automerge.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/denisneuf/python-amazon-ad-api/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/denisneuf/python-amazon-ad-api/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/denisneuf/python-amazon-ad-api/python-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/denisneuf/python-amazon-ad-api/python-publish.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/main.yml:18","Warn: pipCommand not pinned by hash: .github/workflows/main.yml:19","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:28","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:29","Info:   0 out of   9 GitHub-owned GitHubAction dependencies pinned","Info:   2 out of   3 third-party GitHubAction dependencies pinned","Info:   0 out of   4 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.6.5 not signed: https://api.github.com/repos/denisneuf/python-amazon-ad-api/releases/228151584","Warn: release artifact v0.6.4 not signed: https://api.github.com/repos/denisneuf/python-amazon-ad-api/releases/209255215","Warn: release artifact v0.6.3 not signed: https://api.github.com/repos/denisneuf/python-amazon-ad-api/releases/189080448","Warn: release artifact v0.6.2 not signed: https://api.github.com/repos/denisneuf/python-amazon-ad-api/releases/186107283","Warn: release artifact v0.6.1 not signed: https://api.github.com/repos/denisneuf/python-amazon-ad-api/releases/180781013","Warn: release artifact v0.6.5 does not have provenance: https://api.github.com/repos/denisneuf/python-amazon-ad-api/releases/228151584","Warn: release artifact v0.6.4 does not have provenance: https://api.github.com/repos/denisneuf/python-amazon-ad-api/releases/209255215","Warn: release artifact v0.6.3 does not have provenance: https://api.github.com/repos/denisneuf/python-amazon-ad-api/releases/189080448","Warn: release artifact v0.6.2 does not have provenance: https://api.github.com/repos/denisneuf/python-amazon-ad-api/releases/186107283","Warn: release artifact v0.6.1 does not have provenance: https://api.github.com/repos/denisneuf/python-amazon-ad-api/releases/180781013"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/python-publish.yml:16"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Vulnerabilities","score":6,"reason":"4 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2018-21 / GHSA-hgg3-g7gr-66r7","Warn: Project is vulnerable to: GHSA-j225-cvw7-qrx7","Warn: Project is vulnerable to: PYSEC-2021-142 / GHSA-8q59-q68h-6hv4","Warn: Project is vulnerable to: PYSEC-2018-49 / GHSA-rprw-h62v-c2w7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":9,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 18 commits out of 22 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T04:17:55.494Z","repository_id":37265353,"created_at":"2025-08-18T04:17:55.494Z","updated_at":"2025-08-18T04:17:55.494Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31314375,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["advertising","amazon","api","python"],"created_at":"2025-06-12T04:01:47.355Z","updated_at":"2026-04-02T19:20:55.855Z","avatar_url":"https://github.com/denisneuf.png","language":"Python","funding_links":["https://github.com/sponsors/denisneuf","https://www.paypal.com/donate?hosted_button_id=G3KB6M2G9YV9C"],"categories":["Python"],"sub_categories":[],"readme":"# PYTHON-AMAZON-AD-API\n\n![CodeQL](https://img.shields.io/badge/coverage-95%25-green)\n![CodeQL](https://img.shields.io/badge/Docs-sphinx-green)\n![CodeQL](https://img.shields.io/github/v/release/denisneuf/python-amazon-ad-api)\n[![Documentation Status](https://readthedocs.org/projects/python-amazon-ad-api/badge/?version=latest)](https://python-amazon-ad-api.readthedocs.io/en/latest/?badge=latest)\n![PyPI Downloads](https://static.pepy.tech/badge/python-amazon-ad-api)\n[![Downloads](https://static.pepy.tech/badge/python-amazon-ad-api/month)](https://pepy.tech/project/python-amazon-ad-api)\n[![Downloads](https://static.pepy.tech/badge/python-amazon-ad-api/week)](https://pepy.tech/project/python-amazon-ad-api)\n\n## Amazon's Advertising API\n\nA python 3 wrapper to access Amazon's Advertising API with an easy-to-use interface.\n\n### Install\n\n[![Badge](https://img.shields.io/pypi/v/python-amazon-ad-api?style=for-the-badge)](https://pypi.org/project/python-amazon-ad-api/)\n\n```\npip install python-amazon-ad-api\n```\n\n### Donate\n\nIf you find this project is useful consider donating or [sponsor](https://github.com/sponsors/denisneuf) it to keep on going on it, thank you.\n\n[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/donate?hosted_button_id=G3KB6M2G9YV9C)\n\n![alt text](https://github.com/denisneuf/python-amazon-ad-api/blob/main/test/codigo-QR.png?raw=true)\n\n\n### Overview\n\nYou 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) \n\n\n### Code Credentials\nYou 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.\n\n```javascript\nfrom ad_api.api import sponsored_products\n\n\nmy_credentials = dict(\n    refresh_token='your-refresh_token',\n    client_id='your-client_id',\n    client_secret='your-client_secret',\n    profile_id='your-profile_id',\n)\n\ninfo = \\\n    {\n        \"stateFilter\":\n            {\n                \"include\": [\n                    \"ENABLED\"\n                ]\n            }\n    }\n\nresult = sponsored_products.CampaignsV3(credentials=my_credentials).list_campaigns(\n    body=info\n)\n\n```\n\n### YAML Credentials\nUse 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.\n\nCreate a file credentials.yml\n\n```javascript\nversion: '1.0'\n\ndefault:\n  refresh_token: 'your-refresh-token'\n  client_id: 'your-client-id'\n  client_secret: 'your-client-secret'\n  profile_id: 'your-profile-id'\n\ngermany:\n  refresh_token: 'other-refresh-token'\n  client_id: 'other-client-id'\n  client_secret: 'other-client-secret'\n  profile_id: 'other-profile-id'\n\n```\n\nPython code\n\n```python\nfrom ad_api.api import sponsored_products\n\n# Leave empty will use the 'default' account\nresult=sponsored_products.CampaignsV3().list_campaigns()\n# will use germany account data\nresult=sponsored_products.CampaignsV3(account=\"germany\").list_campaigns()\n```\n\n\n\n### Search path for credentials.yml\n\n* macOS and Other Unix: `~/.config/python-ad-api`\n* Windows: `%APPDATA%\\python-ad-api` where the \u003ccite\u003eAPPDATA\u003c/cite\u003e environment variable falls\nback to `%HOME%\\AppData\\Roaming` if undefined\n\n\n[Confuse Help](https://confuse.readthedocs.io/en/latest/usage.html#search-paths)\n\n\n### Marketplaces\n\nMarketplaces 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:\n\n```python\nfrom ad_api.api import sponsored_products\nfrom ad_api.base import Marketplaces\n\n# You can pass NA or US, CA, MX or BR for North America and JP, AU or SG for Far East\nresult=sponsored_products.CampaignsV3(marketplace=Marketplaces.NA).list_campaigns()\n\n```\n\n### Exceptions\n\nYou 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:\n\n```python\nfrom ad_api.api import sponsored_products\nfrom ad_api.base import AdvertisingApiException\n\ninfo = \\\n    {\n        \"stateFilter\":\n            {\n                \"include\": [\n                    \"ENABLED\"\n                ]\n            }\n    }\n\ntry:\n\n    result = sponsored_products.CampaignsV3().list_campaigns(\n        body=info\n    )\n\n    logging.info(result)\n\nexcept AdvertisingApiException as error:\n    logging.info(error)\n```\n\n### Debug\n\nUse 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.\n\n```python\nfrom ad_api.api import sponsored_products\nfrom ad_api.base import AdvertisingApiException\n\n\ninfo = \\\n    {\n        \"stateFilter\":\n            {\n                \"include\": [\n                    \"ENABLED\"\n                ]\n            }\n    }\n\ntry:\n\n    result = sponsored_products.CampaignsV3(debug=True).list_campaigns(\n        body=info\n    )\n\n    logging.info(result)\n\nexcept AdvertisingApiException as error:\n    logging.info(error)\n```\n\n\n```python\nimport logging\nfrom ad_api.api import Profiles\nfrom ad_api.base import AdvertisingApiException\n\nlogging.basicConfig(\n    level=logging.DEBUG,\n    format=\"%(asctime)s:%(levelname)s:%(message)s\"\n)\n\n\ndef register_assistant(value: str):\n\n    logging.info(\"-------------------------------------\")\n    logging.info(\"Profiles \u003e register_assistant(%s)\" % value)\n    logging.info(\"-------------------------------------\")\n\n    try:\n\n        result = Profiles(debug=True).register_assistant(\n            country_code=value\n        )\n        logging.info(result)\n\n    except AdvertisingApiException as error:\n        logging.info(error)\n\n\nif __name__ == '__main__':\n\n    amz_country_code = \"ES\"\n    register_assistant(amz_country_code)\n```\nOr you could do with a curl command, note the ***{\"countryCode\":\"ES\"}*** that refers to the marketplace you will operate.\n\n```curl\ncurl \\\n    -X PUT \\\n    -H \"Content-Type:application/json\" \\\n    -H \"Authorization: Bearer Your-Token \\\n    -H \"Amazon-Advertising-API-ClientId: your-client-id\" \\\n    --data '{\"countryCode\":\"ES\"}' \\\n     https://advertising-api-test.amazon.com/v2/profiles/register\n\n```\n\n### [Modules Available Common Resources](https://python-amazon-ad-api.readthedocs.io/en/latest/api.html)\n\n* [Profiles](https://python-amazon-ad-api.readthedocs.io/en/latest/api/profiles.html)\n* [Manager Accounts](https://python-amazon-ad-api.readthedocs.io/en/latest/api/manager_accounts.html)\n\nWarning: [PLANNED DEPRECATION 1/3/2025]\nThere 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).\n\n* [Portfolios](https://python-amazon-ad-api.readthedocs.io/en/latest/api/portfolios.html)\n* [PortfoliosV3](https://python-amazon-ad-api.readthedocs.io/en/latest/api/portfoliosV3.html)\n* [Invoices](https://python-amazon-ad-api.readthedocs.io/en/latest/api/invoices.html)\n* [Billing](https://python-amazon-ad-api.readthedocs.io/en/latest/api/billing.html)\n* [Audiences](https://python-amazon-ad-api.readthedocs.io/en/latest/api/audiences.html)\n* [Change History open Beta](https://python-amazon-ad-api.readthedocs.io/en/latest/api/history.html)\n* [Creative Assets open Beta](https://python-amazon-ad-api.readthedocs.io/en/latest/api//creative_assets.html)\n* [Elegibility](https://python-amazon-ad-api.readthedocs.io/en/latest/api/eligibility.html)\n* [Insights](https://python-amazon-ad-api.readthedocs.io/en/latest/api/insights.html)\n* [Localization](https://python-amazon-ad-api.readthedocs.io/en/latest/api/localization.html)\n* [Product Selector](https://python-amazon-ad-api.readthedocs.io/en/latest/api/metadata.html)\n* [Validation Configurations](https://python-amazon-ad-api.readthedocs.io/en/latest/api/validation_configurations.html)\n* [Tactical recommendations beta](https://python-amazon-ad-api.readthedocs.io/en/latest/api/recommendations.html)\n* [Exports](https://advertising.amazon.com/API/docs/en-us/exports)\n\n\n### [Amazon Attribution open beta](https://python-amazon-ad-api.readthedocs.io/en/latest/api/attribution.html)\n* [Advertisers](https://python-amazon-ad-api.readthedocs.io/en/latest/api/attribution.html#ad_api.api.Attribution.Attribution.get_advertisers)\n* [Publishers](https://python-amazon-ad-api.readthedocs.io/en/latest/api/attribution.html#ad_api.api.Attribution.Attribution.get_publishers)\n* [Macro tags](https://python-amazon-ad-api.readthedocs.io/en/latest/api/attribution.html#ad_api.api.Attribution.Attribution.get_macro_tag)\n* [Non Macro tags](https://python-amazon-ad-api.readthedocs.io/en/latest/api/attribution.html#ad_api.api.Attribution.Attribution.get_non_macro_template_tag)\n* [Reports](https://python-amazon-ad-api.readthedocs.io/en/latest/api/attribution.html#ad_api.api.Attribution.Attribution.post_report)\n\n### [Brand Metrics open beta](https://python-amazon-ad-api.readthedocs.io/en/latest/api/brand_metrics.html)\n* [Post Report](https://python-amazon-ad-api.readthedocs.io/en/latest/api/brand_metrics.html#ad_api.api.BrandMetrics.BrandMetrics.post_report)\n* [Get Report](https://python-amazon-ad-api.readthedocs.io/en/latest/api/brand_metrics.html#ad_api.api.BrandMetrics.BrandMetrics.get_report)\n* [Download Report](https://python-amazon-ad-api.readthedocs.io/en/latest/api/brand_metrics.html#ad_api.api.BrandMetrics.BrandMetrics.download_report)\n\n### [Advertising Test Account](https://python-amazon-ad-api.readthedocs.io/en/latest/api/advertising_test_account.html)\n* [Create test account](https://python-amazon-ad-api.readthedocs.io/en/latest/api/advertising_test_account.html#ad_api.api.AdvertisingTestAccount)\n* [Get test account information](https://python-amazon-ad-api.readthedocs.io/en/latest/api/advertising_test_account.html#ad_api.api.AdvertisingTestAccount.AdvertisingTestAccount.get_test_account)\n\n\n### [Modules Available Sponsored Products 2.0](https://python-amazon-ad-api.readthedocs.io/en/latest/sp_v2.html)\n\nWarning: [PLANNED DEPRECATION 6/30/2023]\nThere is a new version 3 of Sponsored Product API, please check the [migration guide](https://advertising.amazon.com/API/docs/en-us/sponsored-products/v3-migration-guide).\n\n\n### [Modules Available Sponsored Products 3.0](https://python-amazon-ad-api.readthedocs.io/en/latest/sp_v3.html)\n\n\n* [ThemeBased Bid Recommendation](https://python-amazon-ad-api.readthedocs.io/en/latest/sp/bid_recommendations_v3.html)\n* [Keyword Recommendations](https://python-amazon-ad-api.readthedocs.io/en/latest/sp/ranked_keywords_recommendations.html)\n* [Keywords](https://python-amazon-ad-api.readthedocs.io/en/latest/sp/keywords_v3.html)\n* [Negative Keywords](https://python-amazon-ad-api.readthedocs.io/en/latest/sp/negative_keywords_v3.html)\n* [Product Targeting](https://python-amazon-ad-api.readthedocs.io/en/latest/sp/product_targeting.html)\n* [Campaign Optimization](https://python-amazon-ad-api.readthedocs.io/en/latest/sp/campaign_optimization_rules.html)\n* [Budget Rules](https://python-amazon-ad-api.readthedocs.io/en/latest/sp/budget_rules.html)\n* [Product Ads](https://python-amazon-ad-api.readthedocs.io/en/latest/sp/product_ads_v3.html)\n* [Negative Targeting Clauses](https://python-amazon-ad-api.readthedocs.io/en/latest/sp/negative_product_targeting_v3.html)\n* [Campaign Negative Targeting Clauses](https://python-amazon-ad-api.readthedocs.io/en/latest/sp/campaign_negative_targets.html)\n* [Budget recommendations and missed opportunities](https://python-amazon-ad-api.readthedocs.io/en/latest/sp/product_recommendations.html)\n* [Budget Rules Recommendation](https://python-amazon-ad-api.readthedocs.io/en/latest/sp/budget_rules_recommendations.html)\n* [Campaigns](https://python-amazon-ad-api.readthedocs.io/en/latest/sp/campaignsv3.html)\n* [Ad Groups](https://python-amazon-ad-api.readthedocs.io/en/latest/sp/ad_groups_v3.html)\n* [Consolidated Recommendations](https://python-amazon-ad-api.readthedocs.io/en/latest/sp/campaigns_consolidated_recommendations.html)\n* [Campaign Negative Keywords](https://python-amazon-ad-api.readthedocs.io/en/latest/sp/campaign_negative_keywords_v3.html)\n* [Product Recommendations](https://python-amazon-ad-api.readthedocs.io/en/latest/sp/budget_recommendations.html)\n* [Budget Usage](https://python-amazon-ad-api.readthedocs.io/en/latest/sp/campaign_budget_usage.html)\n* [Reports](https://python-amazon-ad-api.readthedocs.io/en/latest/api/reports.html)\n\n\n### [Modules Available Sponsored Brands 3.0](https://python-amazon-ad-api.readthedocs.io/en/latest/sb_v3.html)\n\n* [Campaigns](https://python-amazon-ad-api.readthedocs.io/en/latest/sb/campaigns.html)\n* [Ad Groups](https://python-amazon-ad-api.readthedocs.io/en/latest/sb/ad_groups.html)\n* [Keywords](https://python-amazon-ad-api.readthedocs.io/en/latest/sb/keywords.html)\n* [Negative Keywords](https://python-amazon-ad-api.readthedocs.io/en/latest/sb/negative_keywords.html)\n* [Product Targeting](https://python-amazon-ad-api.readthedocs.io/en/latest/sb/product_targeting.html)\n* [Negative Product Targeting](https://python-amazon-ad-api.readthedocs.io/en/latest/sb/negative_product_targeting.html)\n* [Targeting Recommendations](https://python-amazon-ad-api.readthedocs.io/en/latest/sb/targeting_recommendations.html)\n* [Bid Recommendations](https://python-amazon-ad-api.readthedocs.io/en/latest/sb/bid_recommendations.html)\n* [Stores](https://python-amazon-ad-api.readthedocs.io/en/latest/sb/stores.html)\n* [Landing Page Asins](https://python-amazon-ad-api.readthedocs.io/en/latest/sb/landing_page_asins.html)\n* [Media](https://python-amazon-ad-api.readthedocs.io/en/latest/sb/media.html)\n* [Brands](https://python-amazon-ad-api.readthedocs.io/en/latest/sb/brands.html)\n* [Moderation](https://python-amazon-ad-api.readthedocs.io/en/latest/sb/moderation.html)\n* [Reports](https://python-amazon-ad-api.readthedocs.io/en/latest/sb/reports.html)\n* [Snapshots](https://python-amazon-ad-api.readthedocs.io/en/latest/sb/snapshots.html)\n* [Themes](https://python-amazon-ad-api.readthedocs.io/en/latest/sb/themes.html)\n\n### [Modules Available Sponsored Brands 4.0](https://python-amazon-ad-api.readthedocs.io/en/latest/sb_v4.html)\n\n* [Campaigns](https://python-amazon-ad-api.readthedocs.io/en/latest/sb/campaigns_v4.html)\n* [Ad Groups](https://python-amazon-ad-api.readthedocs.io/en/latest/sb/ad_groups_v4.html)\n* [Ads Groups](https://python-amazon-ad-api.readthedocs.io/en/latest/sb/ads_v4.html)\n\n### [Modules Available Sponsored Display](https://python-amazon-ad-api.readthedocs.io/en/latest/sd.html)\n\n* [Campaigns](https://python-amazon-ad-api.readthedocs.io/en/latest/sd/campaigns.html)\n* [Ad Groups](https://python-amazon-ad-api.readthedocs.io/en/latest/sd/ad_groups.html)\n* [Reports](https://python-amazon-ad-api.readthedocs.io/en/latest/sd/reports.html)\n* [Product Ads](https://python-amazon-ad-api.readthedocs.io/en/latest/sd/product_ads.html)\n* [Targets](https://python-amazon-ad-api.readthedocs.io/en/latest/sd/product_targeting.html)\n* [Negative Targets](https://python-amazon-ad-api.readthedocs.io/en/latest/sd/negative_product_targeting.html)\n* [Targets Recommendations](https://python-amazon-ad-api.readthedocs.io/en/latest/sd/targeting_recommendations.html)\n* [Bid Recommendations](https://python-amazon-ad-api.readthedocs.io/en/latest/sd/bid_recommendations.html)\n* [Creatives](https://python-amazon-ad-api.readthedocs.io/en/latest/sd/creatives.html)\n* [Brand Safety List](https://python-amazon-ad-api.readthedocs.io/en/latest/sd/brand_safety.html)\n* [Budget Rules](https://python-amazon-ad-api.readthedocs.io/en/latest/sd/budget_rules.html)\n* [Campaigns Budget Usage](https://python-amazon-ad-api.readthedocs.io/en/latest/sd/campaign_budget_usage.html)\n* [Forecasts](https://python-amazon-ad-api.readthedocs.io/en/latest/sd/forecast.html)\n* [Recommendations](https://python-amazon-ad-api.readthedocs.io/en/latest/sd/recommendations.html)\n\n### [Modules Available DSP](https://python-amazon-ad-api.readthedocs.io/en/latest/dsp.html)\n\n* [Reports](https://python-amazon-ad-api.readthedocs.io/en/latest/dsp/reports.html)\n\n### Simple Example Usage Campaigns with Credentials\n\n```python\nimport logging\nfrom ad_api.base import AdvertisingApiException\nfrom ad_api.api import sponsored_products\n\nlogging.basicConfig(\n    level=logging.DEBUG,\n    format=\"%(asctime)s:%(levelname)s:%(message)s\"\n)\n\ndef sp_list_campaigns_v3(info: dict = None):\n\n    credentials = dict(\n        refresh_token='your-refresh_token',\n        client_id='your-client_id',\n        client_secret='your-client_secret',\n        profile_id='your-profile_id',\n    )\n\n    try:\n        result = sponsored_products.CampaignsV3(credentials=credentials, debug=True).list_campaigns(\n            body=info\n        )\n        payload = result.payload\n        return payload\n    except AdvertisingApiException as error:\n        logging.error(error)\n        logging.error(error.code)\n\n\nstate_filter = \\\n    {\n        \"stateFilter\":\n            {\n                \"include\": [\n                    \"ENABLED\"\n                ]\n            }\n    }\n\nenabled_campaigns = sp_list_campaigns_v3(state_filter).get(\"campaigns\")\n\n\nfor campaign in enabled_campaigns:\n    logging.info(campaign)\n\nlogging.info(len(campaigns))\n\n\n\n```\n\n### API NOTICE\n\nThis 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\n\n### DISCLAIMER\n\nWe are not affiliated with Amazon but they used our api :)\n\n### LICENSE\n\n![License](https://img.shields.io/badge/license-MIT-green)\n\n\n---\n*Last release: v0.8.1 (via electropaco automated release process no memory)*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenisneuf%2Fpython-amazon-ad-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenisneuf%2Fpython-amazon-ad-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenisneuf%2Fpython-amazon-ad-api/lists"}