Snapchat Ads CLI for AI agents (and humans). Debug ad delivery issues, estimate audience size and bids, pull stats with attribution windows, manage AR lenses and custom conversions, and more.
Works with: OpenClaw, Claude Code, Cursor, Codex, and any agent that can run shell commands.
Tell your AI agent (e.g. OpenClaw):
Install this CLI and skills from https://github.com/Bin-Huang/snapchat-ads-cli
Or install manually:
npm install -g snapchat-ads-cli # Add skills for AI agents (Claude Code, Cursor, Codex, etc.) npx skills add Bin-Huang/snapchat-ads-cliOr run directly: npx snapchat-ads-cli --help
Built on the official Snapchat Marketing API. Handles OAuth2 Bearer token authentication. Every command outputs structured JSON to stdout, ready for agents to parse without extra processing.
Core endpoints covered:
- Organizations -- list and inspect organizations
- Ad Accounts -- list and inspect ad accounts
- Campaigns -- list and inspect campaigns
- Ad Squads -- list and inspect ad squads (Snapchat's term for ad groups)
- Ads -- list and inspect ads
- Creatives -- list and inspect creatives
- Audiences -- list custom audience segments, Snap Pixels, and custom conversions
- Members & Roles -- organization members and roles
- Billing -- invoices and transactions
- Measurement -- campaign, ad squad, and ad level stats
- Media & Lenses -- media files and AR lenses
- Estimates -- bid estimates, audience size, signal readiness
- Audit Logs -- organization audit trail
- Go to the Snap Developer Portal and sign in.
- Create a new app with the Marketing API enabled.
- Note your Client ID and Client Secret.
Use the Snap OAuth2 flow to get an access token. See Snap Authentication docs.
# 1. Direct user to authorize (open in browser) # https://accounts.snapchat.com/login/oauth2/authorize?client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&response_type=code&scope=snapchat-marketing-api # 2. Exchange code for tokens curl -X POST https://accounts.snapchat.com/login/oauth2/access_token \ -d "grant_type=authorization_code" \ -d "client_id=YOUR_CLIENT_ID" \ -d "client_secret=YOUR_CLIENT_SECRET" \ -d "code=YOUR_AUTH_CODE" \ -d "redirect_uri=YOUR_REDIRECT_URI"# Option A: Default path (recommended) mkdir -p ~/.config/snapchat-ads-cli cat > ~/.config/snapchat-ads-cli/credentials.json << EOF { "access_token": "YOUR_ACCESS_TOKEN" } EOF # Option B: Environment variable export SNAPCHAT_ADS_ACCESS_TOKEN=your_access_token # Option C: Pass per command snapchat-ads-cli --credentials /path/to/credentials.json organizationssnapchat-ads-cli organizations snapchat-ads-cli accounts YOUR_ORG_IDSnapchat Ads uses this hierarchy:
Organization └── Ad Account └── Campaign └── Ad Squad (= ad group) └── Ad └── Creative Most list commands require the parent entity ID. Start with organizations to find your org, then accounts <org-id> to find ad accounts, and so on.
Snapchat uses micro-currency: 1 dollar = 1,000,000 micro. All spend values in stats and budgets are in micro-currency. Divide by 1,000,000 to get the actual dollar amount.
All commands output pretty-printed JSON by default. Use --format compact for compact single-line JSON.
Pagination uses --limit to control page size.
List organizations the user has access to.
snapchat-ads-cli organizationsGet a specific organization.
snapchat-ads-cli organization org_abc123List ad accounts for an organization.
snapchat-ads-cli accounts org_abc123 snapchat-ads-cli accounts org_abc123 --limit 100Options:
--limit <n>-- results per page (default 50)
Get a specific ad account.
snapchat-ads-cli account acc_abc123List funding sources for an organization.
snapchat-ads-cli funding-sources org_abc123Options:
--limit <n>-- results per page (default 50)
List billing centers for an organization.
snapchat-ads-cli billing-centers org_abc123Options:
--limit <n>-- results per page (default 50)
List campaigns for an ad account.
snapchat-ads-cli campaigns acc_abc123Options:
--limit <n>-- results per page (default 50)
Get a specific campaign.
snapchat-ads-cli campaign camp_abc123List ad squads for a campaign.
snapchat-ads-cli adsquads camp_abc123Options:
--limit <n>-- results per page (default 50)
Get a specific ad squad.
snapchat-ads-cli adsquad squad_abc123List ads for an ad squad.
snapchat-ads-cli ads squad_abc123Options:
--limit <n>-- results per page (default 50)
Get a specific ad.
snapchat-ads-cli ad ad_abc123List creatives for an ad account.
snapchat-ads-cli creatives acc_abc123Options:
--limit <n>-- results per page (default 50)
Get a specific creative.
snapchat-ads-cli creative cre_abc123List custom audience segments for an ad account.
snapchat-ads-cli audiences acc_abc123Options:
--limit <n>-- results per page (default 50)
Get a specific audience segment.
snapchat-ads-cli audience seg_abc123Get the Snap Pixel for an ad account.
snapchat-ads-cli pixel acc_abc123List members of an organization.
snapchat-ads-cli members org_abc123Options:
--limit <n>-- results per page (default 50)
List roles for an organization.
snapchat-ads-cli roles org_abc123Options:
--limit <n>-- results per page (default 50)
List invoices for an ad account.
snapchat-ads-cli invoices acc_abc123Options:
--limit <n>-- results per page (default 50)
List transactions for an organization.
snapchat-ads-cli transactions org_abc123Options:
--limit <n>-- results per page (default 50)
Get targeting insights for an ad account.
snapchat-ads-cli audience-insights acc_abc123Get delivery status for a campaign, ad squad, or ad. Useful for debugging why an entity is not serving.
snapchat-ads-cli delivery-status campaigns camp_abc123 snapchat-ads-cli delivery-status adsquads squad_abc123 snapchat-ads-cli delivery-status ads ad_abc123List custom conversions for a pixel.
snapchat-ads-cli custom-conversions pix_abc123Options:
--limit <n>-- results per page (default 50)
List external changelogs for an entity (entity-type: organizations, adaccounts, campaigns, etc.).
snapchat-ads-cli audit-logs organizations org_abc123Options:
--limit <n>-- results per page (default 50)
List media files for an ad account.
snapchat-ads-cli media acc_abc123Options:
--limit <n>-- results per page (default 50)
List AR lenses for an organization.
snapchat-ads-cli lenses org_abc123Options:
--limit <n>-- results per page (default 50)
Get bid estimate for an ad account.
snapchat-ads-cli bid-estimate acc_abc123 --optimization-goal IMPRESSIONSOptions:
--optimization-goal <goal>-- IMPRESSIONS, SWIPES, APP_INSTALLS, VIDEO_VIEWS, etc.
Get estimated audience size for an ad account.
snapchat-ads-cli audience-size acc_abc123Get event quality scores for a pixel.
snapchat-ads-cli signal-readiness pix_abc123Get ad squad outcome configuration.
snapchat-ads-cli ad-outcomes squad_abc123Get stats for a campaign.
snapchat-ads-cli campaign-stats camp_abc123 \ --start-time 2026-03-01T00:00:00.000Z \ --end-time 2026-03-15T00:00:00.000Z \ --granularity DAYOptions:
--start-time <time>-- start time, ISO 8601 (required)--end-time <time>-- end time, ISO 8601 (required)--granularity <gran>-- TOTAL, DAY, HOUR (default TOTAL)--fields <fields>-- stat fields to include (comma-separated)--swipe-up-attribution-window <window>-- attribution window for swipe-ups: 1_DAY, 7_DAY, 28_DAY (how long after a swipe-up to count a conversion)--view-attribution-window <window>-- attribution window for views: 1_HOUR, 3_HOUR, 6_HOUR, 1_DAY, 7_DAY, 28_DAY--conversion-source-types <types>-- conversion source types (comma-separated): web, app, total
Get stats for an ad squad. Same options as campaign-stats.
snapchat-ads-cli adsquad-stats squad_abc123 \ --start-time 2026-03-01T00:00:00.000Z \ --end-time 2026-03-15T00:00:00.000ZGet stats for an ad. Same options as campaign-stats.
snapchat-ads-cli ad-stats ad_abc123 \ --start-time 2026-03-01T00:00:00.000Z \ --end-time 2026-03-15T00:00:00.000Z \ --granularity HOURErrors are written to stderr as JSON with an error field and a non-zero exit code:
{"error": "Unauthorized"}- Ads API Overview: https://developers.snap.com/api/marketing-api/Ads-API
- Authentication: https://developers.snap.com/api/marketing-api/Ads-API/authentication
- Measurement: https://developers.snap.com/api/marketing-api/Ads-API/measurement
- google-ads-open-cli -- Google Ads CLI for AI agents (and humans)
- meta-ads-open-cli -- Meta Ads CLI for AI agents (and humans)
- microsoft-ads-cli -- Microsoft Ads CLI for AI agents (and humans)
- amazon-ads-open-cli -- Amazon Ads CLI for AI agents (and humans)
- tiktok-ads-cli -- TikTok Ads CLI for AI agents (and humans)
- linkedin-ads-cli -- LinkedIn Ads CLI for AI agents (and humans)
- x-ads-cli -- X Ads CLI for AI agents (and humans)
- pinterest-ads-cli -- Pinterest Ads CLI for AI agents (and humans)
- reddit-ads-cli -- Reddit Ads CLI for AI agents (and humans)
- spotify-ads-cli -- Spotify Ads CLI for AI agents (and humans)
- apple-ads-cli -- Apple Ads CLI for AI agents (and humans)
- google-analytics-cli -- Google Analytics CLI for AI agents (and humans)
- google-search-console-cli -- Google Search Console CLI for AI agents (and humans)
- youtube-analytics-cli -- YouTube Analytics CLI for AI agents (and humans)
- x-analytics-cli -- X Analytics CLI for AI agents (and humans)
- camoufox-cli -- Anti-detect browser CLI for AI agents
Apache-2.0