ScrapeGraphAI Platform Authentication#
The ScrapeGraphAI managed cloud service uses a single platform API key (SGAI_API_KEY) for authentication โ distinct from the LLM provider keys (OpenAI, Groq, etc.) used by the self-hosted open-source library. The README summarises this split clearly: open-source users supply their own LLM keys, while managed API users authenticate with SGAI_API_KEY .
API Key: Where It Comes From#
Platform API keys are generated from the ScrapeGraphAI dashboard. The key is then passed to the scrapegraph-py (Python) or scrapegraph-js (Node.js) SDKs. Official API docs live at docs.scrapegraphai.com.
How the Key Is Used in Code#
The open-source library's compatibility layer and example scripts handle the key as follows:
- Environment variable names (v3 SDK):
SGAI_API_KEYis the primary variable;SCRAPEGRAPH_API_KEYis accepted as a fallback . This applies to all v3 example scripts. - Environment variable names (v2 SDK): Legacy examples use only
SCRAPEGRAPH_API_KEYand pass it toClient(api_key=...). - Compatibility layer:
scrapegraph_py_compat.pyroutes the key to either the v2Clientor the v3ScrapeGraphAIclient depending on which SDK version is installed . All three operations โextract,scrape,searchโ accept an optionalapi_keyargument and forward it directly to the SDK . - Local validation: The library only checks that a non-empty key value is present; cryptographic or remote key validation is done server-side by the ScrapeGraphAI API, not locally .
MCP Endpoint Authentication#
The ScrapeGraphAI MCP server (hosted at https://sgai-mcp-main.onrender.com/mcp, also listed on Smithery) uses the same platform API key for authenticated calls. MCP tool discovery and connection succeed even with an invalid or deprecated key โ authentication is only enforced when a tool (e.g., Credits) actually makes an API call .
Legacy Key Deprecation#
Keys issued on the old/legacy ScrapeGraphAI platform are no longer valid on the new API infrastructure. Attempting to call an authenticated MCP tool with a legacy key returns:
"Invalid or deprecated API key"
Users with legacy keys must log in to the new dashboard and generate a fresh key. As of October 2, 2026, a reported bug causes the new dashboard onboarding flow to crash after the onboarding form, blocking key generation for some affected accounts . Users in this state should contact ScrapeGraphAI support to request account/credit migration.
Quick Reference#
| Item | Detail |
|---|---|
| Primary env var | SGAI_API_KEY |
| Fallback env var (v3) | SCRAPEGRAPH_API_KEY |
| Dashboard | scrapegraphai.com |
| API docs | docs.scrapegraphai.com |
| Python SDK | scrapegraph-py |
| JS/TS SDK | scrapegraph-js |
| MCP server | Smithery listing |
| Legacy key status | Deprecated โ generates "Invalid or deprecated API key" errors |