PinClicks keyword volume, top pins and annotations from the terminal, plus rank history and cross-keyword annotation analysis the web app can't do.
Returns JSON for PinClicks Keyword Explorer, Top Pins, Pin Stats, Account Explorer, Rank Tracker, Search Tracker and Link Explorer. A local snapshot store adds rank and account history, cross-keyword annotation frequency (annotations top), domain presence beyond the tracking limit (pins presence) and keyword opportunity scoring.
Learn more at PinClicks.
Created by @ElizabethcStone.
Authentication
PinClicks has no API key. The CLI reuses your logged-in app.pinclicks.com browser session: run auth login --chrome while signed in to PinClicks in Chrome. It imports the Laravel remember-me and session cookies and talks to the site over plain HTTPS, with no browser at runtime. auth login --chrome needs a cookie extractor (pycookiecheat, cookies, or cookie-scoop-cli); without one, export the cookies and run auth login --cookies-file (Playwright storage-state JSON or a raw Cookie header). auth status shows the session. When the session expires, sign in again in Chrome and repeat the login.
Quick Start
# Confirm the binary and config paths before touching your account
pinclicks-pp-cli doctor --dry-run
# Related keywords and Pinterest search volume for a seed
pinclicks-pp-cli keywords search "self care" --agent --select keyword,search_volume
# Top ranking pins with saves, Pin Score and annotations
pinclicks-pp-cli pins "self care" --agent
# Annotations the winners share across keywords
pinclicks-pp-cli annotations top "self care" "self care routine" --agent
# Weekly rank movers from stored snapshots
pinclicks-pp-cli rankings history --since 7d --agent
Unique Features
Pin content intelligence
-
annotations top — See which Pinterest interest annotations the top pins share across several keywords at once.
Reach for this when writing pin titles, descriptions or board copy that must match what Pinterest already rewards.
pinclicks-pp-cli annotations top "self care" "self care routine" --agent
-
pins presence — Find where your own sites appear in any keyword's top pins without using Rank Tracker slots.
Use it to check rankings for keywords that are not tracked in PinClicks.
pinclicks-pp-cli pins presence --domain allrecipes "dinner ideas" --agent
-
annotations gap — List the winning annotations one of your pins (a https://www.pinterest.com/pin/ URL or pin id) is missing for a target keyword.
Use it before rewriting or re-pinning an existing pin.
pinclicks-pp-cli annotations gap 191051209189753405 --keyword "self care" --agent
-
keywords opportunity — Rank candidate keywords by search volume against how strong their current top pins are.
Use it to shortlist keywords for boards and ads instead of picking by volume alone.
pinclicks-pp-cli keywords opportunity "self care" "self care routine" "self care ideas" --agent
-
pins brief — Get a compact profile of what wins for a keyword: annotations, median saves, Pin Score, title lengths, colors, domains and pinners (pin grades are usually not provided by PinClicks and show as unknown).
Use it as the input brief before generating new pins for a keyword.
pinclicks-pp-cli pins brief "self care" --agent
Rank and account history
-
rankings history — See how every tracked keyword moved since last week (each run records a snapshot; movement shows once two or more runs exist).
Use it for weekly rank reviews instead of comparing screenshots.
pinclicks-pp-cli rankings history --since 7d --agent
-
accounts history — See how an account's ranking keywords and top-25 gains and losses changed over time (each run records a snapshot; the first run is the baseline).
Use it for weekly account health checks across several Pinterest accounts.
pinclicks-pp-cli accounts history allrecipes --since 30d --agent
Recipes
Shortlist keywords for a board
pinclicks-pp-cli keywords opportunity "self care" "self care routine" "self care ideas" --agent
Ranks candidates by volume against the strength of their current top pins.
Brief a pin batch
pinclicks-pp-cli pins brief "self care" --agent
Annotations, median saves, title lengths and formats that win for the keyword.
Narrow top pins to what an agent needs
pinclicks-pp-cli pins "self care" --agent --select position,title,total_saves,pin_score,visual_annotation
Cuts the large pin record down to ranking, engagement and annotations.
Audit an existing pin
pinclicks-pp-cli annotations gap 191051209189753405 --keyword "self care" --agent
Lists winning annotations the pin is missing.
Where do my sites rank
pinclicks-pp-cli pins presence --domain allrecipes "dinner ideas" "easy dinner recipes" --agent
Finds your domains in each keyword's top pins without Rank Tracker slots.
Usage
Run pinclicks-pp-cli --help for the full command reference and flag list.
Paths & environment variables
This CLI separates local files into four path kinds:
| Kind | Contents |
|---|
config | User-editable settings such as config.toml and saved profiles |
data | Durable local data: credentials.toml, data.db, cookies, browser-session proof files, and other auth sidecars |
state | Runtime state such as persisted queries, jobs, and teach.log |
cache | Regenerable HTTP/cache files |
Each kind resolves independently. The ladder is:
- Per-kind env var:
PINCLICKS_CONFIG_DIR, PINCLICKS_DATA_DIR, PINCLICKS_STATE_DIR, or PINCLICKS_CACHE_DIR
--home <dir> for this invocation
PINCLICKS_HOME for a flat relocated root
- XDG env vars:
XDG_CONFIG_HOME, XDG_DATA_HOME, XDG_STATE_HOME, XDG_CACHE_HOME
- Platform defaults matching existing installs
For containers and agent sandboxes, prefer a single relocated root:
export PINCLICKS_HOME=/srv/pinclicks
pinclicks-pp-cli doctor
Under PINCLICKS_HOME=/srv/pinclicks, the four dirs resolve to /srv/pinclicks/config, /srv/pinclicks/data, /srv/pinclicks/state, and /srv/pinclicks/cache.
On Windows, set the same variable in PowerShell:
$env:PINCLICKS_HOME = "C:\srv\pinclicks"
pinclicks-pp-cli doctor
Under $env:PINCLICKS_HOME = "C:\srv\pinclicks", the four dirs resolve to C:\srv\pinclicks\config, C:\srv\pinclicks\data, C:\srv\pinclicks\state, and C:\srv\pinclicks\cache.
MCP servers do not receive CLI flags from the host. Put relocation in the host env block:
{
"mcpServers": {
"pinclicks": {
"command": "pinclicks-pp-mcp",
"env": {
"PINCLICKS_HOME": "/srv/pinclicks"
}
}
}
}
Precedence matters in fleets: an ambient per-kind variable such as PINCLICKS_DATA_DIR overrides an explicit --home for that kind. Use PINCLICKS_HOME or the per-kind variables for durable fleet relocation; treat --home as the weaker per-invocation lever.
Relocation is one-way. Unsetting PINCLICKS_HOME does not move files back to platform defaults, and doctor cannot find credentials left under a former root. Move the files manually before unsetting relocation variables.
Existing installs keep working because the platform-default rung matches the legacy layout. On the first auth write, stored secrets leave config.toml and are consolidated into credentials.toml under the data directory. Run pinclicks-pp-cli doctor --fail-on warn to check path and credential-location warnings in automation.
Local data
Reads are saved locally by default: in --data-source auto mode every successful read is also written to the SQLite store (data.db, or data-<hash>.db per credential) in the data directory. GET responses are cached for five minutes under http/ in the cache directory. Credentials live in credentials.toml in the data directory. The learn journal lives under learn/ in the state directory. pinclicks-pp-cli doctor prints the resolved paths, every store file, and the response-cache size.
None of it is encrypted. New files are created owner-only; beyond that the data relies on OS account permissions and full-disk encryption (FileVault, BitLocker, LUKS).
- Erase it:
pinclicks-pp-cli local-data purge lists the store files, response cache, and learn journal it would delete; add --yes to delete them, or --only store|cache|journal to narrow it. Config and credentials are kept.
- Run without a local copy: set
PINCLICKS_NO_LOCAL_DATA=1. Reads go to the API (--data-source live; --data-source local still reads an existing store), the response cache is off (--no-cache), nothing new is written to the store, and sync and workflow archive refuse to run. Set it in an MCP host's env block and every command the server runs inherits it.
- Choose the read source without flags:
PINCLICKS_DATA_SOURCE=auto|live|local sets the --data-source default; an explicit flag wins.
Commands
accounts
Pinterest accounts (Account Explorer)
pinclicks-pp-cli accounts search - Search Pinterest accounts, or list followed accounts when no search is given, with monthly views, reach, followers, pins and boards
pinclicks-pp-cli accounts show - Account detail and keyword ranking performance (ranking keywords, top-25 gained/lost, improved/declined)
keywords
Pinterest keyword research (Keyword Explorer, keyword detail, categories)
pinclicks-pp-cli keywords categories - Top Pinterest interest categories with search volume
pinclicks-pp-cli keywords search - Related keywords with Pinterest monthly search volume for a seed keyword (Keyword Explorer)
pinclicks-pp-cli keywords show - Keyword detail - related interests, ancestor categories, search volume, followers and top pins
links
Pins linking to a domain (Link Explorer)
pinclicks-pp-cli links <search> - Pins that link to a website domain, with Pin Score, saves, repins, reactions and comments
pins
Top ranking pins per keyword (Top Pins)
pinclicks-pp-cli pins <search> - Top ranking Pinterest pins for a keyword with saves, Pin Score, grade and interest annotations
rankings
Tracked keyword rankings (Rank Tracker)
pinclicks-pp-cli rankings - Tracked keywords with current position, change, volume and followers
saved
Saved keywords and saved pins
pinclicks-pp-cli saved keywords - Keywords saved in PinClicks
pinclicks-pp-cli saved pins - Pins saved in PinClicks
searches
Tracked Pinterest search-suggestion changes (Search Tracker)
pinclicks-pp-cli searches - Tracked keywords with dropdown-suggestion and guided-search change status, volume and followers
accounts
pinclicks-pp-cli accounts history - See how an account's ranking keywords and top-25 gains and losses changed over time (each run records a snapshot; the first run is the baseline).
annotations
-
pinclicks-pp-cli annotations top - See which Pinterest interest annotations the top pins share across several keywords at once.
-
pinclicks-pp-cli annotations gap - List the winning annotations one of your pins is missing for a target keyword.
keywords
pinclicks-pp-cli keywords opportunity - Rank candidate keywords by search volume against how strong their current top pins are.
pins
-
pinclicks-pp-cli pins presence - Find where your own sites appear in any keyword's top pins without using Rank Tracker slots.
-
pinclicks-pp-cli pins brief - Get a compact profile of what wins for a keyword: annotations, median saves, Pin Score, title lengths, colors, domains and pinners (pin grades are usually not provided by PinClicks and show as unknown).
rankings
pinclicks-pp-cli rankings history - See how every tracked keyword moved since last week (each run records a snapshot; movement shows once two or more runs exist).
Self-learning loop
This CLI caches per-question discovery so repeat queries skip the walk and structurally similar queries get answered via entity substitution. The loop also self-captures: every invocation is journaled locally, and failed-flag corrections plus fresh teaches surface as candidates on the next recall for confirm/reject judgment. Agents call recall before discovery and fire teach & after answering. See the ## Automatic learning section in SKILL.md for the full protocol.
pinclicks-pp-cli recall <query> - Look up cached resources for a query before running discovery
pinclicks-pp-cli teach - Record a query -> resource mapping (silent on success, safe to background with &)
pinclicks-pp-cli learnings list - Inspect taught rows
pinclicks-pp-cli learnings forget <query> - Undo a teach
pinclicks-pp-cli learnings candidates - List auto-captured candidates awaiting confirm/reject
pinclicks-pp-cli learnings stats - Local loop metrics: recall hit rate, teach-to-reuse, playbook resolution, candidate counts
pinclicks-pp-cli teach-pattern - Install a query/resource template up front
pinclicks-pp-cli teach-lookup - Add an entity mapping (e.g. country code, team alias) for pattern substitution
Pass --no-learn or set PINCLICKS_NO_LEARN=true to disable the loop for deterministic flows.
The local store's schema version stamp is one-way: once this version of pinclicks-pp-cli opens the database, older binaries refuse it with a version error — upgrade the binary rather than downgrading.
Output Formats
# Human-readable table (default in terminal, JSON when piped)
pinclicks-pp-cli accounts search
# JSON for scripting and agents
pinclicks-pp-cli accounts search --json
# Filter to specific fields
pinclicks-pp-cli accounts search --json --select username,monthly_views,monthly_reach
# Dry run — show the request without sending
pinclicks-pp-cli accounts search --dry-run
# Agent mode — JSON + compact + no prompts in one flag
pinclicks-pp-cli accounts search --agent
--csv prefixes a leading ' on cells and header keys that start with =, +, -, @, a tab, or a line break (including fullwidth =+-@) so a spreadsheet does not run them as formulas. Plain signed numbers such as -5 and +2.5e3 are left unchanged.
Agent Usage
This CLI is designed for AI agent consumption:
- Non-interactive - never prompts, every input is a flag
- Pipeable -
--json output to stdout, errors to stderr
- Filterable -
--select <field>[,<field>...] returns only fields you need
- Previewable -
--dry-run shows the request without sending
- Explicit confirmation -
--agent does not imply --yes; pass --yes separately only after the target, arguments, and side effects are clear
- Piped input - write commands can accept structured input when their help lists
--stdin
- Offline-friendly - sync/search commands can use the local SQLite store when available
- Agent-safe by default - no colors or formatting unless
--human-friendly is set
Exit codes: 0 success, 2 usage error, 3 not found, 4 auth error, 5 API error, 7 rate limited, 10 config error.
Health Check
pinclicks-pp-cli doctor
Verifies configuration, credentials, and connectivity to the API.
Configuration
Run pinclicks-pp-cli doctor to see the resolved config, data, state, and cache directories. The platform-default config path is ~/.config/pinclicks-pp-cli/config.toml on macOS/Linux and %USERPROFILE%\.config\pinclicks-pp-cli\config.toml on Windows; --home, PINCLICKS_HOME, and per-kind env vars can relocate it.
Static request headers can be configured under headers; per-command header overrides take precedence.
--ca-cert, PINCLICKS_CA_CERT, or ca_cert adds a PEM CA bundle to the system trust roots. --tls-server-name, PINCLICKS_TLS_SERVER_NAME, or tls_server_name is the name checked against the certificate when the dialed address does not match it. Precedence is flag, then environment, then the config file. A config file other users can change does not supply these settings. Certificate verification failures are not retried.
Troubleshooting
Authentication errors (exit code 4)
- Run
pinclicks-pp-cli doctor to check credentials
Not found errors (exit code 3)
- Check the resource ID is correct
- Run the
list command to see available items
API-specific
- Commands return 'session expired' or redirect to /login — Sign in at app.pinclicks.com in Chrome, then run pinclicks-pp-cli auth login --chrome
- rankings history or accounts history shows no changes — History needs two or more snapshots; run pinclicks-pp-cli rankings history and pinclicks-pp-cli accounts history on a schedule (each run records a snapshot; sync does not)
- Top pins show empty titles or unresolved records — Pins resolve by default; if some still show null saves, rerun pinclicks-pp-cli pins "" a minute later (PinClicks is still fetching them)
Discovery Signals
This CLI was generated with browser-captured traffic analysis.
- Target observed: https://app.pinclicks.com/keyword-explorer
- Capture coverage: 2 API entries from 13 total network entries
- Reachability: browser_clearance_http (82% confidence)
- Protocols: rest_json (75% confidence), html_scrape (55% confidence)
- Auth signals: cookie — cookies: <redacted: pinclicks_session, XSRF-TOKEN, remember_web_*>
- Protection signals: cloudflare (90% confidence)
- Runtime: plain HTTPS with the imported PinClicks session cookie; read-only (the POST /livewire/update traffic is used only for Pin Stats lookups and resolving pin details).
Generated by CLI Printing Press