Skip to main content
just-scrape is the official command-line interface for ScrapeGraphAI. It gives you AI-powered web scraping, data extraction, search, and crawling directly from your terminal.

Installation

npm install -g just-scrape
Package: just-scrape on npm | GitHub

Setting up your API key

The CLI needs a ScrapeGraphAI API key. Get one from the dashboard. The CLI checks for it in this order:
  1. Environment variableexport SGAI_API_KEY="sgai-..."
  2. .env fileSGAI_API_KEY=sgai-... in the project root
  3. Config file~/.scrapegraphai/config.json
  4. Interactive prompt — the CLI will ask and save it automatically
The easiest approach for a new machine is to just run any command — the CLI will prompt you for the key and save it to ~/.scrapegraphai/config.json so you never need to set it again.

Environment variables

VariableDescriptionDefault
SGAI_API_KEYScrapeGraphAI API key
JUST_SCRAPE_API_URLOverride the API base URLhttps://api.scrapegraphai.com/v1
JUST_SCRAPE_TIMEOUT_SRequest/polling timeout in seconds120
JUST_SCRAPE_DEBUGSet to 1 to enable debug logging to stderr0

Verify your setup

Run a quick health check to confirm the key is valid:
just-scrape validate
Check your credit balance:
just-scrape credits

Your first scrape

just-scrape smart-scraper https://news.ycombinator.com \
  -p "Extract the top 5 story titles and their URLs"
See the full CLI reference for all commands and options.