Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.scrapegraphai.com/llms.txt

Use this file to discover all available pages before exploring further.

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
SGAI_API_URLOverride the API base URLhttps://api.scrapegraphai.com/api/v2
SGAI_TIMEOUTRequest timeout in seconds120
SGAI_DEBUGSet to 1 to log requests/responses
Legacy variables are still bridged transparently: JUST_SCRAPE_API_URLSGAI_API_URL, JUST_SCRAPE_TIMEOUT_S / SGAI_TIMEOUT_SSGAI_TIMEOUT, JUST_SCRAPE_DEBUGSGAI_DEBUG.

Verify your setup

Check your credit balance to confirm the key is valid:
just-scrape credits

Your first scrape

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