scraperapi-clilisted
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