diff --git a/README.md b/README.md index 013846a..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://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 4acf8b9..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://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 6bdde81..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://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), {