Skip to main content

ASA API CLI

PyPI version Python License CI

A command-line interface for managing Apple Search Ads campaigns.

Built on top of asa-api-client.

Installation

Using uv (recommended):

uv tool install asa-api-cli

# Include Excel workbook analysis support (pandas + xlsxwriter)
uv tool install "asa-api-cli[analyze]"

Using pip:

pip install asa-api-cli

# Or with Excel workbook analysis support
pip install "asa-api-cli[analyze]"

Using pipx:

pipx install asa-api-cli

Setup

Set up your Apple Search Ads API credentials:

export ASA_CLIENT_ID="SEARCHADS.your-client-id"
export ASA_TEAM_ID="SEARCHADS.your-team-id"
export ASA_KEY_ID="your-key-id"
export ASA_ORG_ID="123456"
export ASA_PRIVATE_KEY_PATH="/path/to/private-key.pem"

Or use a .env file in your working directory.

Test your credentials:

asa auth test

Commands

Campaigns

# List all enabled campaigns
asa campaigns list

# List all campaigns (including paused)
asa campaigns list --all

# List with 7-day spend data
asa campaigns list --with-spend

# Get a specific campaign
asa campaigns get 123456789

# Output as JSON
asa campaigns list --json

Ad Groups

# List ad groups in a campaign
asa ad-groups list 123456789

Keywords

# List keywords in an ad group
asa keywords list 123456789 987654321

Reports

# Campaign performance report
asa reports campaigns --start 2024-01-01 --end 2024-01-31

# Keyword report
asa reports keywords 123456789 --start 2024-01-01 --end 2024-01-31

# Export to CSV
asa reports campaigns --start 2024-01-01 --end 2024-01-31 --output report.csv

Analysis Workbook & Platform API v1 Smoke Test

# Generate an Excel performance analysis workbook (requires [analyze] extra)
asa analyze --period 30d --output asa-30d.xlsx

# Run a read-only smoke test against the Apple Ads Platform API v1
asa v1-smoke

Brand Campaigns

Create brand protection campaigns for your app:

# Interactive mode (recommended)
asa brand

# With arguments
asa brand "My App Name" -v "My App" -c US -c GB

# All standard countries
asa brand "My App Name" --country all

# Preview without creating
asa brand "My App Name" -c US --dry-run

Campaign Expansion

Expand existing campaigns to new markets:

# Interactive mode
asa optimize expand

# With filters
asa optimize expand --type Generic --match EM

# Preview
asa optimize expand --dry-run

Bid Optimization

Check and fix bid discrepancies:

# Check bids
asa optimize bid-check

# Auto-fix discrepancies
asa optimize bid-check --auto-fix

# With threshold
asa optimize bid-check --threshold 0.05

Shell Completion

Install shell completion for your shell:

# Bash
asa --install-completion bash

# Zsh
asa --install-completion zsh

# Fish
asa --install-completion fish

License

MIT License - Copyright (c) 2025 Peth Pty Ltd

Metadata

Release files for asa-api-cli 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asa-api-cli 0.4.0
File Size Uploaded Provenance Actions
asa_api_cli-0.4.0.tar.gz 177.4 kB With provenance Details for asa_api_cli-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for asa-api-cli 0.4.0
File Interpreter ABI Platform Actions
asa_api_cli-0.4.0-py3-none-any.whl Python 3 none any Details for asa_api_cli-0.4.0-py3-none-any.whl

Total release size: 263.0 kB

Release files / asa_api_cli-0.4.0.tar.gz

Download URL asa_api_cli-0.4.0.tar.gz
Size 177.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e8bb217ce91117e4f84583d6198bf99e8a712170240348ae5922f368760c4044
BLAKE2b-256 checksum
How to use checksums
b62fe5681cc529180fbb88a698ed87aae0a1271b8b9fe3588fbc09a09a6b4838
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Release files / asa_api_cli-0.4.0-py3-none-any.whl

Download URL asa_api_cli-0.4.0-py3-none-any.whl
Size 85.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f8d0f9faa23e4cffa3b11a698637c151214c593fe69863178d864c56f96b53a
BLAKE2b-256 checksum
How to use checksums
126c64491b3367ee4fa672fd2cdda541dd52025619500fbe216acfd07b99a1cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Security for asa-api-cli 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for asa_api_cli-0.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page