MeshioMeshio
News

Apple official clients for ASA

Apple's Official Python Client for Search Ads: Automate App Store Advertising in Minutes

Vladyslav Havrulash
Vladyslav HavrulashAug 24, 2026
Apple official clients for ASA

Apple is expanding its lineup of official SDKs for its advertising platform — developers now have a ready-made client for Python too. Official support used to be mostly limited to the Swift/Java ecosystem, so Python developers had to either build their own wrapper around the REST API or rely on third-party libraries. That gap is now closed at the source.

Repository: apple/apple-ads-platform-api-python

What This Library Is

apple-ads-platform-api-python is Apple's official client for the Apple Ads Platform API, which powers Apple Search Ads (ASA). The library takes care of the boilerplate — building the client, handling authentication and token exchange, serializing requests and responses — so you can jump straight into your actual business logic.

With it, you can:

  • manage campaigns (create, update, search by status and filters);
  • work with ad groups;
  • manage keywords and their bids;
  • fetch brand and business account data;
  • build reporting queries for campaign analytics.

In short, it's the foundation for any ASA automation — dynamic bid management, bulk campaign creation, or syncing data into internal dashboards and BI systems.

Requirements

The library targets a modern stack: it requires Python 3.12 or newer. If you're on an older codebase, factor that in before integrating.

Installation

Via pip:

bash
pip install apple-ads-platform==VERSION

Or via Poetry — add the dependency to your pyproject.toml:

toml
dependencies = ["apple-ads-platform==VERSION"]

Replace VERSION with the current release from the repository's releases page.

Authentication: Three Approaches

The Apple ASA API uses OAuth2, and the library offers three ways to get authenticated.

1. Private Key (Recommended)

The most common approach for server-side integrations — authenticating with a private key tied to your API client in Apple Search Ads:

python
api = AppleAdsClientBuilder.from_private_key(
    client_id, team_id, key_id, private_key
).build()

2. Fixed Client Secret

If you already have a client secret on hand (for example, generated and stored in a secrets manager):

python
provider = FixedClientSecretProvider(client_secret)
api = AppleAdsClientBuilder.from_client_secret_provider(
    client_id, provider
).build()

3. Custom OAuth Implementation

For more advanced setups — say, when tokens are issued and rotated by a centralized service — you can implement your own AccessTokenProvider and take full control over how tokens are fetched and refreshed.

Note: your private key and client secret are sensitive credentials. Never store them as plain text in code or in a repository — use environment variables or a secrets manager (Vault, AWS Secrets Manager, etc.) instead.

Making Your First API Calls

List Active Campaigns

python
running_campaigns = QueryRequest(
    filters=[QueryFilter(
        field="systemStatus",
        operator=QueryFilterOperator.EQUALS,
        value=CampaignSystemStatus.RUNNING,
    )]
)
response = api.campaigns_query_post(context_header, request)

Fetch Brand Data

python
response = api.get_brand(context_header, brand_id)

Update a Keyword Bid

python
update = KeywordUpdate(bid=Money(amount="1.00", currency="USD"))
response = api.keywords_id_put(keyword_id, context_header, update)

As you can see, the API follows a familiar REST-style pattern: request objects (QueryRequest, KeywordUpdate), filters, and typed data models (Money, CampaignSystemStatus) — all of which make IDE autocomplete and static type checking much easier.

Fine-Tuning the Client

The library gives you fine-grained control over network behavior:

Parameter Purpose
api_timeout timeout for API requests (defaults to 5 seconds)
auth_timeout timeout for authentication requests
api_log_level logging verbosity (BASIC, HEADERS, BODY)
api_proxy / auth_proxy separate proxy settings for API and authentication traffic

This is especially useful in production environments with corporate proxies or strict logging requirements — for instance, when body-level logging is prohibited due to sensitive or payment-related data.

Thread Safety

When authenticating with a private key, the client is thread-safe. That means most applications only need to create a single client instance and reuse it throughout the app — no need to spin up a new client per request or per thread.

License

The project is released under the MIT License and depends on a number of third-party components (listed in the repository's ACKNOWLEDGEMENTS file), so it's worth checking license compatibility before using it in production.

Why It Matters for Marketers and Developers

For teams actively running Apple Search Ads, this official Python SDK closes a common pain point: integrations with the ASA API previously had to be built from scratch on top of raw REST calls, or relied on unofficial wrappers that could lag behind API changes. Now you get:

  • Official support from Apple — faster response to API changes, fewer surprises on updates;
  • Typed models — fewer bugs caught at development time instead of runtime;
  • Built-in authentication — no need to implement the OAuth2 flow yourself;
  • Flexible network configuration — easy to fit into corporate infrastructure.

This opens the door to faster internal tooling: automatic bid rebalancing based on ROAS, bulk campaign creation for new markets, or syncing ASA data into BI systems and dashboards without manual report exports.

Useful Links

Comments

Log in to join the discussion