Skip to content

Install

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-js

Option C: Open-source self-hosted library

Install the open-source library plus Playwright for browser rendering:

bash
pip install scrapegraphai
playwright install

This 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

ScenarioOption
Cloud automation, proxy-safe, no LLM key neededA (cloud SDK)
Node/TypeScript projectB
Local dev, bring-your-own LLM, no API costsC (open-source)
Quick one-off or shell scriptingD (REST)