Skills snapchat-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/snapchat-ads-cli" ~/.claude/skills/openclaw-skills-snapchat-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/snapchat-ads-cli" ~/.openclaw/skills/openclaw-skills-snapchat-ads-cli && rm -rf "$T"
skills/bin-huang/snapchat-ads-cli/SKILL.mdSnapchat Ads CLI Skill
You have access to
snapchat-ads-cli, a read-only CLI for the Snapchat Marketing API (v1). Use it to query organizations and ad accounts, pull performance stats with attribution windows, inspect creatives, debug delivery issues, estimate bids and audience sizes, manage AR lenses, and retrieve billing information.
Quick start
# Check if the CLI is available snapchat-ads-cli --help # List organizations snapchat-ads-cli organizations # List ad accounts for an organization snapchat-ads-cli accounts ORG_ID
If the CLI is not installed, install it:
npm install -g snapchat-ads-cli
Authentication
The CLI requires a Snapchat OAuth2 access token. Credentials are resolved in this order:
flag (per-command)--credentials <path>- Environment variable:
SNAPCHAT_ADS_ACCESS_TOKEN - Auto-detected file:
~/.config/snapchat-ads-cli/credentials.json
The credentials file format:
{ "access_token": "YOUR_ACCESS_TOKEN" }
Before running any command, verify credentials are configured by running
snapchat-ads-cli organizations. If it fails with a credentials error, ask the user to set up authentication.
Entity hierarchy
Organization +-- Ad Account +-- Campaign | +-- Ad Squad (= ad group) | +-- Ad -> Creative +-- Creative (managed at ad account level)
Most list commands require the parent entity ID. Start with
organizations to find the org, then accounts <org-id> to find ad accounts, and drill down from there.
Monetary values
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.
Output format
All commands output pretty-printed JSON by default. Use
--format compact for single-line JSON (useful for piping).
Listing commands that support pagination use
--limit <n> to control page size (default 50).
Commands reference
Organization discovery
# List all organizations the user has access to snapchat-ads-cli organizations # Get a specific organization snapchat-ads-cli organization ORG_ID
Note:
organizations does not support --limit pagination. organization fetches a single entity by ID.
Ad accounts
# List ad accounts for an organization snapchat-ads-cli accounts ORG_ID snapchat-ads-cli accounts ORG_ID --limit 100 # Get a specific ad account snapchat-ads-cli account ACCOUNT_ID
Options for
accounts: --limit <n> (default 50)
Funding & billing centers
# List funding sources for an organization snapchat-ads-cli funding-sources ORG_ID snapchat-ads-cli funding-sources ORG_ID --limit 100 # List billing centers for an organization snapchat-ads-cli billing-centers ORG_ID snapchat-ads-cli billing-centers ORG_ID --limit 100
Both support
--limit <n> (default 50).
Campaigns
# List campaigns for an ad account snapchat-ads-cli campaigns ACCOUNT_ID snapchat-ads-cli campaigns ACCOUNT_ID --limit 100 # Get a specific campaign snapchat-ads-cli campaign CAMPAIGN_ID
Options for
campaigns: --limit <n> (default 50)
Ad squads
# List ad squads for a campaign snapchat-ads-cli adsquads CAMPAIGN_ID snapchat-ads-cli adsquads CAMPAIGN_ID --limit 100 # Get a specific ad squad snapchat-ads-cli adsquad ADSQUAD_ID
Options for
adsquads: --limit <n> (default 50)
Ads
# List ads for an ad squad snapchat-ads-cli ads ADSQUAD_ID snapchat-ads-cli ads ADSQUAD_ID --limit 100 # Get a specific ad snapchat-ads-cli ad AD_ID
Options for
ads: --limit <n> (default 50)
Creatives
# List creatives for an ad account snapchat-ads-cli creatives ACCOUNT_ID snapchat-ads-cli creatives ACCOUNT_ID --limit 100 # Get a specific creative snapchat-ads-cli creative CREATIVE_ID
Options for
creatives: --limit <n> (default 50)
Audiences & pixel
# List custom audience segments for an ad account snapchat-ads-cli audiences ACCOUNT_ID snapchat-ads-cli audiences ACCOUNT_ID --limit 100 # Get a specific audience segment snapchat-ads-cli audience SEGMENT_ID # Get the Snap Pixel for an ad account snapchat-ads-cli pixel ACCOUNT_ID
Options for
audiences: --limit <n> (default 50). audience and pixel do not support --limit.
Members & roles
# List members of an organization snapchat-ads-cli members ORG_ID snapchat-ads-cli members ORG_ID --limit 100 # List roles for an organization snapchat-ads-cli roles ORG_ID snapchat-ads-cli roles ORG_ID --limit 100
Both support
--limit <n> (default 50).
Billing
# List invoices for an ad account snapchat-ads-cli invoices ACCOUNT_ID snapchat-ads-cli invoices ACCOUNT_ID --limit 100 # List transactions for an organization snapchat-ads-cli transactions ORG_ID snapchat-ads-cli transactions ORG_ID --limit 100
Both support
--limit <n> (default 50).
Performance stats
Stats commands work on campaigns, ad squads, and ads. All three share the same options.
# Campaign stats (daily granularity) snapchat-ads-cli campaign-stats CAMPAIGN_ID \ --start-time 2026-03-01T00:00:00.000Z \ --end-time 2026-03-15T00:00:00.000Z \ --granularity DAY # Ad squad stats (total granularity, default) snapchat-ads-cli adsquad-stats ADSQUAD_ID \ --start-time 2026-03-01T00:00:00.000Z \ --end-time 2026-03-15T00:00:00.000Z # Ad stats (hourly granularity with attribution windows) snapchat-ads-cli ad-stats AD_ID \ --start-time 2026-03-01T00:00:00.000Z \ --end-time 2026-03-15T00:00:00.000Z \ --granularity HOUR \ --swipe-up-attribution-window 28_DAY \ --view-attribution-window 7_DAY # Campaign stats with specific fields and conversion sources snapchat-ads-cli campaign-stats CAMPAIGN_ID \ --start-time 2026-03-01T00:00:00.000Z \ --end-time 2026-03-15T00:00:00.000Z \ --fields spend,impressions,swipes \ --conversion-source-types web,app
Stats options
| Option | Required | Description | Default |
|---|---|---|---|
| Yes | Start time in ISO 8601 format | -- |
| Yes | End time in ISO 8601 format | -- |
| No | , , or | |
| No | Stat fields to include (comma-separated) | all default fields |
| No | , , | -- |
| No | , , , , , | -- |
| No | Comma-separated: , , | -- |
The CLI passes
--fields values directly to the Snapchat Marketing API without validation. When --fields is omitted, the API returns its default set. Use --fields spend,impressions,swipes to request specific fields. Refer to the Snapchat Measurement API docs for the full list of available fields.
Delivery debugging
# Get delivery status for a campaign snapchat-ads-cli delivery-status campaigns CAMPAIGN_ID # Get delivery status for an ad squad snapchat-ads-cli delivery-status adsquads ADSQUAD_ID # Get delivery status for an ad snapchat-ads-cli delivery-status ads AD_ID
The
entity-type argument must be one of: campaigns, adsquads, ads.
Targeting & insights
# Get targeting insights for an ad account (POST request) snapchat-ads-cli audience-insights ACCOUNT_ID # List custom conversions for a pixel snapchat-ads-cli custom-conversions PIXEL_ID snapchat-ads-cli custom-conversions PIXEL_ID --limit 100
Options for
custom-conversions: --limit <n> (default 50). audience-insights does not support --limit.
Audit logs
# List external changelogs for an entity snapchat-ads-cli audit-logs campaigns CAMPAIGN_ID snapchat-ads-cli audit-logs adsquads ADSQUAD_ID snapchat-ads-cli audit-logs ads AD_ID snapchat-ads-cli audit-logs campaigns CAMPAIGN_ID --limit 100
The
entity-type argument is passed directly to the API path. Common values: organizations, adaccounts, campaigns, adsquads, ads, creatives. Supports --limit <n> (default 50).
Media & lenses
# List media files for an ad account snapchat-ads-cli media ACCOUNT_ID snapchat-ads-cli media ACCOUNT_ID --limit 100 # List AR lenses for an organization snapchat-ads-cli lenses ORG_ID snapchat-ads-cli lenses ORG_ID --limit 100
Both support
--limit <n> (default 50).
Estimates
# Get bid estimate for an ad account snapchat-ads-cli bid-estimate ACCOUNT_ID --optimization-goal IMPRESSIONS # Get estimated audience size for an ad account snapchat-ads-cli audience-size ACCOUNT_ID # Get event quality scores for a pixel snapchat-ads-cli signal-readiness PIXEL_ID # Get ad squad outcome configuration snapchat-ads-cli ad-outcomes ADSQUAD_ID
bid-estimate has one optional option: --optimization-goal <goal> (e.g., IMPRESSIONS, SWIPES, APP_INSTALLS, VIDEO_VIEWS). The other estimate commands have no additional options.
Workflow guidance
When the user asks for a quick overview
- Run
to find accessible organizationssnapchat-ads-cli organizations - Run
to list ad accountssnapchat-ads-cli accounts ORG_ID - Use
with a recent date range for a performance snapshotcampaign-stats - Remember: divide all monetary values by 1,000,000 (micro-currency)
When the user asks for deep analysis
- Start with
atcampaign-stats
for overall performance--granularity TOTAL - Switch to
to spot daily trends--granularity DAY - Drill down with
andadsquad-stats
for underperforming entitiesad-stats - Use
to focus on specific metrics--fields - Add attribution windows (
,--swipe-up-attribution-window
) for conversion analysis--view-attribution-window - Cross-reference with
to review creative contentcreatives
When the user asks about delivery issues
- Run
to check campaign deliverydelivery-status campaigns CAMPAIGN_ID - Drill into
for ad squad level issuesdelivery-status adsquads ADSQUAD_ID - Check
for ad-level problemsdelivery-status ads AD_ID - Review the ad squad and ad configurations with
andadsquadad
When the user asks about audiences
- Use
to list custom audience segmentsaudiences ACCOUNT_ID - Use
for reach estimationaudience-size ACCOUNT_ID - Use
for targeting insightsaudience-insights ACCOUNT_ID - Use
to check pixel setuppixel ACCOUNT_ID - Use
to review custom conversion rulescustom-conversions PIXEL_ID
When the user asks about conversion tracking
- Run
to find the Snap Pixelpixel ACCOUNT_ID - Use
to check event quality scoressignal-readiness PIXEL_ID - Use
to list custom conversion rulescustom-conversions PIXEL_ID - Pull stats with
and attribution windows--conversion-source-types web,app
When the user asks about billing
- Run
to list invoices for an ad accountinvoices ACCOUNT_ID - Run
to list transactions for an organizationtransactions ORG_ID - Run
to check funding sourcesfunding-sources ORG_ID - Run
to list billing centersbilling-centers ORG_ID
Error handling
- Authentication errors -- ask the user to verify their access token; check that
is set,SNAPCHAT_ADS_ACCESS_TOKEN
points to a valid file, or--credentials
exists~/.config/snapchat-ads-cli/credentials.json - Empty results -- check that the parent entity ID is correct and that the entity has children (e.g., the ad account has campaigns)
- Missing stats -- verify the date range covers a period when the entity was active; check that
and--start-time
are in ISO 8601 format--end-time - Delivery status issues -- use
to diagnose why an entity is not servingdelivery-status - Invalid entity-type -- for
usedelivery-status
,campaigns
, oradsquads
; forads
useaudit-logs
,campaigns
,adsquads
, orads
.creatives
All errors are written to stderr as JSON with an
error field and a non-zero exit code:
{"error": "Unauthorized"}