LinkedIn Ads CLI & Skills for AI agents (and humans). Pull campaign analytics with pivot breakdowns, forecast ad delivery and budgets, explore targeting facets, retrieve lead form responses, 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/linkedin-ads-cli
Or install manually:
npm install -g linkedin-ads-cli
# Add skills for AI agents (Claude Code, Cursor, Codex, etc.)
npx skills add Bin-Huang/linkedin-ads-cliOr run directly: npx linkedin-ads-cli --help
Built on the official LinkedIn Marketing API, this CLI authenticates via an OAuth2 Bearer token (set as an environment variable, credentials file, or per-command flag) and provides read-only access to LinkedIn's advertising platform.
Core endpoints covered:
- Organizations & accounts -- authenticated user profile, organizations, ad accounts, and account users
- Campaign groups & campaigns -- browse the campaign hierarchy with status filtering
- Creatives -- list and inspect ad creatives with campaign filtering
- Analytics & reporting -- pull performance metrics with date ranges, granularity (daily/monthly), and pivot dimensions
- Audiences & targeting -- matched audiences, audience counts, and available targeting facets
- Conversions & tracking -- conversion rules and Insight Tags
- Lead gen -- lead gen forms and form responses with time-range filtering
- Forecasting -- budget recommendations and ad delivery forecasts
export LINKEDIN_ADS_ACCESS_TOKEN="your_access_token"Create ~/.config/linkedin-ads-cli/credentials.json:
{
"access_token": "your_access_token"
}linkedin-ads-cli accounts --credentials /path/to/creds.jsonLinkedIn requires OAuth2 authentication. You need a LinkedIn Developer Application with Marketing API access. Use the OAuth2 flow to get an access token with the required scopes:
r_ads- Read ad accountsr_ads_reporting- Read ad analyticsr_organization_social- Read organization data
LinkedIn Ads uses this hierarchy:
Organization (Company Page)
└── Ad Account
└── Campaign Group
└── Campaign
└── Creative
Most list commands require the parent entity ID. Start with me to get your profile, then organization-acls to find organizations you manage, then accounts to find ad accounts.
All commands output pretty-printed JSON by default. Use --format compact for single-line JSON.
LinkedIn uses URN format for IDs (e.g., urn:li:sponsoredAccount:123456). This CLI accepts both full URNs and plain numeric IDs.
Get the authenticated user profile.
linkedin-ads-cli meGet an organization (company page) by ID.
linkedin-ads-cli organization 12345678List organizations the authenticated user administers.
linkedin-ads-cli organization-acls
linkedin-ads-cli organization-acls --role ADMINISTRATOROptions:
--count <n>-- results per page (default 100)--start <n>-- start index (default 0)--role <role>-- filter by role: ADMINISTRATOR, DIRECT_SPONSORED_CONTENT_POSTER, etc.
List ad accounts the authenticated user has access to.
linkedin-ads-cli accounts
linkedin-ads-cli accounts --search "My Company"Options:
--page-size <n>-- results per page (default 100)--page-token <token>-- page token for pagination--search <query>-- search by account name or ID
Get a specific ad account.
linkedin-ads-cli account 123456789
linkedin-ads-cli account urn:li:sponsoredAccount:123456789List users with access to an ad account.
linkedin-ads-cli account-users 123456789Options:
--count <n>-- results per page (default 100)--start <n>-- start index (default 0)
List campaign groups for an ad account.
linkedin-ads-cli campaign-groups 123456789Options:
--page-size <n>-- results per page (default 100)--page-token <token>-- page token for pagination
Get a specific campaign group.
linkedin-ads-cli campaign-group 987654321List campaigns for an ad account.
linkedin-ads-cli campaigns 123456789
linkedin-ads-cli campaigns 123456789 --status ACTIVEOptions:
--page-size <n>-- results per page (default 100)--page-token <token>-- page token for pagination--status <status>-- filter by status: ACTIVE, PAUSED, ARCHIVED, COMPLETED, CANCELED, DRAFT--campaign-group <id>-- filter by campaign group ID
Get a specific campaign.
linkedin-ads-cli campaign 111222333List creatives for an ad account.
linkedin-ads-cli creatives 111222333Options:
--page-size <n>-- results per page (default 100)--page-token <token>-- page token for pagination--campaign <campaign-id>-- filter by campaign ID
Get a specific creative.
linkedin-ads-cli creative 444555666List matched audiences (DMP segments) for an ad account.
linkedin-ads-cli audiences 123456789Options:
--count <n>-- results per page (default 100)--start <n>-- start index (default 0)
List conversion rules for an ad account.
linkedin-ads-cli conversion-rules 123456789Options:
--count <n>-- results per page (default 100)--start <n>-- start index (default 0)
List LinkedIn Insight Tags for an ad account.
linkedin-ads-cli insight-tags 123456789Options:
--count <n>-- results per page (default 100)--start <n>-- start index (default 0)
Get ad analytics for an account.
linkedin-ads-cli analytics 123456789 --start-date 2026-01-01 --end-date 2026-01-31
linkedin-ads-cli analytics 123456789 --start-date 2026-01-01 --end-date 2026-01-31 --granularity DAILY --pivot CAMPAIGNOptions:
--start-date <date>-- start date (YYYY-MM-DD) required--end-date <date>-- end date (YYYY-MM-DD) required--granularity <gran>-- time granularity: DAILY, MONTHLY, ALL (default DAILY)--pivot <pivot>-- pivot dimension: CAMPAIGN, CAMPAIGN_GROUP, CREATIVE, ACCOUNT (default CAMPAIGN)--campaign-ids <ids>-- filter by campaign IDs (comma-separated)--campaign-group-ids <ids>-- filter by campaign group IDs (comma-separated)--fields <fields>-- metric fields (comma-separated)
Default metrics: impressions, clicks, costInLocalCurrency, costInUsd, externalWebsiteConversions, likes, comments, shares, follows, videoViews
List Lead Gen forms for an ad account.
linkedin-ads-cli lead-gen-forms 123456789Options:
--count <n>-- results per page (default 100)--start <n>-- start index (default 0)
List lead form responses (submissions) for an ad account.
linkedin-ads-cli lead-form-responses 123456789
linkedin-ads-cli lead-form-responses 123456789 --form 777888999
linkedin-ads-cli lead-form-responses 123456789 --start-time 1709251200000 --end-time 1711929600000Options:
--count <n>-- results per page (default 100)--start <n>-- start index (default 0)--form <form-id>-- filter by form ID--start-time <time>-- filter responses after this time (epoch ms)--end-time <time>-- filter responses before this time (epoch ms)
Get estimated audience size for targeting criteria.
linkedin-ads-cli audience-counts 123456789Get budget recommendations for a campaign.
linkedin-ads-cli budget-recommendations 111222333Get ad delivery forecasts for an account.
linkedin-ads-cli ad-forecasts 123456789List available targeting facets (industries, job titles, locations, etc.).
linkedin-ads-cli targeting-facetsAll errors are JSON to stderr:
{"error": "No credentials found. Set LINKEDIN_ADS_ACCESS_TOKEN env var..."}- google-ads-open-cli -- Google Ads CLI & Skills for AI agents (and humans)
- meta-ads-open-cli -- Meta Ads CLI & Skills for AI agents (and humans)
- microsoft-ads-cli -- Microsoft Ads CLI & Skills for AI agents (and humans)
- amazon-ads-open-cli -- Amazon Ads CLI & Skills for AI agents (and humans)
- tiktok-ads-cli -- TikTok Ads CLI & Skills for AI agents (and humans)
- x-ads-cli -- X Ads CLI & Skills for AI agents (and humans)
- snapchat-ads-cli -- Snapchat Ads CLI & Skills for AI agents (and humans)
- pinterest-ads-cli -- Pinterest Ads CLI & Skills for AI agents (and humans)
- reddit-ads-cli -- Reddit Ads CLI & Skills for AI agents (and humans)
- spotify-ads-cli -- Spotify Ads CLI & Skills for AI agents (and humans)
- apple-ads-cli -- Apple Ads CLI & Skills for AI agents (and humans)
- google-analytics-cli -- Google Analytics CLI & Skills for AI agents (and humans)
- google-search-console-cli -- Google Search Console CLI & Skills for AI agents (and humans)
- youtube-analytics-cli -- YouTube Analytics CLI & Skills for AI agents (and humans)
- x-analytics-cli -- X Analytics CLI & Skills for AI agents (and humans)
- camoufox-cli -- Anti-detect browser CLI & Skills for AI agents
Apache-2.0