Live Google, News, Scholar, Maps and Bing results, plus rank checks, SERP diffs and cited research briefs.
Nine Serply search verticals as typed commands and MCP tools, with per-country proxies and device emulation on each. On top, rank finds a domain's position for a query, serp diff reports what moved since the last run, and research merges web, news and scholar results into one cited brief.
Created by @googio (googio).
Contributors: @tmchow (Trevin Chow).
Quick Start
# Check the install and config without spending credits
serply-pp-cli doctor --dry-run
# A first Google web search
serply-pp-cli web --q "model context protocol" --num 5
# Recent coverage from one Google News edition
serply-pp-cli news --q "model context protocol" --ceid US:en
# Where a domain ranks for a query
serply-pp-cli rank github.com --q "open source cli"
# A cited brief across web, news and scholar
serply-pp-cli research "retrieval augmented generation evaluation" --num 5
Unique Features
These capabilities aren't available in any other tool for this API.
SEO checks
-
rank — See the position of a domain for a query, optionally from a specific country, in one call.
Reach for this instead of a raw web search when the task is where a site ranks, not what the results are.
serply-pp-cli rank github.com --q "open source cli" --x-proxy-location US --agent
-
serp diff — See which URLs entered, left, or moved in a results page since the last time you ran the same query.
Use it for recurring monitoring of a query; the first run stores a baseline and later runs report only what changed.
serply-pp-cli serp diff --q "best static site generator" --agent
Agent research
-
research — Get one deduplicated, numbered source list for a topic from web, news and scholar results at once.
Reach for this when an answer needs sources of more than one kind, such as current coverage plus papers.
serply-pp-cli research "retrieval augmented generation evaluation" --num 5 --agent
Recipes
Narrow a web search to links
serply-pp-cli web --q "site:serply.io docs" --num 5 --agent --select results.title,results.link
Keeps agent context small by returning only titles and links.
Rank from another country
serply-pp-cli rank serply.io --q "serp api" --x-proxy-location GB
Runs the search through a UK proxy and reports the first matching position.
Watch a results page
serply-pp-cli serp diff --q "best static site generator"
First run stores a baseline; later runs list entered, left and moved URLs.
Papers plus coverage
serply-pp-cli research "small language models" --num 5
One brief with numbered sources from web, news and scholar.
Usage
Run serply-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:
SERPLY_CONFIG_DIR, SERPLY_DATA_DIR, SERPLY_STATE_DIR, or SERPLY_CACHE_DIR
--home <dir> for this invocation
SERPLY_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 SERPLY_HOME=/srv/serply
serply-pp-cli doctor
Under SERPLY_HOME=/srv/serply, the four dirs resolve to /srv/serply/config, /srv/serply/data, /srv/serply/state, and /srv/serply/cache.
MCP servers do not receive CLI flags from the host. Put relocation in the host env block:
{
"mcpServers": {
"serply": {
"command": "serply-pp-mcp",
"env": {
"SERPLY_HOME": "/srv/serply"
}
}
}
}
Precedence matters in fleets: an ambient per-kind variable such as SERPLY_DATA_DIR overrides an explicit --home for that kind. Use SERPLY_HOME or the per-kind variables for durable fleet relocation; treat --home as the weaker per-invocation lever.
Relocation is one-way. Unsetting SERPLY_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 serply-pp-cli doctor --fail-on warn to check path and credential-location warnings in automation.
Commands
bing
Manage bing
serply-pp-cli bing - Search Bing and return organic results.
images
Manage images
serply-pp-cli images - Search Google Images.
job_search
Manage job search
serply-pp-cli job-search - Search job listings indexed by Google Jobs.
maps
Manage maps
serply-pp-cli maps <query> - Search Google Maps for places. The query is a path segment.
news
Manage news
serply-pp-cli news - Search Google News and return recent articles.
products
Manage products
serply-pp-cli products - Search Amazon products with price, rating and review count.
scholar
Manage scholar
serply-pp-cli scholar - Search Google Scholar for papers, authors and citations.
videos
Manage videos
serply-pp-cli videos - Search Google Videos.
web
Manage web
serply-pp-cli web - Search Google and return organic results with title, link and description.
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.
serply-pp-cli recall <query> - Look up cached resources for a query before running discovery
serply-pp-cli teach - Record a query -> resource mapping (silent on success, safe to background with &)
serply-pp-cli learnings list - Inspect taught rows
serply-pp-cli learnings forget <query> - Undo a teach
serply-pp-cli learnings candidates - List auto-captured candidates awaiting confirm/reject
serply-pp-cli learnings stats - Local loop metrics: recall hit rate, teach-to-reuse, playbook resolution, candidate counts
serply-pp-cli teach-pattern - Install a query/resource template up front
serply-pp-cli teach-lookup - Add an entity mapping (e.g. country code, team alias) for pattern substitution
Pass --no-learn or set SERPLY_NO_LEARN=true to disable the loop for deterministic flows.
The local store's schema version stamp is one-way: once this version of serply-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)
serply-pp-cli bing --q "model context protocol"
# JSON for scripting and agents
serply-pp-cli bing --q "model context protocol" --json
# Filter to specific fields
serply-pp-cli bing --q "model context protocol" --json --select description,link,realPosition
# Dry run — show the request without sending
serply-pp-cli bing --q "model context protocol" --dry-run
# Agent mode — JSON + compact + no prompts in one flag
serply-pp-cli bing --q "model context protocol" --agent
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
- Read-only by default - this CLI does not create, update, delete, publish, send, or mutate remote resources
- 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
serply-pp-cli doctor
Verifies configuration, credentials, and connectivity to the API.
Configuration
Run serply-pp-cli doctor to see the resolved config, data, state, and cache directories. The platform-default config path is ~/.config/serply-pp-cli/config.toml; --home, SERPLY_HOME, and per-kind env vars can relocate it.
Static request headers can be configured under headers; per-command header overrides take precedence.
Environment variables:
| Name | Kind | Required | Description |
|---|
SERPLY_API_KEY | per_call | Yes | Set to your API credential. |
agentcookie (optional)
If you use agentcookie to sync secrets across machines, this CLI auto-adopts agentcookie-managed credentials with no extra setup. When the daemon writes to this CLI's config, serply-pp-cli doctor reports agentcookie: detected and auth-status labels the source as agentcookie. Skip this section if you don't use agentcookie - the CLI works the same as any other.
Troubleshooting
Authentication errors (exit code 4)
- Run
serply-pp-cli doctor to check credentials
- Verify the environment variable is set without printing it:
test -n "$SERPLY_API_KEY" && echo set
Not found errors (exit code 3)
- Check the command path; run
serply-pp-cli --help for the list of verticals
API-specific
- 401 or 403 on every call — export SERPLY_API_KEY=, then run serply-pp-cli doctor
- Out of credits error — Top up at https://serply.io; cached repeat queries stay free
- Results look like the wrong country — Pass --x-proxy-location GB (or another two-letter code) and --gl gb
Sources & Inspiration
This CLI was built by studying these projects and resources:
Generated by CLI Printing Press