Skills tiktok-ads-cli
git clone https://github.com/openclaw/skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/bin-huang/tiktok-ads-cli" ~/.claude/skills/openclaw-skills-tiktok-ads-cli && rm -rf "$T"
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/bin-huang/tiktok-ads-cli" ~/.openclaw/skills/openclaw-skills-tiktok-ads-cli && rm -rf "$T"
skills/bin-huang/tiktok-ads-cli/SKILL.mdTikTok Ads CLI Skill
You have access to
tiktok-ads-cli, a read-only CLI for the TikTok Marketing API (v1.3). Use it to query advertiser accounts, pull synchronous and async performance reports, inspect ad creatives and assets, manage custom and lookalike audiences, and check pixel tracking.
Quick start
# Check if the CLI is available tiktok-ads-cli --help # Get advertiser account info tiktok-ads-cli advertiser 7000000000000 # List campaigns tiktok-ads-cli campaigns 7000000000000
If the CLI is not installed, install it:
npm install -g tiktok-ads-cli
Authentication
The CLI requires a TikTok OAuth access token. Credentials are resolved in this order:
flag (per-command)--credentials <path>- Environment variable:
(also readsTIKTOK_ADS_ACCESS_TOKEN
andTIKTOK_ADS_APP_ID
if set)TIKTOK_ADS_SECRET - Auto-detected file:
~/.config/tiktok-ads-cli/credentials.json
The credentials JSON file requires only
access_token. The app_id and secret fields are optional:
{ "access_token": "YOUR_ACCESS_TOKEN" }
Before running any command, verify credentials are configured by running
tiktok-ads-cli advertiser <id>. If it fails with a credentials error, ask the user to set up authentication.
Entity hierarchy
Advertiser Account +-- Campaign | +-- Ad Group | +-- Ad -> Creative +-- Custom Audience +-- Lookalike Audience +-- Pixel
Advertiser IDs are numeric strings (e.g.,
7000000000000). Every command that operates on entities within an account takes the advertiser ID as its first positional argument.
Monetary values
The TikTok Marketing API returns monetary values (e.g.,
spend, cpc, cpm) as decimal strings in the major currency unit (e.g., "12.34" means $12.34). No conversion needed.
Output format
All commands output pretty-printed JSON by default. Use
--format compact for single-line JSON (useful for piping).
Listing commands use page-based pagination with
--page and --page-size options. Check the page_info object in the response for total_number, page, and total_page to determine if more pages exist.
Commands reference
Advertiser info
# Get advertiser account details (supports comma-separated IDs for multiple accounts) tiktok-ads-cli advertiser 7000000000000 tiktok-ads-cli advertiser 7000000000000,7000000000001
Campaign hierarchy
# List campaigns tiktok-ads-cli campaigns 7000000000000 tiktok-ads-cli campaigns 7000000000000 --status CAMPAIGN_STATUS_ENABLE tiktok-ads-cli campaigns 7000000000000 --page 2 --page-size 50 # List ad groups tiktok-ads-cli adgroups 7000000000000 tiktok-ads-cli adgroups 7000000000000 --campaign-ids 123,456 tiktok-ads-cli adgroups 7000000000000 --status ADGROUP_STATUS_DELIVERY_OK tiktok-ads-cli adgroups 7000000000000 --campaign-ids 123 --status ADGROUP_STATUS_ENABLE # List ads tiktok-ads-cli ads 7000000000000 tiktok-ads-cli ads 7000000000000 --campaign-ids 123,456 tiktok-ads-cli ads 7000000000000 --adgroup-ids 789 tiktok-ads-cli ads 7000000000000 --status AD_STATUS_DELIVERY_OK tiktok-ads-cli ads 7000000000000 --campaign-ids 123 --adgroup-ids 789 --status AD_STATUS_ENABLE
campaigns options
| Option | Description | Default |
|---|---|---|
| Filter by primary status (e.g., , ) | all |
| Page number | |
| Page size (max 1000) | |
adgroups options
| Option | Description | Default |
|---|---|---|
| Filter by campaign IDs (comma-separated) | all |
| Filter by primary status | all |
| Page number | |
| Page size (max 1000) | |
ads options
| Option | Description | Default |
|---|---|---|
| Filter by campaign IDs (comma-separated) | all |
| Filter by ad group IDs (comma-separated) | all |
| Filter by primary status | all |
| Page number | |
| Page size (max 1000) | |
Synchronous report
The
report command is the primary tool for performance analysis. All options marked required must be provided.
# Campaign-level daily report tiktok-ads-cli report 7000000000000 \ --report-type BASIC \ --data-level AUCTION_CAMPAIGN \ --dimensions campaign_id,stat_time_day \ --metrics spend,impressions,clicks,ctr,cpc \ --start-date 2026-03-01 \ --end-date 2026-03-15 # Ad-level report tiktok-ads-cli report 7000000000000 \ --report-type BASIC \ --data-level AUCTION_AD \ --dimensions ad_id,stat_time_day \ --metrics spend,impressions,clicks,conversion,cost_per_conversion \ --start-date 2026-03-01 \ --end-date 2026-03-15 # With filtering tiktok-ads-cli report 7000000000000 \ --report-type BASIC \ --data-level AUCTION_CAMPAIGN \ --dimensions campaign_id \ --metrics spend,impressions \ --start-date 2026-03-01 \ --end-date 2026-03-15 \ --filters '[{"field_name":"campaign_ids","filter_type":"IN","filter_value":"123,456"}]'
report options
| Option | Required | Description | Default |
|---|---|---|---|
| yes | , , , | -- |
| yes | , , , | -- |
| yes | Comma-separated (e.g., ) | -- |
| yes | Comma-separated (e.g., ) | -- |
| yes | Start date () | -- |
| yes | End date () | -- |
| no | Filtering conditions as JSON string | none |
| no | Page number | |
| no | Page size (max 1000) | |
Common dimensions
Dimensions documented in CLI help text:
ad_id, adgroup_id, campaign_id, stat_time_day, stat_time_hour, country_code
The CLI passes dimension names directly to the TikTok Business API without validation. Audience dimensions (e.g.,
gender, age) are used with --report-type AUDIENCE.
Common metrics
Metrics documented in CLI help text:
spend, impressions, clicks, ctr, cpc, cpm, conversion, cost_per_conversion
The CLI passes metric names directly to the TikTok Business API without validation. Refer to the TikTok Marketing API docs for the full list of available metrics (e.g., video engagement, ROAS, social interaction metrics).
Async report
For large reports, create an async task and check its status later.
# Create async report task tiktok-ads-cli async-report 7000000000000 \ --report-type BASIC \ --dimensions ad_id,stat_time_day \ --start-date 2026-03-01 \ --end-date 2026-03-15 \ --metrics spend,impressions,clicks # Check task status (poll until complete; returns download URL when done) tiktok-ads-cli report-status 7000000000000 task_abc123
async-report options
| Option | Required | Description |
|---|---|---|
| yes | , , |
| yes | Comma-separated dimension names |
| yes | Start date () |
| yes | End date () |
| no | Comma-separated metric names |
Note: The async report always uses
data_level: AUCTION_AD internally.
Audience report
# Audience analysis by gender and age tiktok-ads-cli audience-report 7000000000000 \ --start-date 2026-03-01 \ --end-date 2026-03-15 \ --dimensions gender,age # Audience report filtered by campaigns tiktok-ads-cli audience-report 7000000000000 \ --start-date 2026-03-01 \ --end-date 2026-03-15 \ --dimensions gender,age \ --campaign-ids 123,456
audience-report options
| Option | Required | Description |
|---|---|---|
| yes | Start date () |
| yes | End date () |
| no | Dimensions: , , , , , etc. |
| no | Filter by campaign IDs (comma-separated) |
Creative assets
# List image assets tiktok-ads-cli images 7000000000000 tiktok-ads-cli images 7000000000000 --page 2 --page-size 50 # List video assets tiktok-ads-cli videos 7000000000000 tiktok-ads-cli videos 7000000000000 --page 2 --page-size 50 # List ad creatives (creative details for ads) tiktok-ads-cli ad-creatives 7000000000000 tiktok-ads-cli ad-creatives 7000000000000 --ad-ids 123,456
images / videos options
| Option | Description | Default |
|---|---|---|
| Page number | |
| Page size (max 1000) | |
ad-creatives options
| Option | Description | Default |
|---|---|---|
| Filter by ad IDs (comma-separated) | all |
| Page number | |
| Page size | |
Audiences
# List custom audiences tiktok-ads-cli custom-audiences 7000000000000 tiktok-ads-cli custom-audiences 7000000000000 --page 2 --page-size 50 # List lookalike audiences (a type of custom audience) tiktok-ads-cli lookalike-audiences 7000000000000 tiktok-ads-cli lookalike-audiences 7000000000000 --page 2 --page-size 50
custom-audiences / lookalike-audiences options
| Option | Description | Default |
|---|---|---|
| Page number | |
| Page size | |
Pixels
# List all pixels tiktok-ads-cli pixels 7000000000000 tiktok-ads-cli pixels 7000000000000 --page 2 # Get a specific pixel by code tiktok-ads-cli pixel 7000000000000 PIXEL_CODE_123
pixels options
| Option | Description | Default |
|---|---|---|
| Page number | |
| Page size | |
The
pixel command takes no additional options -- just the advertiser ID and the pixel code.
Workflow guidance
When the user asks for a quick overview
- Run
to see all campaignstiktok-ads-cli campaigns <advertiser-id> - Use
withtiktok-ads-cli report
for a performance snapshot--report-type BASIC --data-level AUCTION_CAMPAIGN - Present the data (report
is already in major currency units, no conversion needed)spend
When the user asks for deep analysis
- Start with a campaign-level report to see overall performance
- Use
to identify top/bottom ad groups--data-level AUCTION_ADGROUP - Drill down with
for underperforming ad groups--data-level AUCTION_AD - Use
withaudience-report
for demographic analysis--dimensions gender,age - Use
for daily trends to spot anomalies--dimensions stat_time_day - Cross-reference with
to review creative contentad-creatives
When the user asks about creative performance
- Run a report with
to get ad-level metrics--data-level AUCTION_AD - Use
to list ads and find their IDsads - Use
to inspect creative detailsad-creatives - Use
andimages
to browse available creative assetsvideos
When the user asks about audience reach
- Use
to see existing custom audiencescustom-audiences - Use
to check lookalike audience setupslookalike-audiences - Use
with demographic dimensions to see who is being reachedaudience-report
When the user asks about conversion tracking
- Run
to list active TikTok Pixelspixels - Use
to get details about a specific pixelpixel - Check the report with
andconversions
metricscost_per_conversion
When the user asks for large date-range reports
- Use
to create an async task (avoids timeout for large datasets)async-report - Use
to poll for completionreport-status - The completed task response will include a download URL
Error handling
- Authentication errors -- ask the user to verify their access token; run
to testtiktok-ads-cli advertiser <id> - "No credentials found" -- ask the user to set up one of:
flag,--credentials
env var, orTIKTOK_ADS_ACCESS_TOKEN~/.config/tiktok-ads-cli/credentials.json - Empty report results -- check the date range, data level, and whether the account had active ads in the period
- API error codes -- the CLI surfaces the TikTok API error message; common issues include invalid advertiser IDs, expired tokens, or insufficient permissions
- Page out of range -- check
in the response to avoid requesting pages beyond the totalpage_info.total_page