Standalone CLI for ASO workflows that rely on unofficial Apple endpoints.
go build -o /tmp/aads-aso ./cmd/aads-asoFetch App Store autocomplete suggestions via MZSearchHints (no Apple Ads login required).
/tmp/aads-aso hints \
--countries US,GB \
--query "plant id" \
--limit 10 \
--output tableFetch keyword popularity (usually 1-100) from Apple Ads web APIs.
/tmp/aads-aso popscore \
--countries US \
--app-url "https://apps.apple.com/us/app/your-app/id1234567890" \
--keywords "plant identifier,plant app" \
--cookie-file "$HOME/.aads/app_ads_cookie.txt" \
--output tableFetch related keyword recommendations from Apple Ads web APIs.
/tmp/aads-aso recommend \
--countries US \
--bundle-id "com.example.app" \
--text "plant identifier" \
--limit 25 \
--min-popularity 20 \
--cookie-file "$HOME/.aads/app_ads_cookie.txt" \
--output jsonFor popscore and recommend, you can still pass --adam-id, but it is no longer required if you provide one of:
--app-url(extractsadam-iddirectly from App Store URL)--bundle-id(resolves via iTunes Lookup API)--app-name(resolves via iTunes Search API)
Optional:
--adam-countryto control the country used for lookup/search (defaults to first--countriesvalue).- If no
adam-idinput is provided, the CLI auto-selects an ownedadam-idfrom your authenticated Apple Ads campaigns. - If a provided
adam-idis not owned by your Apple Ads account (NO_USER_OWNED_APPS_FOUND_CODE), the CLI auto-falls back to an ownedadam-idand retries once.
Interactive helper that opens a real browser and exports a cookie header for app-ads.apple.com.
/tmp/aads-aso cm-cookie \
--out "$HOME/.aads/app_ads_cookie.txt" \
--headedpopscoreandrecommendrequire an authenticated Apple Ads session cookie.--cookie-filedefaults to~/.aads/app_ads_cookie.txt.
You can automate cookie collection with Playwright (CLI or MCP), either via cm-cookie or by leaving --auto-cookie=true on popscore/recommend.
- Command opens a real browser using Playwright.
- You must complete Apple Ads login and 2FA manually (this is not bypassed).
- If keyword calls keep returning auth/refresh errors, go to an existing ad group and open Add Keywords once, then retry cookie capture.
- Return to terminal and press Enter when prompted to export cookies.
Example:
/tmp/aads-aso cm-cookie --out "$HOME/.aads/app_ads_cookie.txt" --headedYou can also capture cookies manually from your logged-in Apple Ads browser session.
- Open DevTools Network tab on
app-ads.apple.com. - Find a request to
/cm/api/v2/keywords/popularitiesor/cm/api/v2/keywords/recommendation. - Copy the
Cookieheader value (header value only, not theCookie:prefix). - Save it to
~/.aads/app_ads_cookie.txtor pass it with--cookie.
Notes:
- The CLI automatically maps
XSRF-TOKEN-CMcookie toX-XSRF-TOKEN-CMheader when present. - Use
--header "Name: value"for any extra headers your session requires. NO_USER_OWNED_APPS_FOUND_CODEmeans authentication worked, but the selected app is not owned/accessible by the logged-in Apple Ads account.
Global flag:
--output json|table|yamlDefault output format is json.
Automated:
go test ./...Current status: package builds and tests run, but there are no _test.go files yet.
Smoke tests:
go build -o /tmp/aads-aso ./cmd/aads-aso
/tmp/aads-aso --help
/tmp/aads-aso cm-cookie --help
/tmp/aads-aso hints --countries US --query "plant" --limit 5 --output tableFor popscore and recommend, run with a valid cookie file (or keep --auto-cookie=true to refresh interactively).
All endpoints used by this CLI are unofficial and may change or break without notice.