From 5d94baa98cba2d82a3d41bff98ebefb92cb34db6 Mon Sep 17 00:00:00 2001 From: Marco Vinciguerra Date: Mon, 20 Apr 2026 11:49:16 +0200 Subject: [PATCH 1/2] chore: point default API base URL to v2-api.scrapegraphai.com Why: the canonical v2 host for the ScrapeGraph API has moved to v2-api.scrapegraphai.com. Align the SDK default, docs, and test fallback so users hitting the default transparently land on the new host. Co-Authored-By: Claude Opus 4.7 (1M context) --- README.md | 2 +- src/scrapegraphai.ts | 2 +- tests/scrapegraphai.test.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 013846a..f8a52b8 100644 --- a/README.md +++ b/README.md @@ -220,7 +220,7 @@ const health = await sgai.healthy(); | Variable | Description | Default | |----------|-------------|---------| | `SGAI_API_KEY` | Your ScrapeGraphAI API key | — | -| `SGAI_API_URL` | Override API base URL | `https://api.scrapegraphai.com/api/v2` | +| `SGAI_API_URL` | Override API base URL | `https://v2-api.scrapegraphai.com/api/v2` | | `SGAI_DEBUG` | Enable debug logging (`"1"`) | off | | `SGAI_TIMEOUT` | Request timeout in seconds | `120` | diff --git a/src/scrapegraphai.ts b/src/scrapegraphai.ts index 4acf8b9..44694da 100644 --- a/src/scrapegraphai.ts +++ b/src/scrapegraphai.ts @@ -21,7 +21,7 @@ import type { ApiSearchResponse, } from "./types.js"; -const BASE_URL = process.env.SGAI_API_URL || "https://api.scrapegraphai.com/api/v2"; +const BASE_URL = process.env.SGAI_API_URL || "https://v2-api.scrapegraphai.com/api/v2"; function debug(label: string, data?: unknown) { if (!env.debug) return; diff --git a/tests/scrapegraphai.test.ts b/tests/scrapegraphai.test.ts index 6bdde81..b556d3e 100644 --- a/tests/scrapegraphai.test.ts +++ b/tests/scrapegraphai.test.ts @@ -2,7 +2,7 @@ import { afterEach, describe, expect, spyOn, test } from "bun:test"; import * as sdk from "../src/scrapegraphai.js"; const API_KEY = "test-sgai-key"; -const BASE = process.env.SGAI_API_URL || "https://api.scrapegraphai.com/api/v2"; +const BASE = process.env.SGAI_API_URL || "https://v2-api.scrapegraphai.com/api/v2"; function json(body: unknown, status = 200): Response { return new Response(JSON.stringify(body), { From 41d5fa9afa69c3c461ce20a5603dea647ebba1aa Mon Sep 17 00:00:00 2001 From: Marco Vinciguerra Date: Mon, 20 Apr 2026 12:57:32 +0200 Subject: [PATCH 2/2] update of the endpoints --- README.md | 2 +- src/scrapegraphai.ts | 2 +- tests/scrapegraphai.test.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f8a52b8..bee865e 100644 --- a/README.md +++ b/README.md @@ -220,7 +220,7 @@ const health = await sgai.healthy(); | Variable | Description | Default | |----------|-------------|---------| | `SGAI_API_KEY` | Your ScrapeGraphAI API key | — | -| `SGAI_API_URL` | Override API base URL | `https://v2-api.scrapegraphai.com/api/v2` | +| `SGAI_API_URL` | Override API base URL | `https://v2-api.scrapegraphai.com/api` | | `SGAI_DEBUG` | Enable debug logging (`"1"`) | off | | `SGAI_TIMEOUT` | Request timeout in seconds | `120` | diff --git a/src/scrapegraphai.ts b/src/scrapegraphai.ts index 44694da..c636275 100644 --- a/src/scrapegraphai.ts +++ b/src/scrapegraphai.ts @@ -21,7 +21,7 @@ import type { ApiSearchResponse, } from "./types.js"; -const BASE_URL = process.env.SGAI_API_URL || "https://v2-api.scrapegraphai.com/api/v2"; +const BASE_URL = process.env.SGAI_API_URL || "https://v2-api.scrapegraphai.com/api"; function debug(label: string, data?: unknown) { if (!env.debug) return; diff --git a/tests/scrapegraphai.test.ts b/tests/scrapegraphai.test.ts index b556d3e..b8496bd 100644 --- a/tests/scrapegraphai.test.ts +++ b/tests/scrapegraphai.test.ts @@ -2,7 +2,7 @@ import { afterEach, describe, expect, spyOn, test } from "bun:test"; import * as sdk from "../src/scrapegraphai.js"; const API_KEY = "test-sgai-key"; -const BASE = process.env.SGAI_API_URL || "https://v2-api.scrapegraphai.com/api/v2"; +const BASE = process.env.SGAI_API_URL || "https://v2-api.scrapegraphai.com/api"; function json(body: unknown, status = 200): Response { return new Response(JSON.stringify(body), {