asc-apple-ads
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseasc Apple Ads
asc Apple Ads
Use this skill when a task involves Apple Ads or .
asc ads当任务涉及Apple Ads或时使用此技能。
asc adsGround Rules
基本规则
- Run or the specific subgroup help before scripting a command.
asc ads --help - Apple Ads auth is separate from App Store Connect auth. does not configure
asc auth login.asc ads - Use JSON output for automation: .
--output json - Most commands need an org ID. Prefer for one-off commands and
--orgfor a scoped session.ASC_ADS_ORG_ID - Never guess payload fields. Use Apple Ads request JSON in a file and pass it with .
--file - Do not mutate a live account until the user has named the org and approved the resource type. Prefer read-only checks first.
- 在编写命令脚本前,运行或特定子组的帮助命令。
asc ads --help - Apple Ads认证与App Store Connect认证是相互独立的。不会配置
asc auth login。asc ads - 自动化场景下使用JSON输出:。
--output json - 大多数命令需要组织ID。一次性命令优先使用参数,限定范围的会话优先使用环境变量
--org。ASC_ADS_ORG_ID - 切勿猜测请求体字段。使用文件中的Apple Ads请求JSON,并通过参数传入。
--file - 在用户指定组织并确认资源类型之前,不要修改正式账户。优先执行只读检查。
Auth
认证
Stored profile:
bash
asc ads auth login \
--name "Marketing" \
--client-id "$ASC_ADS_CLIENT_ID" \
--team-id "$ASC_ADS_TEAM_ID" \
--key-id "$ASC_ADS_KEY_ID" \
--private-key "$ASC_ADS_PRIVATE_KEY_PATH" \
--org "$ASC_ADS_ORG_ID" \
--networkEnvironment auth:
bash
export ASC_ADS_CLIENT_ID="SEARCHADS_CLIENT_ID"
export ASC_ADS_TEAM_ID="SEARCHADS_TEAM_ID"
export ASC_ADS_KEY_ID="KEY_ID"
export ASC_ADS_PRIVATE_KEY_PATH="$HOME/.asc/apple-ads-private-key.pem"
export ASC_ADS_ORG_ID="123456"Short-lived token auth:
bash
export ASC_ADS_ACCESS_TOKEN="ACCESS_TOKEN"
export ASC_ADS_ORG_ID="123456"Useful checks:
bash
asc ads auth status --validate --output json
asc ads auth doctor --output json
asc ads me view --output json
asc ads acls --output json存储配置文件:
bash
asc ads auth login \
--name "Marketing" \
--client-id "$ASC_ADS_CLIENT_ID" \
--team-id "$ASC_ADS_TEAM_ID" \
--key-id "$ASC_ADS_KEY_ID" \
--private-key "$ASC_ADS_PRIVATE_KEY_PATH" \
--org "$ASC_ADS_ORG_ID" \
--network环境变量认证:
bash
export ASC_ADS_CLIENT_ID="SEARCHADS_CLIENT_ID"
export ASC_ADS_TEAM_ID="SEARCHADS_TEAM_ID"
export ASC_ADS_KEY_ID="KEY_ID"
export ASC_ADS_PRIVATE_KEY_PATH="$HOME/.asc/apple-ads-private-key.pem"
export ASC_ADS_ORG_ID="123456"短期令牌认证:
bash
export ASC_ADS_ACCESS_TOKEN="ACCESS_TOKEN"
export ASC_ADS_ORG_ID="123456"实用检查命令:
bash
asc ads auth status --validate --output json
asc ads auth doctor --output json
asc ads me view --output json
asc ads acls --output jsonOrg Resolution
组织ID解析
When the org ID is unknown:
bash
asc ads acls --output jsonUse the returned org ID:
bash
asc ads campaigns --org "123456" --limit 10 --output jsonOrg precedence is , , stored profile , then config .
--orgASC_ADS_ORG_IDorg_idads.org_id当组织ID未知时:
bash
asc ads acls --output json使用返回的组织ID:
bash
asc ads campaigns --org "123456" --limit 10 --output json组织ID的优先级为:参数 > 环境变量 > 存储配置文件中的 > 配置文件中的。
--orgASC_ADS_ORG_IDorg_idads.org_idRead Workflows
只读工作流
Campaigns and ad groups:
bash
asc ads campaigns --org "123456" --limit 100 --output json
asc ads campaigns --org "123456" --paginate --output json
asc ads campaigns view --org "123456" --campaign 987654321 --output json
asc ads ad-groups list --org "123456" --campaign 987654321 --output jsonDiscovery:
bash
asc ads apps search --org "123456" --query "My App" --limit 10 --output json
asc ads product-pages list --org "123456" --adam-id 1234567890 --states VISIBLE --output json
asc ads creatives list --org "123456" --limit 100 --output json
asc ads geo search --org "123456" --query "San Francisco" --country-code US --limit 10 --output jsonReports:
bash
asc ads reports campaigns --org "123456" --file reporting-request.json --output json
asc ads reports keywords --org "123456" --campaign 987654321 --file reporting-request.json --output jsonReporting and find endpoints keep pagination in the JSON body.
广告系列与广告组:
bash
asc ads campaigns --org "123456" --limit 100 --output json
asc ads campaigns --org "123456" --paginate --output json
asc ads campaigns view --org "123456" --campaign 987654321 --output json
asc ads ad-groups list --org "123456" --campaign 987654321 --output json资源发现:
bash
asc ads apps search --org "123456" --query "My App" --limit 10 --output json
asc ads product-pages list --org "123456" --adam-id 1234567890 --states VISIBLE --output json
asc ads creatives list --org "123456" --limit 100 --output json
asc ads geo search --org "123456" --query "San Francisco" --country-code US --limit 10 --output json报告:
bash
asc ads reports campaigns --org "123456" --file reporting-request.json --output json
asc ads reports keywords --org "123456" --campaign 987654321 --file reporting-request.json --output json报告和查询接口的分页信息会保留在JSON响应体中。
Mutating Workflows
修改类工作流
Create and update commands take Apple Ads JSON files:
bash
asc ads campaigns create --org "123456" --file campaign.json --output json
asc ads campaigns update --org "123456" --campaign 987654321 --file campaign-update.json --output json
asc ads ad-groups create --org "123456" --campaign 987654321 --file ad-group.json --output jsonBulk endpoints often require arrays:
bash
asc ads targeting-keywords create-bulk \
--org "123456" \
--campaign 987654321 \
--ad-group 123456789 \
--file keywords.json \
--output jsonDelete commands require :
--confirmbash
asc ads targeting-keywords delete-bulk \
--org "123456" \
--campaign 987654321 \
--ad-group 123456789 \
--file keyword-ids.json \
--confirm \
--output json
asc ads campaigns delete --org "123456" --campaign 987654321 --confirmFor live tests, create paused resources with names such as . Clean up only the parent campaign or ad group created for that test. Apple may reject direct deletion for default product page creative ads, but deleting the test parent campaign or ad group can clean up the test resource.
ASC CLI Live Test <timestamp>创建和更新命令需要传入Apple Ads JSON文件:
bash
asc ads campaigns create --org "123456" --file campaign.json --output json
asc ads campaigns update --org "123456" --campaign 987654321 --file campaign-update.json --output json
asc ads ad-groups create --org "123456" --campaign 987654321 --file ad-group.json --output json批量接口通常需要传入数组:
bash
asc ads targeting-keywords create-bulk \
--org "123456" \
--campaign 987654321 \
--ad-group 123456789 \
--file keywords.json \
--output json删除命令需要参数:
--confirmbash
asc ads targeting-keywords delete-bulk \
--org "123456" \
--campaign 987654321 \
--ad-group 123456789 \
--file keyword-ids.json \
--confirm \
--output json
asc ads campaigns delete --org "123456" --campaign 987654321 --confirm进行实时测试时,创建名称类似的暂停状态资源。仅清理为该测试创建的父广告系列或广告组。对于默认产品页面创意广告,Apple可能会拒绝直接删除,但删除测试用的父广告系列或广告组可以清理测试资源。
ASC CLI Live Test <timestamp>Raw API
原始API
Use raw requests when Apple adds a field before the first-class command surface changes:
bash
asc ads api request \
--method POST \
--path v5/campaigns/find \
--org "123456" \
--file selector.json \
--output jsonRaw requests accept only Apple Ads v5 paths or URLs. still requires .
https://api.searchads.apple.com/api/v5/...DELETE--confirm当Apple在正式命令支持之前新增字段时,可以使用原始请求:
bash
asc ads api request \
--method POST \
--path v5/campaigns/find \
--org "123456" \
--file selector.json \
--output json原始请求仅支持Apple Ads v5路径或格式的URL。请求仍需要参数。
https://api.searchads.apple.com/api/v5/...DELETE--confirmLive Test Checklist
实时测试检查清单
- Start with and
asc ads me view --output json.asc ads acls --output json - Print the target org ID before mutations.
- Create paused or future-dated resources.
- Use a unique test name.
- Save created IDs from JSON output.
- Delete only the test parent campaign or ad group created during the run.
- Run a final campaigns find/list query to confirm cleanup.
- 先运行和
asc ads me view --output json。asc ads acls --output json - 在执行修改操作前,打印目标组织ID。
- 创建暂停状态或未来生效的资源。
- 使用唯一的测试名称。
- 从JSON输出中保存创建的资源ID。
- 仅删除本次运行中创建的测试用父广告系列或广告组。
- 最后运行广告系列查询/列表命令,确认清理完成。