当前位置: 首页 > Skill >

Pinterest Ads CLI

Pinterest Ads CLI

Pinterest Ads CLI

通过 pinterest-ads-cli 进行 Pinterest 广告数据分析与报告。适用于查询 Pinterest 广告表现、获取广告系列/广告组/统计数据等场景。

1.0.0 2026.11.08 274
获取Skill文件查看使用说明
作 者:苏禾 许可证: 更新时间:2026.11.08
本文目录展开

Pinterest Ads CLI Skill

You have access to pinterest-ads-cli, a read-only CLI for the Pinterest REST API v5. Use it to query ad accounts, pull performance analytics, inspect campaigns and ads, analyze audiences, browse product catalogs, discover trending search terms, and review billing across Pinterest advertising.

Quick start

# Check if the CLI is available
pinterest-ads-cli --help

# List accessible ad accounts
pinterest-ads-cli accounts

# Get a specific ad account
pinterest-ads-cli account 123456789

If the CLI is not installed, install it:

npm install -g pinterest-ads-cli

Authentication

The CLI requires a Pinterest OAuth2 access token. Most commands need the ads:read scope. Additional scopes may be required for specific commands: catalogs:read for catalog commands, user_accounts:read for trends, and billing:read for billing data. Credentials are resolved in this order:

  1. --credentials <path> flag (per-command)
  2. Environment variable: PINTEREST_ADS_ACCESS_TOKEN
  3. Auto-detected file: ~/.config/pinterest-ads-cli/credentials.json

The credentials JSON file format:

{
  "access_token": "YOUR_ACCESS_TOKEN"
}

Before running any command, verify credentials are configured by running pinterest-ads-cli accounts. If it fails with a credentials error, ask the user to set up authentication.

Entity hierarchy

Ad Account
 +-- Campaign
 |    +-- Ad Group
 |         +-- Ad
 |         +-- Keyword
 +-- Audience
 +-- Customer List
 +-- Conversion Tag
 +-- Billing Profile
 +-- Order Line
 +-- Lead Form

Catalog resources (catalogs, feeds, product groups) are not scoped to an ad account and are accessed at the top level.

Monetary values

Pinterest analytics returns monetary metrics in micro-currency units (1/1,000,000 of the ad account's currency). Fields like SPEND_IN_MICRO_DOLLAR, CPC_IN_MICRO_DOLLAR, and ECPM_IN_MICRO_DOLLAR must be divided by 1,000,000 to get the actual amount. Despite the DOLLAR suffix in field names, values are in the ad account's configured currency (USD, GBP, EUR, etc.).

Example: SPEND_IN_MICRO_DOLLAR: 5000000 means 5.00 in the account's currency.

Output format

All commands output pretty-printed JSON by default. Use --format compact for single-line JSON (useful for piping).

Pagination uses cursor-based --bookmark values returned in the response. Pass the bookmark from a previous response to get the next page.

Commands reference

Account discovery

# List ad accounts
pinterest-ads-cli accounts
pinterest-ads-cli accounts --page-size 50

# Get a specific ad account
pinterest-ads-cli account 123456789

accounts

List ad accounts the user has access to.

Option Description Default
--page-size <n> Results per page (max 250) 25
--bookmark <cursor> Pagination cursor --

account

Get details of a specific ad account. Takes the ad account ID as a required argument.

pinterest-ads-cli account <ad-account-id>

Campaign hierarchy

# List campaigns
pinterest-ads-cli campaigns 123456789
pinterest-ads-cli campaigns 123456789 --entity-statuses ACTIVE,PAUSED
pinterest-ads-cli campaigns 123456789 --order DESCENDING --page-size 100

# List ad groups
pinterest-ads-cli adgroups 123456789
pinterest-ads-cli adgroups 123456789 --campaign-ids campaign_1,campaign_2

# List ads
pinterest-ads-cli ads 123456789
pinterest-ads-cli ads 123456789 --campaign-ids campaign_1 --entity-statuses ACTIVE

campaigns

List campaigns for an ad account.

pinterest-ads-cli campaigns <ad-account-id>
Option Description Default
--campaign-ids <ids> Filter by campaign IDs (comma-separated) --
--entity-statuses <statuses> Filter by status (comma-separated, e.g. ACTIVE,PAUSED) --
--page-size <n> Results per page (max 250) 25
--order <order> Sort order: ASCENDING or DESCENDING --
--bookmark <cursor> Pagination cursor --

adgroups

List ad groups for an ad account.

pinterest-ads-cli adgroups <ad-account-id>
Option Description Default
--campaign-ids <ids> Filter by campaign IDs (comma-separated) --
--ad-group-ids <ids> Filter by ad group IDs (comma-separated) --
--entity-statuses <statuses> Filter by status (comma-separated) --
--page-size <n> Results per page (max 250) 25
--order <order> Sort order: ASCENDING or DESCENDING --
--bookmark <cursor> Pagination cursor --

ads

List ads for an ad account.

pinterest-ads-cli ads <ad-account-id>
Option Description Default
--campaign-ids <ids> Filter by campaign IDs (comma-separated) --
--ad-group-ids <ids> Filter by ad group IDs (comma-separated) --
--ad-ids <ids> Filter by ad IDs (comma-separated) --
--entity-statuses <statuses> Filter by status (comma-separated) --
--page-size <n> Results per page (max 250) 25
--order <order> Sort order: ASCENDING or DESCENDING --
--bookmark <cursor> Pagination cursor --

Keywords

# List keywords for an ad account
pinterest-ads-cli keywords 123456789
pinterest-ads-cli keywords 123456789 --ad-group-id adgroup_1

keywords

List targeting keywords for an ad account.

pinterest-ads-cli keywords <ad-account-id>
Option Description Default
--ad-group-id <id> Filter by ad group ID --
--page-size <n> Results per page (max 250) 25
--bookmark <cursor> Pagination cursor --

Audiences

# List audiences
pinterest-ads-cli audiences 123456789

# List customer lists
pinterest-ads-cli customer-lists 123456789

audiences

List audiences for an ad account.

pinterest-ads-cli audiences <ad-account-id>
Option Description Default
--page-size <n> Results per page (max 250) 25
--order <order> Sort order: ASCENDING or DESCENDING --
--bookmark <cursor> Pagination cursor --

customer-lists

List customer lists for an ad account.

pinterest-ads-cli customer-lists <ad-account-id>
Option Description Default
--page-size <n> Results per page (max 250) 25
--order <order> Sort order: ASCENDING or DESCENDING --
--bookmark <cursor> Pagination cursor --

Conversion tracking

# List all conversion tags
pinterest-ads-cli conversion-tags 123456789

# Get a specific conversion tag
pinterest-ads-cli conversion-tag 123456789 tag_abc

conversion-tags

List conversion tags for an ad account. No pagination options -- returns all tags.

pinterest-ads-cli conversion-tags <ad-account-id>

conversion-tag

Get a specific conversion tag.

pinterest-ads-cli conversion-tag <ad-account-id> <tag-id>

Billing

# List billing profiles
pinterest-ads-cli billing-profiles 123456789
pinterest-ads-cli billing-profiles 123456789 --is-active

# List order lines
pinterest-ads-cli order-lines 123456789

# Get a specific order line
pinterest-ads-cli order-line 123456789 orderline_abc

billing-profiles

List billing profiles for an ad account.

pinterest-ads-cli billing-profiles <ad-account-id>
Option Description Default
--is-active Only return active profiles (boolean flag) false
--page-size <n> Results per page (max 250) 25
--bookmark <cursor> Pagination cursor --

order-lines

List order lines for an ad account.

pinterest-ads-cli order-lines <ad-account-id>
Option Description Default
--page-size <n> Results per page (max 250) 25
--order <order> Sort order: ASCENDING or DESCENDING --
--bookmark <cursor> Pagination cursor --

order-line

Get a specific order line.

pinterest-ads-cli order-line <ad-account-id> <order-line-id>

Lead forms

# List lead forms
pinterest-ads-cli lead-forms 123456789

# Get a specific lead form
pinterest-ads-cli lead-form 123456789 leadform_abc

lead-forms

List lead generation forms for an ad account.

pinterest-ads-cli lead-forms <ad-account-id>
Option Description Default
--page-size <n> Results per page (max 250) 25
--order <order> Sort order: ASCENDING or DESCENDING --
--bookmark <cursor> Pagination cursor --

lead-form

Get a specific lead form.

pinterest-ads-cli lead-form <ad-account-id> <lead-form-id>

Catalogs (Pinterest Shopping)

Catalog commands are not scoped to an ad account.

# List catalogs
pinterest-ads-cli catalogs

# List catalog feeds
pinterest-ads-cli feeds

# List catalog product groups
pinterest-ads-cli product-groups

catalogs

List catalogs.

Option Description Default
--page-size <n> Results per page (max 250) 25
--bookmark <cursor> Pagination cursor --

feeds

List catalog feeds.

Option Description Default
--page-size <n> Results per page (max 250) 25
--bookmark <cursor> Pagination cursor --

product-groups

List catalog product groups.

Option Description Default
--page-size <n> Results per page (max 250) 25
--bookmark <cursor> Pagination cursor --

Trends

Discover trending search terms by region. Does not require an ad account ID.

# Growing trends in the US
pinterest-ads-cli trends US --trend-type growing

# Monthly trends filtered by interest
pinterest-ads-cli trends US --trend-type monthly --interests fashion --limit 20

# Seasonal trends filtered by demographics
pinterest-ads-cli trends GB --trend-type seasonal --genders female --ages 25-34

trends

Get trending search terms for a region.

pinterest-ads-cli trends <region>
Option Description Default
--trend-type <type> Required. Trend type: growing, monthly, yearly, seasonal --
--interests <interests> Filter by interests (comma-separated) --
--genders <genders> Filter by genders (comma-separated) --
--ages <ages> Filter by age groups (comma-separated) --
--limit <n> Number of results 50

Note: the trends command does not support --bookmark pagination. Use --limit to control the number of results.

Analytics

Analytics commands pull performance metrics for ad accounts, campaigns, ad groups, and ads. All analytics commands require --start-date, --end-date, and --columns.

# Account-level analytics
pinterest-ads-cli analytics 123456789 
  --start-date 2026-03-01 
  --end-date 2026-03-15 
  --columns SPEND_IN_MICRO_DOLLAR,IMPRESSION_1,CLICKTHROUGH_1 
  --granularity DAY

# Campaign-level analytics
pinterest-ads-cli campaign-analytics 123456789 
  --campaign-ids campaign_1,campaign_2 
  --start-date 2026-03-01 
  --end-date 2026-03-15 
  --columns SPEND_IN_MICRO_DOLLAR,IMPRESSION_1,CLICKTHROUGH_1

# Ad group-level analytics
pinterest-ads-cli adgroup-analytics 123456789 
  --ad-group-ids adgroup_1 
  --start-date 2026-03-01 
  --end-date 2026-03-15 
  --columns SPEND_IN_MICRO_DOLLAR,IMPRESSION_1

# Ad-level analytics
pinterest-ads-cli ad-analytics 123456789 
  --ad-ids ad_1 
  --start-date 2026-03-01 
  --end-date 2026-03-15 
  --columns SPEND_IN_MICRO_DOLLAR,IMPRESSION_1

analytics

Get ad account-level analytics.

pinterest-ads-cli analytics <ad-account-id>
Option Description Default
--start-date <date> Required. Start date (YYYY-MM-DD) --
--end-date <date> Required. End date (YYYY-MM-DD) --
--columns <cols> Required. Metrics (comma-separated) --
--granularity <gran> TOTAL, DAY, HOUR, WEEK, MONTH DAY
--click-window-days <n> Click attribution window: 0, 1, 7, 14, 30, 60 --
--view-window-days <n> View attribution window: 0, 1, 7, 14, 30, 60 --

campaign-analytics

Get campaign-level analytics.

pinterest-ads-cli campaign-analytics <ad-account-id>
Option Description Default
--campaign-ids <ids> Required. Campaign IDs (comma-separated) --
--start-date <date> Required. Start date (YYYY-MM-DD) --
--end-date <date> Required. End date (YYYY-MM-DD) --
--columns <cols> Required. Metrics (comma-separated) --
--granularity <gran> TOTAL, DAY, HOUR, WEEK, MONTH DAY

adgroup-analytics

Get ad group-level analytics.

pinterest-ads-cli adgroup-analytics <ad-account-id>
Option Description Default
--ad-group-ids <ids> Required. Ad group IDs (comma-separated) --
--start-date <date> Required. Start date (YYYY-MM-DD) --
--end-date <date> Required. End date (YYYY-MM-DD) --
--columns <cols> Required. Metrics (comma-separated) --
--granularity <gran> TOTAL, DAY, HOUR, WEEK, MONTH DAY

ad-analytics

Get ad-level analytics.

pinterest-ads-cli ad-analytics <ad-account-id>
Option Description Default
--ad-ids <ids> Required. Ad IDs (comma-separated) --
--start-date <date> Required. Start date (YYYY-MM-DD) --
--end-date <date> Required. End date (YYYY-MM-DD) --
--columns <cols> Required. Metrics (comma-separated) --
--granularity <gran> TOTAL, DAY, HOUR, WEEK, MONTH DAY

Common analytics columns

Columns documented in README: SPEND_IN_MICRO_DOLLAR, IMPRESSION_1, CLICKTHROUGH_1, CPC_IN_MICRO_DOLLAR, ECPM_IN_MICRO_DOLLAR, CTR, TOTAL_CONVERSIONS

The CLI passes column names directly to the Pinterest API v5 without validation. Refer to the Pinterest Analytics API docs for all available columns (e.g., video metrics, engagement metrics, web conversion metrics). Column names use uppercase with underscores (e.g., VIDEO_MRC_VIEWS_1, TOTAL_ENGAGEMENT). Monetary columns end in _IN_MICRO_DOLLAR -- divide by 1,000,000.

Attribution windows

Only the account-level analytics command supports attribution window options (--click-window-days and --view-window-days). The campaign, ad group, and ad-level analytics commands do not support these options in the CLI (this is a CLI limitation; the Pinterest API supports attribution windows on all analytics endpoints).

Workflow guidance

When the user asks for a quick overview

  1. Run pinterest-ads-cli accounts to find accessible accounts
  2. Use analytics with a recent date range and key columns like SPEND_IN_MICRO_DOLLAR,IMPRESSION_1,CLICKTHROUGH_1,CTR
  3. Remember to divide micro-dollar values by 1,000,000 when presenting to the user

When the user asks for deep analysis

  1. Start with account-level analytics to see overall performance
  2. Use campaigns to list campaigns, then campaign-analytics for campaign-level breakdown
  3. Drill down with adgroup-analytics or ad-analytics for underperforming entities
  4. Use account-level analytics with --click-window-days and --view-window-days to understand attribution
  5. Cross-reference with keywords to review targeting

When the user asks about audience targeting

  1. Use audiences to see existing audiences
  2. Use customer-lists to see customer list audiences
  3. Use keywords with --ad-group-id to see targeting keywords for specific ad groups

When the user asks about conversion tracking

  1. Run conversion-tags to list active conversion tags
  2. Use conversion-tag to get details on a specific tag
  3. Check analytics with TOTAL_CONVERSIONS column to see conversion performance

When the user asks about product catalogs

  1. Use catalogs to list catalogs
  2. Use feeds to inspect catalog feeds
  3. Use product-groups to see product groupings

When the user asks about trends

  1. Use trends with the appropriate region code (e.g., US, GB, CA)
  2. Filter with --trend-type (growing, monthly, yearly, seasonal)
  3. Narrow down with --interests, --genders, or --ages

When the user asks about billing

  1. Use billing-profiles to see billing configurations (add --is-active for active only)
  2. Use order-lines to see order lines
  3. Use order-line with a specific ID for details

Error handling

  • Authentication errors -- ask the user to verify their access token and ads:read scope
  • Credentials not found -- check that one of the three credential sources is configured: --credentials flag, PINTEREST_ADS_ACCESS_TOKEN env var, or ~/.config/pinterest-ads-cli/credentials.json
  • Empty analytics -- check the date range, entity status, and whether the account had active ads in the period
  • Permission errors -- ensure the access token has the required ads:read scope
  • Invalid column names -- verify column names match the Pinterest API schema (e.g., SPEND_IN_MICRO_DOLLAR, not SPEND)

API documentation references

  • pinterest-ads-cli documentation
  • Pinterest API v5 overview
  • Pinterest OAuth authentication
  • Pinterest Analytics API
  • Pinterest Catalogs API
  • Pinterest Trends API

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,018
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,013
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,013
Skill 文件
  • SKILL.md
    • Pinterest Ads CLI Skill
    • Quick start
    • Authentication
    • Entity hierarchy
    • Monetary values
    • Output format
    • Commands reference
      • Account discovery
        • accounts
        • account
      • Campaign hierarchy
        • campaigns
        • adgroups
        • ads
      • Keywords
        • keywords
      • Audiences
        • audiences
        • customer-lists
      • Conversion tracking
        • conversion-tags
        • conversion-tag
      • Billing
        • billing-profiles
        • order-lines
        • order-line
      • Lead forms
        • lead-forms
        • lead-form
      • Catalogs (Pinterest Shopping)
        • catalogs
        • feeds
        • product-groups
      • Trends
        • trends
      • Analytics
        • analytics
        • campaign-analytics
        • adgroup-analytics
        • ad-analytics
        • Common analytics columns
        • Attribution windows
    • Workflow guidance
      • When the user asks for a quick overview
      • When the user asks for deep analysis
      • When the user asks about audience targeting
      • When the user asks about conversion tracking
      • When the user asks about product catalogs
      • When the user asks about trends
      • When the user asks about billing
    • Error handling
    • API documentation references
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期