Agents
CLI

CLI

The superscraper CLI runs scrapes and extractions from the terminal. Use it in shell scripts, CI pipelines and one-off jobs without writing code.

⚠️

Not published. @superscraper/cli does not exist on npm, and the bare name superscraper on npm is an unrelated third-party package, so neither npm install -g nor npx will get you this CLI.

Every command maps 1:1 to a REST endpoint, so curl against https://api.superscraper.dev does the same work today:

curl -sX POST https://api.superscraper.dev/v1/scrape \
  -H "x-api-key: $SUPERSCRAPER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com"}'

Install

The CLI is not on npm yet. It is available on request: contact support@superscraper.dev. It installs two equivalent commands, superscraper and leadsnap. Examples below use superscraper.

You need a SuperScraper API key. Get one free at app.superscraper.dev (opens in a new tab) or mint one with POST /v1/keys/provision.

Authentication

Auth is resolved in this order:

  1. SUPERSCRAPER_API_KEY environment variable
  2. ~/.leadsnap/config.json written by superscraper init (the config path is still the legacy name in source)

Set the environment variable directly:

export SUPERSCRAPER_API_KEY=ss_live_xxxxxxxxxxxxxxxxxxxx

Or run superscraper init to save credentials to the config file (recommended for interactive use).

Set SUPERSCRAPER_API_URL to point at a self-hosted instance (defaults to https://api.superscraper.dev).

Commands

init

Save your API key and base URL to ~/.leadsnap/config.json. Runs interactively by default; pass flags to skip the prompts.

superscraper init [options]
OptionDescription
--api-key <key>API key (skip the interactive prompt)
--api-url <url>Base URL (default: https://api.superscraper.dev)

Examples:

# Interactive, prompts for key and URL
superscraper init
 
# Non-interactive, write key directly
superscraper init --api-key ss_live_xxxxxxxxxxxxxxxxxxxx

The config file is written with mode 0600 (owner-read-only). An existing key is never echoed back; leave the prompt blank to keep it.


scrape

Scrape a single URL and return its content.

superscraper scrape <url> [options]
OptionDefaultDescription
--format markdown|html|jsonmarkdownOutput format
--force-playwrightfalseUse headless browser (skip plain fetch)
--wait-for <ms>0Extra milliseconds to wait after page load
--json, -jfalseOutput the full raw API response as JSON

Examples:

# Print markdown (default)
superscraper scrape https://northside-roasters.example
 
# Return structured listing JSON
superscraper scrape https://northside-roasters.example --format json
 
# Force headless browser with extra wait, raw API response
superscraper scrape https://react-app.com --force-playwright --wait-for 2000 --json

extract

Extract structured data from a URL. Without --schema, uses the free JSON-LD cascade. With --schema, calls the LLM-powered extraction endpoint.

superscraper extract <url> [options]
OptionDescription
--schema <file.json>Path to a JSON schema file; enables LLM extraction
--json, -jOutput the full raw API response as JSON

Examples:

# Free JSON-LD cascade (no schema required)
superscraper extract https://northside-roasters.example
 
# LLM-powered extraction with a schema file
superscraper extract https://northside-roasters.example --schema ./contact-schema.json

The source also contains pull, connectors and chat commands. They call endpoints that are not part of the public API, so they are not documented here and return 404.

Global options

These flags work on every command:

FlagDescription
--json, -jEmit the raw API response as JSON (machine-readable)
--help, -hShow help
--version, -VPrint version

Environment variables

VariableDescription
SUPERSCRAPER_API_KEYAPI key; overrides ~/.leadsnap/config.json
SUPERSCRAPER_API_URLBase URL; overrides ~/.leadsnap/config.json

Exit codes

CodeMeaning
0Success
1Error (API error, invalid arguments, authentication failure)

Further reading