asa-api-cli 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- asa_api_cli-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +78 -0
- asa_api_cli-0.1.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
- asa_api_cli-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +39 -0
- asa_api_cli-0.1.0/.github/dependabot.yml +24 -0
- asa_api_cli-0.1.0/.github/workflows/ci.yml +46 -0
- asa_api_cli-0.1.0/.github/workflows/publish.yml +29 -0
- asa_api_cli-0.1.0/.gitignore +55 -0
- asa_api_cli-0.1.0/LICENSE +21 -0
- asa_api_cli-0.1.0/PKG-INFO +196 -0
- asa_api_cli-0.1.0/README.md +165 -0
- asa_api_cli-0.1.0/asa_api_cli/__init__.py +15 -0
- asa_api_cli-0.1.0/asa_api_cli/ad_groups.py +270 -0
- asa_api_cli-0.1.0/asa_api_cli/auth.py +186 -0
- asa_api_cli-0.1.0/asa_api_cli/brand.py +809 -0
- asa_api_cli-0.1.0/asa_api_cli/campaigns.py +371 -0
- asa_api_cli-0.1.0/asa_api_cli/keywords.py +514 -0
- asa_api_cli-0.1.0/asa_api_cli/main.py +76 -0
- asa_api_cli-0.1.0/asa_api_cli/optimize.py +961 -0
- asa_api_cli-0.1.0/asa_api_cli/reports.py +440 -0
- asa_api_cli-0.1.0/asa_api_cli/utils.py +503 -0
- asa_api_cli-0.1.0/pyproject.toml +76 -0
- asa_api_cli-0.1.0/tests/__init__.py +1 -0
- asa_api_cli-0.1.0/tests/test_cli.py +39 -0
- asa_api_cli-0.1.0/uv.lock +692 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
name: Bug Report
|
|
2
|
+
description: Report a bug or unexpected behavior
|
|
3
|
+
labels: ["type: bug"]
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
Thanks for taking the time to report a bug! Please fill out the form below.
|
|
9
|
+
|
|
10
|
+
- type: textarea
|
|
11
|
+
id: description
|
|
12
|
+
attributes:
|
|
13
|
+
label: Description
|
|
14
|
+
description: A clear and concise description of what the bug is.
|
|
15
|
+
placeholder: Describe the bug...
|
|
16
|
+
validations:
|
|
17
|
+
required: true
|
|
18
|
+
|
|
19
|
+
- type: input
|
|
20
|
+
id: command
|
|
21
|
+
attributes:
|
|
22
|
+
label: Command
|
|
23
|
+
description: What command were you running?
|
|
24
|
+
placeholder: "asa campaigns list"
|
|
25
|
+
validations:
|
|
26
|
+
required: true
|
|
27
|
+
|
|
28
|
+
- type: textarea
|
|
29
|
+
id: output
|
|
30
|
+
attributes:
|
|
31
|
+
label: Output/Error
|
|
32
|
+
description: The output or error message you received.
|
|
33
|
+
render: shell
|
|
34
|
+
validations:
|
|
35
|
+
required: true
|
|
36
|
+
|
|
37
|
+
- type: textarea
|
|
38
|
+
id: expected
|
|
39
|
+
attributes:
|
|
40
|
+
label: Expected Behavior
|
|
41
|
+
description: What you expected to happen.
|
|
42
|
+
validations:
|
|
43
|
+
required: true
|
|
44
|
+
|
|
45
|
+
- type: input
|
|
46
|
+
id: version
|
|
47
|
+
attributes:
|
|
48
|
+
label: CLI Version
|
|
49
|
+
description: Output of `asa --version`
|
|
50
|
+
placeholder: "search-ads-cli 0.1.0 (search-ads-api 0.1.0)"
|
|
51
|
+
validations:
|
|
52
|
+
required: true
|
|
53
|
+
|
|
54
|
+
- type: input
|
|
55
|
+
id: python-version
|
|
56
|
+
attributes:
|
|
57
|
+
label: Python Version
|
|
58
|
+
description: What version of Python are you using?
|
|
59
|
+
placeholder: "3.13.0"
|
|
60
|
+
validations:
|
|
61
|
+
required: true
|
|
62
|
+
|
|
63
|
+
- type: dropdown
|
|
64
|
+
id: os
|
|
65
|
+
attributes:
|
|
66
|
+
label: Operating System
|
|
67
|
+
options:
|
|
68
|
+
- macOS
|
|
69
|
+
- Linux
|
|
70
|
+
- Windows
|
|
71
|
+
validations:
|
|
72
|
+
required: true
|
|
73
|
+
|
|
74
|
+
- type: textarea
|
|
75
|
+
id: additional
|
|
76
|
+
attributes:
|
|
77
|
+
label: Additional Context
|
|
78
|
+
description: Any other context about the problem.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: Feature Request
|
|
2
|
+
description: Suggest a new feature or enhancement
|
|
3
|
+
labels: ["type: feature"]
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
Thanks for suggesting a feature! Please fill out the form below.
|
|
9
|
+
|
|
10
|
+
- type: textarea
|
|
11
|
+
id: problem
|
|
12
|
+
attributes:
|
|
13
|
+
label: Problem Statement
|
|
14
|
+
description: What problem would this feature solve? Is it related to a frustration?
|
|
15
|
+
placeholder: I'm always frustrated when...
|
|
16
|
+
validations:
|
|
17
|
+
required: true
|
|
18
|
+
|
|
19
|
+
- type: textarea
|
|
20
|
+
id: solution
|
|
21
|
+
attributes:
|
|
22
|
+
label: Proposed Solution
|
|
23
|
+
description: Describe the solution you'd like to see. If it's a new command, show the usage.
|
|
24
|
+
placeholder: |
|
|
25
|
+
asa campaigns archive --older-than 30d
|
|
26
|
+
validations:
|
|
27
|
+
required: true
|
|
28
|
+
|
|
29
|
+
- type: textarea
|
|
30
|
+
id: alternatives
|
|
31
|
+
attributes:
|
|
32
|
+
label: Alternatives Considered
|
|
33
|
+
description: Have you considered any alternative solutions or workarounds?
|
|
34
|
+
|
|
35
|
+
- type: textarea
|
|
36
|
+
id: additional
|
|
37
|
+
attributes:
|
|
38
|
+
label: Additional Context
|
|
39
|
+
description: Any other context, screenshots, or examples.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: "pip"
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: "weekly"
|
|
7
|
+
commit-message:
|
|
8
|
+
prefix: "⬆️"
|
|
9
|
+
labels:
|
|
10
|
+
- "dependencies"
|
|
11
|
+
groups:
|
|
12
|
+
python-packages:
|
|
13
|
+
patterns:
|
|
14
|
+
- "*"
|
|
15
|
+
|
|
16
|
+
- package-ecosystem: "github-actions"
|
|
17
|
+
directory: "/"
|
|
18
|
+
schedule:
|
|
19
|
+
interval: "weekly"
|
|
20
|
+
commit-message:
|
|
21
|
+
prefix: "👷"
|
|
22
|
+
labels:
|
|
23
|
+
- "dependencies"
|
|
24
|
+
- "github-actions"
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.13"]
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v6
|
|
18
|
+
|
|
19
|
+
- name: Install uv
|
|
20
|
+
uses: astral-sh/setup-uv@v7
|
|
21
|
+
with:
|
|
22
|
+
version: "latest"
|
|
23
|
+
|
|
24
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
25
|
+
run: uv python install ${{ matrix.python-version }}
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: uv sync --extra dev
|
|
29
|
+
|
|
30
|
+
- name: Run linting
|
|
31
|
+
run: uv run ruff check .
|
|
32
|
+
|
|
33
|
+
- name: Run formatting check
|
|
34
|
+
run: uv run ruff format --check .
|
|
35
|
+
|
|
36
|
+
- name: Run type checking
|
|
37
|
+
run: uv run mypy asa_api_cli
|
|
38
|
+
|
|
39
|
+
- name: Run tests
|
|
40
|
+
run: uv run pytest --cov=asa_api_cli --cov-report=xml
|
|
41
|
+
|
|
42
|
+
- name: Upload coverage to Codecov
|
|
43
|
+
uses: codecov/codecov-action@v5
|
|
44
|
+
with:
|
|
45
|
+
file: ./coverage.xml
|
|
46
|
+
fail_ci_if_error: false
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
publish:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
environment: pypi
|
|
11
|
+
permissions:
|
|
12
|
+
id-token: write # Required for trusted publishing
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v6
|
|
16
|
+
|
|
17
|
+
- name: Install uv
|
|
18
|
+
uses: astral-sh/setup-uv@v7
|
|
19
|
+
with:
|
|
20
|
+
version: "latest"
|
|
21
|
+
|
|
22
|
+
- name: Set up Python
|
|
23
|
+
run: uv python install 3.13
|
|
24
|
+
|
|
25
|
+
- name: Build package
|
|
26
|
+
run: uv build
|
|
27
|
+
|
|
28
|
+
- name: Publish to PyPI
|
|
29
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
|
|
23
|
+
# Virtual environments
|
|
24
|
+
.venv/
|
|
25
|
+
venv/
|
|
26
|
+
ENV/
|
|
27
|
+
|
|
28
|
+
# IDE
|
|
29
|
+
.idea/
|
|
30
|
+
.vscode/
|
|
31
|
+
*.swp
|
|
32
|
+
*.swo
|
|
33
|
+
|
|
34
|
+
# Testing
|
|
35
|
+
.pytest_cache/
|
|
36
|
+
.coverage
|
|
37
|
+
coverage.xml
|
|
38
|
+
htmlcov/
|
|
39
|
+
.tox/
|
|
40
|
+
.nox/
|
|
41
|
+
|
|
42
|
+
# mypy
|
|
43
|
+
.mypy_cache/
|
|
44
|
+
|
|
45
|
+
# ruff
|
|
46
|
+
.ruff_cache/
|
|
47
|
+
|
|
48
|
+
# Environment
|
|
49
|
+
.env
|
|
50
|
+
.env.local
|
|
51
|
+
*.pem
|
|
52
|
+
|
|
53
|
+
# OS
|
|
54
|
+
.DS_Store
|
|
55
|
+
Thumbs.db
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Peth Pty Ltd
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: asa-api-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Command-line interface for Apple Search Ads campaign management
|
|
5
|
+
Project-URL: Homepage, https://github.com/SamPetherbridge/asa-api-cli
|
|
6
|
+
Project-URL: Repository, https://github.com/SamPetherbridge/asa-api-cli
|
|
7
|
+
Project-URL: Issues, https://github.com/SamPetherbridge/asa-api-cli/issues
|
|
8
|
+
Author-email: Sam Petherbridge <hello@peth.me>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: advertising,apple,campaign-management,cli,search-ads
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Typing :: Typed
|
|
20
|
+
Requires-Python: >=3.13
|
|
21
|
+
Requires-Dist: asa-api-client>=0.1.0
|
|
22
|
+
Requires-Dist: rich>=13.9.0
|
|
23
|
+
Requires-Dist: typer>=0.13.0
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: mypy>=1.13.0; extra == 'dev'
|
|
26
|
+
Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
|
|
27
|
+
Requires-Dist: pytest-cov>=6.0.0; extra == 'dev'
|
|
28
|
+
Requires-Dist: pytest>=8.3.0; extra == 'dev'
|
|
29
|
+
Requires-Dist: ruff>=0.8.0; extra == 'dev'
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
|
|
32
|
+
# ASA API CLI
|
|
33
|
+
|
|
34
|
+
[](https://pypi.org/project/asa-api-cli/)
|
|
35
|
+
[](https://pypi.org/project/asa-api-cli/)
|
|
36
|
+
[](https://github.com/SamPetherbridge/asa-api-cli/blob/main/LICENSE)
|
|
37
|
+
[](https://github.com/SamPetherbridge/asa-api-cli/actions/workflows/ci.yml)
|
|
38
|
+
|
|
39
|
+
A command-line interface for managing Apple Search Ads campaigns.
|
|
40
|
+
|
|
41
|
+
Built on top of [asa-api-client](https://github.com/SamPetherbridge/asa-api-client).
|
|
42
|
+
|
|
43
|
+
## Installation
|
|
44
|
+
|
|
45
|
+
Using [uv](https://docs.astral.sh/uv/) (recommended):
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
uv tool install asa-api-cli
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Using pip:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pip install asa-api-cli
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Using pipx:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
pipx install asa-api-cli
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Setup
|
|
64
|
+
|
|
65
|
+
Set up your Apple Search Ads API credentials:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
export ASA_CLIENT_ID="SEARCHADS.your-client-id"
|
|
69
|
+
export ASA_TEAM_ID="SEARCHADS.your-team-id"
|
|
70
|
+
export ASA_KEY_ID="your-key-id"
|
|
71
|
+
export ASA_ORG_ID="123456"
|
|
72
|
+
export ASA_PRIVATE_KEY_PATH="/path/to/private-key.pem"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Or use a `.env` file in your working directory.
|
|
76
|
+
|
|
77
|
+
Test your credentials:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
asa auth test
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Commands
|
|
84
|
+
|
|
85
|
+
### Campaigns
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# List all enabled campaigns
|
|
89
|
+
asa campaigns list
|
|
90
|
+
|
|
91
|
+
# List all campaigns (including paused)
|
|
92
|
+
asa campaigns list --all
|
|
93
|
+
|
|
94
|
+
# List with 7-day spend data
|
|
95
|
+
asa campaigns list --with-spend
|
|
96
|
+
|
|
97
|
+
# Get a specific campaign
|
|
98
|
+
asa campaigns get 123456789
|
|
99
|
+
|
|
100
|
+
# Output as JSON
|
|
101
|
+
asa campaigns list --json
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Ad Groups
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# List ad groups in a campaign
|
|
108
|
+
asa ad-groups list 123456789
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Keywords
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
# List keywords in an ad group
|
|
115
|
+
asa keywords list 123456789 987654321
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Reports
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# Campaign performance report
|
|
122
|
+
asa reports campaigns --start 2024-01-01 --end 2024-01-31
|
|
123
|
+
|
|
124
|
+
# Keyword report
|
|
125
|
+
asa reports keywords 123456789 --start 2024-01-01 --end 2024-01-31
|
|
126
|
+
|
|
127
|
+
# Export to CSV
|
|
128
|
+
asa reports campaigns --start 2024-01-01 --end 2024-01-31 --output report.csv
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Brand Campaigns
|
|
132
|
+
|
|
133
|
+
Create brand protection campaigns for your app:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
# Interactive mode (recommended)
|
|
137
|
+
asa brand
|
|
138
|
+
|
|
139
|
+
# With arguments
|
|
140
|
+
asa brand "My App Name" -v "My App" -c US -c GB
|
|
141
|
+
|
|
142
|
+
# All standard countries
|
|
143
|
+
asa brand "My App Name" --country all
|
|
144
|
+
|
|
145
|
+
# Preview without creating
|
|
146
|
+
asa brand "My App Name" -c US --dry-run
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Campaign Expansion
|
|
150
|
+
|
|
151
|
+
Expand existing campaigns to new markets:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
# Interactive mode
|
|
155
|
+
asa optimize expand
|
|
156
|
+
|
|
157
|
+
# With filters
|
|
158
|
+
asa optimize expand --type Generic --match EM
|
|
159
|
+
|
|
160
|
+
# Preview
|
|
161
|
+
asa optimize expand --dry-run
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Bid Optimization
|
|
165
|
+
|
|
166
|
+
Check and fix bid discrepancies:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
# Check bids
|
|
170
|
+
asa optimize bid-check
|
|
171
|
+
|
|
172
|
+
# Auto-fix discrepancies
|
|
173
|
+
asa optimize bid-check --auto-fix
|
|
174
|
+
|
|
175
|
+
# With threshold
|
|
176
|
+
asa optimize bid-check --threshold 0.05
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Shell Completion
|
|
180
|
+
|
|
181
|
+
Install shell completion for your shell:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
# Bash
|
|
185
|
+
asa --install-completion bash
|
|
186
|
+
|
|
187
|
+
# Zsh
|
|
188
|
+
asa --install-completion zsh
|
|
189
|
+
|
|
190
|
+
# Fish
|
|
191
|
+
asa --install-completion fish
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## License
|
|
195
|
+
|
|
196
|
+
MIT License - Copyright (c) 2025 Peth Pty Ltd
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# ASA API CLI
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/asa-api-cli/)
|
|
4
|
+
[](https://pypi.org/project/asa-api-cli/)
|
|
5
|
+
[](https://github.com/SamPetherbridge/asa-api-cli/blob/main/LICENSE)
|
|
6
|
+
[](https://github.com/SamPetherbridge/asa-api-cli/actions/workflows/ci.yml)
|
|
7
|
+
|
|
8
|
+
A command-line interface for managing Apple Search Ads campaigns.
|
|
9
|
+
|
|
10
|
+
Built on top of [asa-api-client](https://github.com/SamPetherbridge/asa-api-client).
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
Using [uv](https://docs.astral.sh/uv/) (recommended):
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
uv tool install asa-api-cli
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Using pip:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install asa-api-cli
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Using pipx:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pipx install asa-api-cli
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Setup
|
|
33
|
+
|
|
34
|
+
Set up your Apple Search Ads API credentials:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
export ASA_CLIENT_ID="SEARCHADS.your-client-id"
|
|
38
|
+
export ASA_TEAM_ID="SEARCHADS.your-team-id"
|
|
39
|
+
export ASA_KEY_ID="your-key-id"
|
|
40
|
+
export ASA_ORG_ID="123456"
|
|
41
|
+
export ASA_PRIVATE_KEY_PATH="/path/to/private-key.pem"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Or use a `.env` file in your working directory.
|
|
45
|
+
|
|
46
|
+
Test your credentials:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
asa auth test
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Commands
|
|
53
|
+
|
|
54
|
+
### Campaigns
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# List all enabled campaigns
|
|
58
|
+
asa campaigns list
|
|
59
|
+
|
|
60
|
+
# List all campaigns (including paused)
|
|
61
|
+
asa campaigns list --all
|
|
62
|
+
|
|
63
|
+
# List with 7-day spend data
|
|
64
|
+
asa campaigns list --with-spend
|
|
65
|
+
|
|
66
|
+
# Get a specific campaign
|
|
67
|
+
asa campaigns get 123456789
|
|
68
|
+
|
|
69
|
+
# Output as JSON
|
|
70
|
+
asa campaigns list --json
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Ad Groups
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# List ad groups in a campaign
|
|
77
|
+
asa ad-groups list 123456789
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Keywords
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# List keywords in an ad group
|
|
84
|
+
asa keywords list 123456789 987654321
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Reports
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# Campaign performance report
|
|
91
|
+
asa reports campaigns --start 2024-01-01 --end 2024-01-31
|
|
92
|
+
|
|
93
|
+
# Keyword report
|
|
94
|
+
asa reports keywords 123456789 --start 2024-01-01 --end 2024-01-31
|
|
95
|
+
|
|
96
|
+
# Export to CSV
|
|
97
|
+
asa reports campaigns --start 2024-01-01 --end 2024-01-31 --output report.csv
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Brand Campaigns
|
|
101
|
+
|
|
102
|
+
Create brand protection campaigns for your app:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# Interactive mode (recommended)
|
|
106
|
+
asa brand
|
|
107
|
+
|
|
108
|
+
# With arguments
|
|
109
|
+
asa brand "My App Name" -v "My App" -c US -c GB
|
|
110
|
+
|
|
111
|
+
# All standard countries
|
|
112
|
+
asa brand "My App Name" --country all
|
|
113
|
+
|
|
114
|
+
# Preview without creating
|
|
115
|
+
asa brand "My App Name" -c US --dry-run
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Campaign Expansion
|
|
119
|
+
|
|
120
|
+
Expand existing campaigns to new markets:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
# Interactive mode
|
|
124
|
+
asa optimize expand
|
|
125
|
+
|
|
126
|
+
# With filters
|
|
127
|
+
asa optimize expand --type Generic --match EM
|
|
128
|
+
|
|
129
|
+
# Preview
|
|
130
|
+
asa optimize expand --dry-run
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Bid Optimization
|
|
134
|
+
|
|
135
|
+
Check and fix bid discrepancies:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# Check bids
|
|
139
|
+
asa optimize bid-check
|
|
140
|
+
|
|
141
|
+
# Auto-fix discrepancies
|
|
142
|
+
asa optimize bid-check --auto-fix
|
|
143
|
+
|
|
144
|
+
# With threshold
|
|
145
|
+
asa optimize bid-check --threshold 0.05
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Shell Completion
|
|
149
|
+
|
|
150
|
+
Install shell completion for your shell:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# Bash
|
|
154
|
+
asa --install-completion bash
|
|
155
|
+
|
|
156
|
+
# Zsh
|
|
157
|
+
asa --install-completion zsh
|
|
158
|
+
|
|
159
|
+
# Fish
|
|
160
|
+
asa --install-completion fish
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## License
|
|
164
|
+
|
|
165
|
+
MIT License - Copyright (c) 2025 Peth Pty Ltd
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""Command-line interface for Apple Search Ads.
|
|
2
|
+
|
|
3
|
+
This module provides a CLI for interacting with the Apple Search Ads API.
|
|
4
|
+
|
|
5
|
+
Usage:
|
|
6
|
+
asa --help
|
|
7
|
+
asa campaigns list
|
|
8
|
+
asa reports campaigns --start 2024-01-01 --end 2024-01-31
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from asa_api_cli.main import app
|
|
12
|
+
|
|
13
|
+
__all__ = ["app"]
|
|
14
|
+
|
|
15
|
+
__version__ = "0.1.0"
|