searchads-api


Namesearchads-api JSON
Version 1.7.19 PyPI version JSON
download
home_pagehttps://github.com/phiture/searchads_api
SummaryApple Searchads API non-official python library
upload_time2025-01-28 09:21:37
maintainerNone
docs_urlNone
authorAbdul Majeed Alkattan
requires_pythonNone
licenseNone
keywords python searchads library apple
VCS
bugtrack_url
requirements requests pyjwt cryptography
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![Phiture](logo.png)

### About Phiture

_[Phiture](http://phiture.com) is a Berlin-based mobile growth consultancy working with the teams behind leading apps. Using the company’s industry-acclaimed Mobile Growth Stack as a strategic framework, Phiture team offers 4 key services: App Store Optimization, Apple Search Ads, User Retention services and Growth Consulting._

### Apple Searchads API Library in Python

In order to facilitate the usage of the Apple Search Ads API Phiture's Engineers have built a library in Python which allows users to manage campaigns, ad groups, keywords and creative sets. This library only requires intermediate Python skills and therefore makes it possible not only for Engineers but also for Data Analysts and Apple Search Ads Consultants to work with it.  While the library is extensive it is not complete and users are encouraged to commit suggestions.
The official link to the searchads campaign management api is https://developer.apple.com/documentation/search_ads/

## Setup


### Using cert and key files
Create a certs directory inside of your project folder, or create a different certs directory and specify it using the certificates_dir_path argument.

```python
PEM_FILE_PATH = "cert.pem"
KEY_FILE_PATH = "cert.key"
CERTIFICATES_DIR_PATH = "certs/"

api = SearchAdsAPI(
    org_id=123456,
    pem=PEM_FILE_PATH,
    key=KEY_FILE_PATH,
    certificates_dir_path=CERTIFICATES_DIR_PATH,
    client_id="SEARCHADS.12345678-1234-1234-1234-123456789012",
    team_id="SEARCHADS.12345678-1234-1234-1234-123456789012",
    key_id="12345678-1234-1234-1234-123456789012",
)
```

### Using cert and key file strings
```python
PEM_FILE_CONTENT = """
-----BEGIN PUBLIC KEY-----
...
-----END PUBLIC KEY-----
"""

KEY_FILE_CONTENT = """
-----BEGIN EC PRIVATE KEY-----
...
-----END EC PRIVATE KEY-----
"""

api = SearchAdsAPI(
    org_id=123456,
    pem_content=PEM_FILE_CONTENT,
    key_content=KEY_FILE_CONTENT,
    client_id="SEARCHADS.12345678-1234-1234-1234-123456789012",
    team_id="SEARCHADS.12345678-1234-1234-1234-123456789012",
    key_id="12345678-1234-1234-1234-123456789012",
)
```

## Available Methods

### Campaign Methods

- Create a new campaign

         res = api.create_campaign(1433439534, ['AU'], "test", 1, 1, "EUR")

- Find campaigns using a conditions list

         res = api.find_campaigns(conditions=[{"field": "countriesOrRegions","operator": "CONTAINS_ALL","values": ["US", "CA"]}])

- Get a specific campaign

         res = api.get_campaign(283767149)

- Get all campaigns

         res = api.get_campaigns(limit=0)

- Update a campaign

         res = update_campaign(campaign_id, countries=None, campaign_name="Christmas Campaign 2019", budget=None, daily_budget=None, curruncy=None, status=None, adamId=None)

- Delete campaign

         res = api.delete_campaign(283767149)

### Adgroup Methods

- Create a new adGroup inside of a campaign

        res = api.create_adgroup(186370637, "test", "EUR",1, datetime.datetime.utcnow())
        
        res = api.create_adgroup(186370637, "test", "EUR",1, datetime.datetime.utcnow(), localities=["US|NY|New York"], adminAreas=["US|NY"])

         res = api.create_adgroup(campaign_id, adgroup_name, currency,
                       cpc_bid,  start_time, end_time=None, cpa_goal=None,  automated_keywords_opt_in=False, age=None, gender=None, device_class=None, day_part=None, adminArea=None, locality=None, appDownloaders=None)

- Fetch ad groups within a campaign.

         res = api.find_adgroups(campaign_id, limit=1000, offset=0, sort_field="id", sort_order="ASCENDING", conditions=[], fields=[])

- Get all adGroups

         res = api.get_adgroups(290916652)

- Get a specific adGroup

         res = api.get_adgroups(290916652, 21321323)

- Update an Adgroup

         res = update_adgroup(campaign_id, adgroup_id, adgroup_name=None,                             cpa_goal=None, currency=None,
                       cpc_bid=None, start_time=None, end_time=None, automated_keywords_opt_in=False, age=None, gender=None, device_class=None,
                       day_part=None, adminArea=None, locality=None, appDownloaders=None)

- Delete an Adgroup

         res = delete_adgroup(campaign_id, adgroup_id)


### Targeting Keyword Methods

- Add new targeting keywords to an AdGroup

         keywords = [{
                 "text": "keyword",
                 "matchType": "BROAD",
                 "status" : "PAUSED",
                 "bidAmount": {
                     "amount": "1",
                     "currency": "EUR"
                 }
             }, {
                 "text": "keyword 5",
                 "matchType": "EXACT",
                 "status" : "PAUSED",
                 "bidAmount": {
                     "amount": "1",
                     "currency": "EUR"
                 }
             }]
         res = api.add_targeting_keywords(290916652,291017295,keywords)

- Fetch keywords used in ad groups.

         res = find_targeting_keywords(campaign_id, adgroup_id, sort_field="id", sort_order="ASCENDING", conditions=[], offset=0, limit=1000)

- Get one targeting keyword

         res = api.get_targeting_keyword(290916652,291017295, 213213213)

- Get all targeting keywords

         res = api.get_targeting_keywords(290916652,291017295)

- Update targeting keywords in an adGroup

         keywords = [{
                     "id": 291202529,
                     "status": "PAUSED",
                     "bidAmount": {
                         "amount": "0.5",
                         "currency": "EUR"
                     }
                     },
                     {
                     "id": 291202530,
                     "status": "PAUSED",
                     "bidAmount": {
                         "amount": "0.5",
                         "currency": "EUR"
                     }
                     }
                     ]
         res = api.update_targeting_keywords(290916652, 291017295, keywords)

### Campaign Negative Keyword Methods

- Add new campaign negative keywords

         keywords = [{
                 "text": "keyword",
                 "matchType": "BROAD",
                 "status" : "PAUSED",
             }, {
                 "text": "keyword 5",
                 "matchType": "EXACT",
                 "status" : "PAUSED",
             }]
         res = api.add_campaign_negative_keywords(290916652, keywords)

- Get a specific campaign negative keyword

         res = api.get_campaign_negative_keyword(290916652, 291225104)

- Get all campaign negative keywords

         res = api.get_campaign_negative_keywords(290916652)

- Update campaign negative keywords

         keywords = [{
                 "id": "291225104",
                 "status" : "PAUSED",
             }]
         res = api.update_campaign_negative_keywords(290916652, keywords)

- Delete campaign negative keywords

         keywords = [291225104]
         res = api.delete_campaign_negative_keywords(290916652, keywords)

### Adgroup Negative Keyword Methods

- Add new adgroup negative keywords

         keywords = [{
                 "text": "keyword",
                 "matchType": "BROAD",
                 "status" : "PAUSED",
             }, {
                 "text": "keyword 5",
                 "matchType": "EXACT",
                 "status" : "PAUSED",
             }]
         res = api.add_adgroup_negative_keywords(290916652, 291017295, keywords)

- Get a specific adGroup negative keyword

         res = api.get_adgroup_negative_keyword(290916652, 291017295, 291227741)

- Get all adgroup negative keywords

         res = api.get_adgroup_negative_keywords(290916652,291017295)

- Update adGroup negative keywords

         keywords = [{
             "id": "123456789",
             "status": "PAUSED",
         }]
         res = api.update_adgroup_negative_keywords(123456789, 291017295, keywords)

- Update a list of adGroup negative Keywords

         keywords = [{
                     "id": 0000000,
                     "adGroupId": 291017295,
                     "text": "test",
                     "status": "PAUSED",
                     "matchType": "EXACT",
                     "bidAmount": {
                         "amount": "0.5",
                         "currency": "EUR"
                     },
                     "deleted": False
                 }]
         res = api.update_targeting_keywords(290916652,291017295,keywords)

- Delete a list of AdGroup negative keywords

         keyword_ids = [123456789]
         res = api.delete_adgroup_negative_keywords(290916652, 291017295, keyword_ids)

### Creativeset Methods (Some methods are Deprecated since ASA v4)

- DEPRECATED Fetch assets used with Creative Sets.

         res = api.get_creativesets_assets(adam_id, countries_or_regions, assets_gen_ids=[])

- Fetch supported app preview device size mappings.

         res = api.get_app_preview_device_sizes()

- Create a new creativeset

         res = api.create_creativeset(campaign_id, adgroup_id, adamId, name, languageCode, assetsGenIds)

- Get all Creativesets

         res = api.get_creativeset(campaign_id, adgroup_id=None, limit=1000, offset=0))

- Get a specific Creativesets

         res = api.get_creativeset(creativeset_id, include_deleted_creative_set_assets=False)

- DEPRECATED Update an Adgroup Creativeset

         res = api.update_creativeset(campaign_id, adgroup_id, creativeset_id, status)

- DEPRECATED Assign a Creativeset to an Adgroup

         res = api.assign_creativeset_to_adgroup(campaign_id, adgroup_id, creativeset_id)

- DEPRECATED Fetch all Creative Sets assigned to ad groups.

         conditions = [{
            "field": "id",
            "operator": "EQUALS",
            "values": [
            "11111111"
                ]
            }]
         res = api.find_adgroup_creativesets(campaign_id,conditions=conditions,         sort_field="id", sort_order="ASCENDING")

- DEPRECATED Fetch all Creative Sets assigned to an organization.

         res = api.find_creativesets(conditions=[], limit=1000, offset=0)

- Fetch asset details of a Creative Set.

         res = api.get_creativeset(creativeset_id, include_deleted_creative_set_assets=False)

- DEPRECATED Update a creativeset name

         res = api.update_adgroup_creativeset_name(creativeset_id, name)

- DEPRECATED Delete creative sets from a specified Adgroup
         res = api.delete_creativesets(campaign_id, adgroup_id, ids)

### Reporting Methods

- Get reports on campaigns within a specific org.

         res = api.get_campaigns_report_by_date("2019-04-01", "2019-04-10", 123456789, limit=5)

- Get reports on adgroups within a specific org.

         row, grandTotals = api.get_adgroups_report_by_date(123456789, "2019-02-20", "2019-02-28",limit=0)

- Get reports on keywords level. limit 0 gets all results instead of just 1000

         row, grandTotals = api.get_keywords_report_by_date(123456789, "2019-02-20", "2019-02-28",limit=0)

- Fetches reports for targeting keywords within an ad group. limit 0 gets all results instead of just 1000

         row, grandTotals = api.get_keyword_level_within_adgroup_report_by_date(123456789, 123456789, "2019-02-20", "2019-02-28",limit=0)

- DEPRECATED Get reports on creativeset level. limit 0 gets all results instead of just 1000

         row, grandTotals= api.get_creativesets_report_by_date(123456789, "2019-06-01", "2019-06-10")

- Fetches ad performance data within a campaign. limit 0 gets all results instead of just 1000

         row, grandTotals= api.get_ad_level_report_by_date(123456789, "2019-06-01", "2019-06-10")

- Get reports on searchterms level

         row, grandTotals = api.get_searcherms_report_by_date(123456789,"2019-05-01", "2019-05-07",limit=0)

- Fetches reports for search terms within an ad group.

         row, grandTotals = api.get_searchterm_level_within_an_adgroup_report_by_date(123456789, 123456789,"2019-05-01", "2019-05-07",limit=0)

### Geo Search

- Search Adminareas

         res = api.geo_search("New York", entity="AdminArea", country_code="US")

- Search Localities 

         res = api.geo_search("New York", entity="Locality", country_code="US")

- Returns a list of admin areas in a country.

         res = api.get_admin_areas(country_code="US")

- Returns a list of localities in a country.

         res = api.get_localities(country_code)

- Gets geo location details based on geo identifier.

         res = api.get_geo_locations_list(geo_id,
                               entity,
                               limit=1000, offset=0)

# Ad Endpoints

# Product Pages methods


# Impression share reports
- Create an impression share report example
         
         conditions = [
         {
             "field": "countryOrRegion",
             "operator": "IN",
             "values": [
             "US",
             "IN"
             ]
         }
         ]
         
         #res = api.impression_share_reports(start_date="2023-01-01", end_date="2023-01-20", conditions=conditions)

- Get a list of all impression share reports

         res = api.get_all_impression_share_reports()

- Get a single impression share report using report ID

         res = api.get_single_impression_share_report(12345)


## Changelog

* version 1.7.19 added support for custom headers in API requests
* version 1.7.14 fixed an issue with the timezone for Search Terms + Search Terms within Ad Groups (must be ORTZ - organization time zone)
* version 1.7.12 added support for the v5 of the Apple Search Ads API
* version 1.7.11 added support for use cert and key as strings
* version 1.7.10 always use the latest cryptography package
* version 1.7.9 always use the latest requests package
* version 1.7.7 fixed an issue update_campaign
* version 1.7.6 fixed an issue with token update
* version 1.7.1 added impression share reports and new find methods along product pages to match Searchads API version 4.7
* version 1.6.3 New bug fixes
* version 1.6.1 added new product page, reporting, and Ad endpoints. Deprecated creatives endpoints
* version 1.5.3 fixed token update issue
* version 1.5.3 deprecated creativesets methods from Apple Search Ads API v4
* version 1.5.2 fixed a bug in token refresh due to wrong status code
* version 1.5.1 handles API error with Exception
* version 1.2.1 refresh access_tokn only when needed
* version 1.1.1 added support for the v4 of the Apple Search Ads API
* version 0.7.1 fixed some issues with granularity
* version 0.1.1 Added granularity level reports

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/phiture/searchads_api",
    "name": "searchads-api",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "python, searchads, library, apple",
    "author": "Abdul Majeed Alkattan",
    "author_email": "alkattan@phiture.com",
    "download_url": "https://files.pythonhosted.org/packages/cd/97/8272691267a6daf8c8c34f4c1d3a4eae32c339844acc0c91d81911b7a8ef/searchads_api-1.7.19.tar.gz",
    "platform": null,
    "description": "![Phiture](logo.png)\n\n### About Phiture\n\n_[Phiture](http://phiture.com) is a Berlin-based mobile growth consultancy working with the teams behind leading apps. Using the company\u2019s industry-acclaimed Mobile Growth Stack as a strategic framework, Phiture team offers 4 key services: App Store Optimization, Apple Search Ads, User Retention services and Growth Consulting._\n\n### Apple Searchads API Library in Python\n\nIn order to facilitate the usage of the Apple Search Ads API Phiture's Engineers have built a library in Python which allows users to manage campaigns, ad groups, keywords and creative sets. This library only requires intermediate Python skills and therefore makes it possible not only for Engineers but also for Data Analysts and Apple Search Ads Consultants to work with it.  While the library is extensive it is not complete and users are encouraged to commit suggestions.\nThe official link to the searchads campaign management api is https://developer.apple.com/documentation/search_ads/\n\n## Setup\n\n\n### Using cert and key files\nCreate a certs directory inside of your project folder, or create a different certs directory and specify it using the certificates_dir_path argument.\n\n```python\nPEM_FILE_PATH = \"cert.pem\"\nKEY_FILE_PATH = \"cert.key\"\nCERTIFICATES_DIR_PATH = \"certs/\"\n\napi = SearchAdsAPI(\n    org_id=123456,\n    pem=PEM_FILE_PATH,\n    key=KEY_FILE_PATH,\n    certificates_dir_path=CERTIFICATES_DIR_PATH,\n    client_id=\"SEARCHADS.12345678-1234-1234-1234-123456789012\",\n    team_id=\"SEARCHADS.12345678-1234-1234-1234-123456789012\",\n    key_id=\"12345678-1234-1234-1234-123456789012\",\n)\n```\n\n### Using cert and key file strings\n```python\nPEM_FILE_CONTENT = \"\"\"\n-----BEGIN PUBLIC KEY-----\n...\n-----END PUBLIC KEY-----\n\"\"\"\n\nKEY_FILE_CONTENT = \"\"\"\n-----BEGIN EC PRIVATE KEY-----\n...\n-----END EC PRIVATE KEY-----\n\"\"\"\n\napi = SearchAdsAPI(\n    org_id=123456,\n    pem_content=PEM_FILE_CONTENT,\n    key_content=KEY_FILE_CONTENT,\n    client_id=\"SEARCHADS.12345678-1234-1234-1234-123456789012\",\n    team_id=\"SEARCHADS.12345678-1234-1234-1234-123456789012\",\n    key_id=\"12345678-1234-1234-1234-123456789012\",\n)\n```\n\n## Available Methods\n\n### Campaign Methods\n\n- Create a new campaign\n\n         res = api.create_campaign(1433439534, ['AU'], \"test\", 1, 1, \"EUR\")\n\n- Find campaigns using a conditions list\n\n         res = api.find_campaigns(conditions=[{\"field\": \"countriesOrRegions\",\"operator\": \"CONTAINS_ALL\",\"values\": [\"US\", \"CA\"]}])\n\n- Get a specific campaign\n\n         res = api.get_campaign(283767149)\n\n- Get all campaigns\n\n         res = api.get_campaigns(limit=0)\n\n- Update a campaign\n\n         res = update_campaign(campaign_id, countries=None, campaign_name=\"Christmas Campaign 2019\", budget=None, daily_budget=None, curruncy=None, status=None, adamId=None)\n\n- Delete campaign\n\n         res = api.delete_campaign(283767149)\n\n### Adgroup Methods\n\n- Create a new adGroup inside of a campaign\n\n        res = api.create_adgroup(186370637, \"test\", \"EUR\",1, datetime.datetime.utcnow())\n        \n        res = api.create_adgroup(186370637, \"test\", \"EUR\",1, datetime.datetime.utcnow(), localities=[\"US|NY|New York\"], adminAreas=[\"US|NY\"])\n\n         res = api.create_adgroup(campaign_id, adgroup_name, currency,\n                       cpc_bid,  start_time, end_time=None, cpa_goal=None,  automated_keywords_opt_in=False, age=None, gender=None, device_class=None, day_part=None, adminArea=None, locality=None, appDownloaders=None)\n\n- Fetch ad groups within a campaign.\n\n         res = api.find_adgroups(campaign_id, limit=1000, offset=0, sort_field=\"id\", sort_order=\"ASCENDING\", conditions=[], fields=[])\n\n- Get all adGroups\n\n         res = api.get_adgroups(290916652)\n\n- Get a specific adGroup\n\n         res = api.get_adgroups(290916652, 21321323)\n\n- Update an Adgroup\n\n         res = update_adgroup(campaign_id, adgroup_id, adgroup_name=None,                             cpa_goal=None, currency=None,\n                       cpc_bid=None, start_time=None, end_time=None, automated_keywords_opt_in=False, age=None, gender=None, device_class=None,\n                       day_part=None, adminArea=None, locality=None, appDownloaders=None)\n\n- Delete an Adgroup\n\n         res = delete_adgroup(campaign_id, adgroup_id)\n\n\n### Targeting Keyword Methods\n\n- Add new targeting keywords to an AdGroup\n\n         keywords = [{\n                 \"text\": \"keyword\",\n                 \"matchType\": \"BROAD\",\n                 \"status\" : \"PAUSED\",\n                 \"bidAmount\": {\n                     \"amount\": \"1\",\n                     \"currency\": \"EUR\"\n                 }\n             }, {\n                 \"text\": \"keyword 5\",\n                 \"matchType\": \"EXACT\",\n                 \"status\" : \"PAUSED\",\n                 \"bidAmount\": {\n                     \"amount\": \"1\",\n                     \"currency\": \"EUR\"\n                 }\n             }]\n         res = api.add_targeting_keywords(290916652,291017295,keywords)\n\n- Fetch keywords used in ad groups.\n\n         res = find_targeting_keywords(campaign_id, adgroup_id, sort_field=\"id\", sort_order=\"ASCENDING\", conditions=[], offset=0, limit=1000)\n\n- Get one targeting keyword\n\n         res = api.get_targeting_keyword(290916652,291017295, 213213213)\n\n- Get all targeting keywords\n\n         res = api.get_targeting_keywords(290916652,291017295)\n\n- Update targeting keywords in an adGroup\n\n         keywords = [{\n                     \"id\": 291202529,\n                     \"status\": \"PAUSED\",\n                     \"bidAmount\": {\n                         \"amount\": \"0.5\",\n                         \"currency\": \"EUR\"\n                     }\n                     },\n                     {\n                     \"id\": 291202530,\n                     \"status\": \"PAUSED\",\n                     \"bidAmount\": {\n                         \"amount\": \"0.5\",\n                         \"currency\": \"EUR\"\n                     }\n                     }\n                     ]\n         res = api.update_targeting_keywords(290916652, 291017295, keywords)\n\n### Campaign Negative Keyword Methods\n\n- Add new campaign negative keywords\n\n         keywords = [{\n                 \"text\": \"keyword\",\n                 \"matchType\": \"BROAD\",\n                 \"status\" : \"PAUSED\",\n             }, {\n                 \"text\": \"keyword 5\",\n                 \"matchType\": \"EXACT\",\n                 \"status\" : \"PAUSED\",\n             }]\n         res = api.add_campaign_negative_keywords(290916652, keywords)\n\n- Get a specific campaign negative keyword\n\n         res = api.get_campaign_negative_keyword(290916652, 291225104)\n\n- Get all campaign negative keywords\n\n         res = api.get_campaign_negative_keywords(290916652)\n\n- Update campaign negative keywords\n\n         keywords = [{\n                 \"id\": \"291225104\",\n                 \"status\" : \"PAUSED\",\n             }]\n         res = api.update_campaign_negative_keywords(290916652, keywords)\n\n- Delete campaign negative keywords\n\n         keywords = [291225104]\n         res = api.delete_campaign_negative_keywords(290916652, keywords)\n\n### Adgroup Negative Keyword Methods\n\n- Add new adgroup negative keywords\n\n         keywords = [{\n                 \"text\": \"keyword\",\n                 \"matchType\": \"BROAD\",\n                 \"status\" : \"PAUSED\",\n             }, {\n                 \"text\": \"keyword 5\",\n                 \"matchType\": \"EXACT\",\n                 \"status\" : \"PAUSED\",\n             }]\n         res = api.add_adgroup_negative_keywords(290916652, 291017295, keywords)\n\n- Get a specific adGroup negative keyword\n\n         res = api.get_adgroup_negative_keyword(290916652, 291017295, 291227741)\n\n- Get all adgroup negative keywords\n\n         res = api.get_adgroup_negative_keywords(290916652,291017295)\n\n- Update adGroup negative keywords\n\n         keywords = [{\n             \"id\": \"123456789\",\n             \"status\": \"PAUSED\",\n         }]\n         res = api.update_adgroup_negative_keywords(123456789, 291017295, keywords)\n\n- Update a list of adGroup negative Keywords\n\n         keywords = [{\n                     \"id\": 0000000,\n                     \"adGroupId\": 291017295,\n                     \"text\": \"test\",\n                     \"status\": \"PAUSED\",\n                     \"matchType\": \"EXACT\",\n                     \"bidAmount\": {\n                         \"amount\": \"0.5\",\n                         \"currency\": \"EUR\"\n                     },\n                     \"deleted\": False\n                 }]\n         res = api.update_targeting_keywords(290916652,291017295,keywords)\n\n- Delete a list of AdGroup negative keywords\n\n         keyword_ids = [123456789]\n         res = api.delete_adgroup_negative_keywords(290916652, 291017295, keyword_ids)\n\n### Creativeset Methods (Some methods are Deprecated since ASA v4)\n\n- DEPRECATED Fetch assets used with Creative Sets.\n\n         res = api.get_creativesets_assets(adam_id, countries_or_regions, assets_gen_ids=[])\n\n- Fetch supported app preview device size mappings.\n\n         res = api.get_app_preview_device_sizes()\n\n- Create a new creativeset\n\n         res = api.create_creativeset(campaign_id, adgroup_id, adamId, name, languageCode, assetsGenIds)\n\n- Get all Creativesets\n\n         res = api.get_creativeset(campaign_id, adgroup_id=None, limit=1000, offset=0))\n\n- Get a specific Creativesets\n\n         res = api.get_creativeset(creativeset_id, include_deleted_creative_set_assets=False)\n\n- DEPRECATED Update an Adgroup Creativeset\n\n         res = api.update_creativeset(campaign_id, adgroup_id, creativeset_id, status)\n\n- DEPRECATED Assign a Creativeset to an Adgroup\n\n         res = api.assign_creativeset_to_adgroup(campaign_id, adgroup_id, creativeset_id)\n\n- DEPRECATED Fetch all Creative Sets assigned to ad groups.\n\n         conditions = [{\n            \"field\": \"id\",\n            \"operator\": \"EQUALS\",\n            \"values\": [\n            \"11111111\"\n                ]\n            }]\n         res = api.find_adgroup_creativesets(campaign_id,conditions=conditions,         sort_field=\"id\", sort_order=\"ASCENDING\")\n\n- DEPRECATED Fetch all Creative Sets assigned to an organization.\n\n         res = api.find_creativesets(conditions=[], limit=1000, offset=0)\n\n- Fetch asset details of a Creative Set.\n\n         res = api.get_creativeset(creativeset_id, include_deleted_creative_set_assets=False)\n\n- DEPRECATED Update a creativeset name\n\n         res = api.update_adgroup_creativeset_name(creativeset_id, name)\n\n- DEPRECATED Delete creative sets from a specified Adgroup\n         res = api.delete_creativesets(campaign_id, adgroup_id, ids)\n\n### Reporting Methods\n\n- Get reports on campaigns within a specific org.\n\n         res = api.get_campaigns_report_by_date(\"2019-04-01\", \"2019-04-10\", 123456789, limit=5)\n\n- Get reports on adgroups within a specific org.\n\n         row, grandTotals = api.get_adgroups_report_by_date(123456789, \"2019-02-20\", \"2019-02-28\",limit=0)\n\n- Get reports on keywords level. limit 0 gets all results instead of just 1000\n\n         row, grandTotals = api.get_keywords_report_by_date(123456789, \"2019-02-20\", \"2019-02-28\",limit=0)\n\n- Fetches reports for targeting keywords within an ad group. limit 0 gets all results instead of just 1000\n\n         row, grandTotals = api.get_keyword_level_within_adgroup_report_by_date(123456789, 123456789, \"2019-02-20\", \"2019-02-28\",limit=0)\n\n- DEPRECATED Get reports on creativeset level. limit 0 gets all results instead of just 1000\n\n         row, grandTotals= api.get_creativesets_report_by_date(123456789, \"2019-06-01\", \"2019-06-10\")\n\n- Fetches ad performance data within a campaign. limit 0 gets all results instead of just 1000\n\n         row, grandTotals= api.get_ad_level_report_by_date(123456789, \"2019-06-01\", \"2019-06-10\")\n\n- Get reports on searchterms level\n\n         row, grandTotals = api.get_searcherms_report_by_date(123456789,\"2019-05-01\", \"2019-05-07\",limit=0)\n\n- Fetches reports for search terms within an ad group.\n\n         row, grandTotals = api.get_searchterm_level_within_an_adgroup_report_by_date(123456789, 123456789,\"2019-05-01\", \"2019-05-07\",limit=0)\n\n### Geo Search\n\n- Search Adminareas\n\n         res = api.geo_search(\"New York\", entity=\"AdminArea\", country_code=\"US\")\n\n- Search Localities \n\n         res = api.geo_search(\"New York\", entity=\"Locality\", country_code=\"US\")\n\n- Returns a list of admin areas in a country.\n\n         res = api.get_admin_areas(country_code=\"US\")\n\n- Returns a list of localities in a country.\n\n         res = api.get_localities(country_code)\n\n- Gets geo location details based on geo identifier.\n\n         res = api.get_geo_locations_list(geo_id,\n                               entity,\n                               limit=1000, offset=0)\n\n# Ad Endpoints\n\n# Product Pages methods\n\n\n# Impression share reports\n- Create an impression share report example\n         \n         conditions = [\n         {\n             \"field\": \"countryOrRegion\",\n             \"operator\": \"IN\",\n             \"values\": [\n             \"US\",\n             \"IN\"\n             ]\n         }\n         ]\n         \n         #res = api.impression_share_reports(start_date=\"2023-01-01\", end_date=\"2023-01-20\", conditions=conditions)\n\n- Get a list of all impression share reports\n\n         res = api.get_all_impression_share_reports()\n\n- Get a single impression share report using report ID\n\n         res = api.get_single_impression_share_report(12345)\n\n\n## Changelog\n\n* version 1.7.19 added support for custom headers in API requests\n* version 1.7.14 fixed an issue with the timezone for Search Terms + Search Terms within Ad Groups (must be ORTZ - organization time zone)\n* version 1.7.12 added support for the v5 of the Apple Search Ads API\n* version 1.7.11 added support for use cert and key as strings\n* version 1.7.10 always use the latest cryptography package\n* version 1.7.9 always use the latest requests package\n* version 1.7.7 fixed an issue update_campaign\n* version 1.7.6 fixed an issue with token update\n* version 1.7.1 added impression share reports and new find methods along product pages to match Searchads API version 4.7\n* version 1.6.3 New bug fixes\n* version 1.6.1 added new product page, reporting, and Ad endpoints. Deprecated creatives endpoints\n* version 1.5.3 fixed token update issue\n* version 1.5.3 deprecated creativesets methods from Apple Search Ads API v4\n* version 1.5.2 fixed a bug in token refresh due to wrong status code\n* version 1.5.1 handles API error with Exception\n* version 1.2.1 refresh access_tokn only when needed\n* version 1.1.1 added support for the v4 of the Apple Search Ads API\n* version 0.7.1 fixed some issues with granularity\n* version 0.1.1 Added granularity level reports\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Apple Searchads API non-official python library",
    "version": "1.7.19",
    "project_urls": {
        "Homepage": "https://github.com/phiture/searchads_api"
    },
    "split_keywords": [
        "python",
        " searchads",
        " library",
        " apple"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c778fa5db903ecbfce501086a7a8f22f6d6d26716802bd396cb26aa438b79cf5",
                "md5": "438b2c63a2527c5120ed5a119df265ff",
                "sha256": "d48b5a72c41e2177b9faa9c6d9d88fb617ae8cd3b2bbefaa17a5180719ae5726"
            },
            "downloads": -1,
            "filename": "searchads_api-1.7.19-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "438b2c63a2527c5120ed5a119df265ff",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 16464,
            "upload_time": "2025-01-28T09:21:36",
            "upload_time_iso_8601": "2025-01-28T09:21:36.084439Z",
            "url": "https://files.pythonhosted.org/packages/c7/78/fa5db903ecbfce501086a7a8f22f6d6d26716802bd396cb26aa438b79cf5/searchads_api-1.7.19-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "cd978272691267a6daf8c8c34f4c1d3a4eae32c339844acc0c91d81911b7a8ef",
                "md5": "b73cba2e2a7ac2e27336a68ba5a6bebe",
                "sha256": "6afe075395cb676df84a32a73f5e3c1a4ade11f725ad7b039e3fa3db78d2fb8d"
            },
            "downloads": -1,
            "filename": "searchads_api-1.7.19.tar.gz",
            "has_sig": false,
            "md5_digest": "b73cba2e2a7ac2e27336a68ba5a6bebe",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 20325,
            "upload_time": "2025-01-28T09:21:37",
            "upload_time_iso_8601": "2025-01-28T09:21:37.617124Z",
            "url": "https://files.pythonhosted.org/packages/cd/97/8272691267a6daf8c8c34f4c1d3a4eae32c339844acc0c91d81911b7a8ef/searchads_api-1.7.19.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-28 09:21:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "phiture",
    "github_project": "searchads_api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "requests",
            "specs": []
        },
        {
            "name": "pyjwt",
            "specs": []
        },
        {
            "name": "cryptography",
            "specs": []
        }
    ],
    "lcname": "searchads-api"
}
        
Elapsed time: 4.48381s