
Research
Active Supply Chain Attack Compromises @antv Packages on npm
Active npm supply chain attack compromises @antv packages in a fast-moving malicious publish wave tied to Mini Shai-Hulud.
linkedin-ads-cli
Advanced tools
LinkedIn Ads CLI 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.
npm install -g linkedin-ads-cli
Or 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:
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.json
LinkedIn 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 dataLinkedIn 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 me
Get an organization (company page) by ID.
linkedin-ads-cli organization 12345678
List organizations the authenticated user administers.
linkedin-ads-cli organization-acls
linkedin-ads-cli organization-acls --role ADMINISTRATOR
Options:
--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 IDGet a specific ad account.
linkedin-ads-cli account 123456789
linkedin-ads-cli account urn:li:sponsoredAccount:123456789
List users with access to an ad account.
linkedin-ads-cli account-users 123456789
Options:
--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 123456789
Options:
--page-size <n> -- results per page (default 100)--page-token <token> -- page token for paginationGet a specific campaign group.
linkedin-ads-cli campaign-group 987654321
List campaigns for an ad account.
linkedin-ads-cli campaigns 123456789
linkedin-ads-cli campaigns 123456789 --status ACTIVE
Options:
--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 IDGet a specific campaign.
linkedin-ads-cli campaign 111222333
List creatives for an ad account.
linkedin-ads-cli creatives 111222333
Options:
--page-size <n> -- results per page (default 100)--page-token <token> -- page token for pagination--campaign <campaign-id> -- filter by campaign IDGet a specific creative.
linkedin-ads-cli creative 444555666
List matched audiences (DMP segments) for an ad account.
linkedin-ads-cli audiences 123456789
Options:
--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 123456789
Options:
--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 123456789
Options:
--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 CAMPAIGN
Options:
--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 123456789
Options:
--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 1711929600000
Options:
--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 123456789
Get budget recommendations for a campaign.
linkedin-ads-cli budget-recommendations 111222333
Get ad delivery forecasts for an account.
linkedin-ads-cli ad-forecasts 123456789
List available targeting facets (industries, job titles, locations, etc.).
linkedin-ads-cli targeting-facets
All errors are JSON to stderr:
{"error": "No credentials found. Set LINKEDIN_ADS_ACCESS_TOKEN env var..."}
Apache-2.0
FAQs
LinkedIn Ads CLI for AI agents
We found that linkedin-ads-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Active npm supply chain attack compromises @antv packages in a fast-moving malicious publish wave tied to Mini Shai-Hulud.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.