← ClaudeAtlas

scraperapi-clilisted

Product-usage reference for the official ScraperAPI command-line tool (`sapi`, distributed as `scraperapi-cli`). Use this skill whenever the user wants to scrape, run async jobs, fetch structured data, manage crawls, check account credits, or drive DataPipeline projects from a terminal or shell script — anywhere a one-liner is more convenient than writing SDK code. Trigger on: "scrape this URL from the terminal", "use sapi to fetch X", "ScraperAPI CLI", "ScraperAPI from bash", "sapi scrape", "sapi cost", "sapi jobs", "sapi structured amazon", "pipe ScraperAPI into jq", "shell one-liner to scrape Y", "scrape from a Makefile / cron / CI", "check my ScraperAPI credits from the command line", "submit 10000 URLs as a batch from a file". Covers install, auth resolution order, every top-level command (`scrape`, `cost`, `jobs`, `structured`, `crawler`, `pipeline`, `account`, `config`, `init`), JSON / piping behaviour, pre-flight cost checks, and common shell recipes.
scraperapi/scraperapi-skills · ★ 9 · Data & Documents · score 78
Install: claude install-skill scraperapi/scraperapi-skills
# ScraperAPI CLI (`sapi`) `sapi` is the official ScraperAPI command-line tool. It is the right choice when: - The user is already in a terminal and wants a result *now* without writing a script. - A scrape is part of a shell pipeline (`sapi … | jq …`, `xargs`, `make`, GitHub Actions). - A one-off scheduled task (cron, launchd, systemd timer) needs to hit ScraperAPI without a project setup. - The user is exploring — testing whether `--render` or `--premium` unblocks a target before committing the choice to code. If the user is writing application code in Python, Node, PHP, Ruby, or Java, point them at the matching SDK skill instead — the CLI is for shells, not application logic. ## Install and authenticate ```bash npm install -g scraperapi-cli # requires Node.js 18+ sapi init # interactive: prompts for the key and validates it ``` Non-interactive setup (for CI / Dockerfiles): ```bash sapi init --api-key "$SCRAPERAPI_API_KEY" ``` ### Key resolution order `sapi` looks for the API key in this order, stopping at the first hit: 1. `--api-key <key>` flag on the command 2. `SCRAPERAPI_API_KEY` environment variable 3. `~/.config/scraperapi/config.json` (written by `sapi init`) In CI, prefer the env var — it keeps the key out of shell history and config files. ## Output contract — important for piping | Stream | What goes there | |--------|-----------------| | stdout | The data (page body, JSON, table rows) | | stderr | Spinners, warnings, errors