Apple Ads Campaign Management API v5 to Platform API Migration Kit
Apple deprecated the Apple Ads Campaign Management API (v5) and sunsets it on 26 January 2027. The Apple Ads Platform API replaces it, and it's a new API, not a version bump. The base URL changes. X-AP-Context moves from orgId to adAccountId. Nested resources become top-level. Every find + Selector call becomes a query + QueryRequest. The response envelope, error shape, report requests and report responses all change.
This kit maps your existing integration onto the new API, so you aren't reverse-engineering two doc sets under deadline.
What's inside:
- ENDPOINT-MAP.md and asa_migrate.lookup_endpoint(): all 73 v5 endpoints mapped to their Platform API equivalents. Each row notes path parameters that became filters, method changes and body changes, and flags the 4 endpoints with no direct equivalent.
- - selector_to_query(): translates old Selectors into QueryRequests. It renames operators (STARTSWITH to STARTS_WITH, ASCENDING to ASC), renames fields (adamId to promotedObjectId, servingStatus to systemStatus) and maps pagination. It checks every filter field and operator against Apple's per-endpoint filterable-field tables, and refuses what it can't map safely.
- - report_request_to_platform(): turns old ReportingRequests into the new report body. The campaignId path parameter becomes the required filter, returnGrandTotals becomes includeRows GRAND_TOTAL, and Apple's granularity, groupBy and time-zone rules are checked.
- - PlatformClient: a small standard-library client. It sets the adAccountId context header, pages through query results, follows Apple's RateLimit/Retry-After rules, masks tokens in errors, and refuses paths that could send the token to another host.
- - asa_scan.py: a read-only scanner that finds v5 URLs, orgId headers, Selector bodies, legacy field names, legacy report fields and old response parsing. CI exit codes. Never prints line contents.
- - FIELD-MAP.md (Campaign, AdGroup, Keyword, envelopes, reports), MIGRATION-GUIDE.md with before/after Python, CHECKLIST.md and 32 tests.
Who it's for: agencies, app marketers and adtech/data teams with scripts, ETL jobs or internal tools on the v5 API.
Honest limits: it doesn't convert entity objects field-by-field, because the models changed too much for that to be safe; FIELD-MAP.md lists the renames instead. It doesn't sign the ES256 client-secret JWT (Apple's official client libraries handle OAuth). Built from Apple's documentation as of 5 December 2026: check Apple's docs before going live.
Independent product. Not affiliated with Apple.