crawl is crawlapi’s standalone CLI. Read a single page, a list of URLs, or a whole same-host site right from your terminal, pipe clean markdown or JSON to stdout, and branch on clear exit codes in scripts or agents.
Install
curl -fsSL https://crawlapi.dev/install.sh | shbrew install crawlapi-dev/tap/crawlapinpm i -g crawlapiirm https://crawlapi.dev/install.ps1 | iexcargo install crawlapi --lockedThe install scripts verify the archive’s SHA-256 checksum before unpacking into ~/.local/bin (Windows: %LOCALAPPDATA%\crawlapi\bin, which the script adds to your PATH). The install scripts, Homebrew, and npm also install the binary as crawlapi in case another crawl binary is already on your PATH. Run crawl doctor to verify your install, key, and API connection.
Sign in
crawl login # approve this machine in your browser; saves a CLI key
crawl login --no-browser # print the approval link instead of opening a browser
crawl login --no-wait --json # non-blocking start/finish for AI agent shells
pbpaste | crawl login --key-stdin # store an existing key from stdin
export CRAWLAPI_API_KEY=ck_... # override with an environment variableCredentials stay out of shell history (crawl accepts keys via browser login, stdin, or CRAWLAPI_API_KEY — never as a flag) and are stored locally in credentials.toml with owner-only permissions. Your active key is never echoed in output, errors, or debug logs.
Read a page
crawl example.com # markdown on stdout
crawl news.ycombinator.com -f json # structured object, tables, JSON-LD, embedded state
crawl news.ycombinator.com --links # page links, one per line
crawl news.ycombinator.com --links --json # compact JSON with links and usage
crawl example.com --json | jq .usage # full API response: data, usage, request_id
crawl example.com -o pages/example.md # write to a file (-o - writes stdout)
crawl example.com -t 60s # custom timeout (1s-60s, default 30s)-f picks markdown (default) or json. --json prints the full API response envelope on both success and failure. Global flags (--json, -q, --no-color) work anywhere on the command line. Single-page -o creates parent folders automatically and writes the file only when the request succeeds. Credit receipts always go to stderr so stdout stays clean for piping.
Read many pages and sites
crawl -i urls.txt -o pages/ # one file per page; rerun to resume
cat urls.txt | crawl -i - --json # one JSON line per page, then a summary
crawl -i urls.txt -o pages/ --max-credits 500 # stop starting pages at 500 credits
crawl site docs.example.com -o docs/ --max-pages 50 --include "/docs/**"Batches pace automatically to your account’s rate and concurrency limits (--concurrency N lowers concurrency). --max-credits N stops starting new pages once N credits are spent.
With -o, each page writes to <host>/<path>.md (or .json) and records progress in .crawl-journal.jsonl. Rerunning skips completed pages and permanent failures, and Ctrl-C preserves everything already fetched. crawl site follows links breadth first on the exact start host and port, up to --max-pages (default 25) and --max-depth (default 2).
Account commands
| Command | What it shows or does |
|---|---|
crawl account |
Credit balance, held credits, rate limits, active key, and key source |
crawl keys list · create --name NAME · revoke <ID_OR_PREFIX> |
Active keys with UTC timestamps; create (--description optional) prints a new key once; revoke takes id or prefix positionally (--yes for scripts) |
crawl usage · crawl requests |
Daily or --by-domain totals; recent requests (--days, default 7, --from/--to, --limit 1-100, default 25) |
crawl billing packs · buy <PACK> · purchases · auto-top-up |
Available credit packs, Stripe checkout link (--no-browser prints URL), purchase history, and auto top-up state |
crawl setup · crawl skill · crawl completions <SHELL> |
Install the CLI skill (--project for repo scope), print MCP commands, or generate bash/zsh/fish/powershell/elvish completions |
crawl doctor · crawl logout |
Verify install, PATH, key, and API connectivity; revoke this machine’s key and remove it |
Exit codes
| Code | Meaning | What to do |
|---|---|---|
0 |
Success | Use the output |
1 |
Unexpected CLI error | Report it |
2 |
Invalid command or local path | Fix the arguments |
3 |
Not signed in, key refused, or account suspended | Run crawl login (or contact support if suspended) |
4 |
Out of credits, or --max-credits reached |
Top up at app.crawlapi.dev/billing, run crawl billing packs, or raise --max-credits |
5 |
Permanent page failure (retryable: false) |
Do not retry |
6 |
Temporary page failure (retryable: true) |
Retry later |
7 |
Network or service error | Retry with backoff |
8 |
Partial batch failure | Rerun to retry remaining pages |
130 |
Interrupted with Ctrl-C | Rerun to resume |
With --json, error.code and error.retryable report the exact failure; see Errors and retries.
Environment
| Variable | Effect |
|---|---|
CRAWLAPI_API_KEY |
API key; takes precedence over the saved crawl login key |
CRAWLAPI_CONFIG_DIR |
Directory containing config.toml and credentials.toml |
CRAWLAPI_LOG |
Debug logs on stderr (for example CRAWLAPI_LOG=debug); keys are never logged |
NO_COLOR · FORCE_COLOR |
Disable color, or force color inside a pipe |
Configuration precedence: CLI flags, environment variables, ./.crawlapi.toml (format, timeout), config.toml, then built-in defaults. Run crawl help environment to see every supported variable.
Use with an agent
Add a short block to your repository’s AGENTS.md or CLAUDE.md when you want coding agents to use crawl in shell commands:
## Reading web pages with crawl
The `crawl` CLI is installed. Never print `CRAWLAPI_API_KEY` or pass keys on the command line.
Use `crawl <url>` for markdown, `-f json` for structured data, and `--json` when parsing fields in scripts.
Always bound multi-page runs with `--max-pages` and `--max-credits`, and check `crawl <cmd> --help` before using unfamiliar flags.Troubleshooting
| Symptom | Fix |
|---|---|
command not found |
Add ~/.local/bin to PATH with the line the install script printed (on Windows, open a new terminal), check command -v crawl, or call crawlapi. |
Exit code 3 on crawl keys or crawl billing |
Those commands require a cli-scoped key from crawl login, not a scrape-scoped dashboard key. |
Cost: unknown after a network drop |
crawl avoids silent double-billing on uncertain drops; check crawl requests before retrying. |
| Credential file refused | Restrict credentials.toml to owner-only permissions (chmod 600). |