Appearance
Install
Option A: Cloud SDK (Python) - Recommended for Automa workflows
Install the official Python SDK for the hosted ScrapeGraphAI API:
bash
pip install "scrapegraph-py>=2.1.0"Requirements: Python 3.12 or higher.
Set your API key (obtain from https://scrapegraphai.com/dashboard):
bash
export SGAI_API_KEY="your-api-key-here"Option B: JavaScript / Node SDK
bash
npm install scrapegraph-jsOption C: Open-source self-hosted library
Install the open-source library plus Playwright for browser rendering:
bash
pip install scrapegraphai
playwright installThis version requires you to supply an LLM API key (OpenAI, Anthropic, Groq, Ollama, etc.) in the config. It runs entirely locally and incurs no ScrapeGraphAI API costs.
Option D: REST API (no SDK)
No install required. Call the API directly with curl or any HTTP client:
bash
curl -X POST https://v2-api.scrapegraphai.com/api/extract \
-H "Content-Type: application/json" \
-H "SGAI-APIKEY: $SGAI_API_KEY" \
-d '{"url": "https://example.com", "prompt": "Extract product details"}'Which option to pick
| Scenario | Option |
|---|---|
| Cloud automation, proxy-safe, no LLM key needed | A (cloud SDK) |
| Node/TypeScript project | B |
| Local dev, bring-your-own LLM, no API costs | C (open-source) |
| Quick one-off or shell scripting | D (REST) |