@todoforai/tiktok-ads-api
v0.1.0
Published
JSON-first CLI for the TikTok API for Business (Marketing API: campaigns, ad groups, ads, reports, audiences)
Readme
tiktok-ads-api
JSON CLI for the TikTok API for Business (Marketing API v1.3):
campaigns, ad groups, ads (list/create/update/status), integrated reports, custom & lookalike audiences,
creative upload, identities, Spark Ads, pixels and Events API, plus a raw api <METHOD> <path> escape hatch.
Independent; not an official TikTok CLI. Zero dependencies (Node ≥ 20).
printf %s "$TOKEN" | tiktok-ads-api auth --token-stdin # or the /oauth2/access_token/ response JSON
tiktok-ads-api advertiser info
tiktok-ads-api campaigns list --params '{"filtering":{"primary_status":"STATUS_DELIVERY_OK"}}' --all
tiktok-ads-api report get --params '{"report_type":"BASIC","data_level":"AUCTION_CAMPAIGN","dimensions":["campaign_id","stat_time_day"],"metrics":["spend","impressions","clicks"],"start_date":"2026-09-01","end_date":"2026-09-30"}'
tiktok-ads-api campaigns status --json '{"campaign_ids":["…"],"operation_status":"DISABLE"}'advertiser_id is injected from --advertiser, TIKTOK_ADVERTISER_ID or the saved token response.
Every API response is {code, message, data}; the CLI prints data and exits 1 on a non-zero code.
Sandbox: TIKTOK_ADS_SANDBOX=1. Credentials: ~/.config/tiktok-ads-api/credentials.json (0600).
bun test && bun run test:node