Guides

CLI and agents

Use curl, jq, npx cleanfetch-cli, MCP or /skill.md to give an agent public web data without burning its context window on endpoint docs.

Install and authenticate

The CLI is one Node package with no runtime dependencies. It saves the key under your user config and never writes it into the current project.

Install

npx -y cleanfetch-cli auth
# or
export CLEANFETCH_API_KEY=cf_live_...

Check the account

npx -y cleanfetch-cli whoami
npx -y cleanfetch-cli balance

Search before you call

search costs 0 credits and returns operation ids, prices, availability and required params. It is the fastest way to pick an endpoint without reading the full catalog.

Search

npx -y cleanfetch-cli search "youtube transcript"
npx -y cleanfetch-cli search "company jobs" --platform linkedin --limit 5

Call any endpoint

call accepts an operation id or a /v1 path. GET params use --param; JSON bodies use --json and switch the method to POST unless --method says otherwise. --raw prints the upstream text for strict pipes.

GET

npx -y cleanfetch-cli call hackernews/top --param limit=3

POST

npx -y cleanfetch-cli call google-trends/interest \
  --json '{"keywords":["cleanfetch","scraping api"]}'

Pipe with jq

npx -y cleanfetch-cli call hackernews/top --param limit=3 \
  | jq -r '.data.items[].title'

Give an agent the whole catalog

Point the agent at /skill.md when it can make HTTP calls but has no MCP client. Point it at the MCP server when it can hold tools. Both describe the same 0-credit search step and the same billing rules.

Zero-context pattern

Let the agent search with cleanfetch_ask or the CLI search command, then call only the one endpoint it chose. The catalog stays outside the prompt; the agent pays for one request and one response, not for 1,000 endpoint descriptions.

ready