Skip to content

Commit 8bcbe0b

Browse files
authored
Merge pull request #16 from ScrapeGraphAI/chore/update-api-base-url-v2
chore: point default API base URL to v2-api.scrapegraphai.com
2 parents 7f9e5ba + 41d5fa9 commit 8bcbe0b

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ const health = await sgai.healthy();
220220
| Variable | Description | Default |
221221
|----------|-------------|---------|
222222
| `SGAI_API_KEY` | Your ScrapeGraphAI API key ||
223-
| `SGAI_API_URL` | Override API base URL | `https://api.scrapegraphai.com/api/v2` |
223+
| `SGAI_API_URL` | Override API base URL | `https://v2-api.scrapegraphai.com/api` |
224224
| `SGAI_DEBUG` | Enable debug logging (`"1"`) | off |
225225
| `SGAI_TIMEOUT` | Request timeout in seconds | `120` |
226226

src/scrapegraphai.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import type {
2121
ApiSearchResponse,
2222
} from "./types.js";
2323

24-
const BASE_URL = process.env.SGAI_API_URL || "https://api.scrapegraphai.com/api/v2";
24+
const BASE_URL = process.env.SGAI_API_URL || "https://v2-api.scrapegraphai.com/api";
2525

2626
function debug(label: string, data?: unknown) {
2727
if (!env.debug) return;

tests/scrapegraphai.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { afterEach, describe, expect, spyOn, test } from "bun:test";
22
import * as sdk from "../src/scrapegraphai.js";
33

44
const API_KEY = "test-sgai-key";
5-
const BASE = process.env.SGAI_API_URL || "https://api.scrapegraphai.com/api/v2";
5+
const BASE = process.env.SGAI_API_URL || "https://v2-api.scrapegraphai.com/api";
66

77
function json(body: unknown, status = 200): Response {
88
return new Response(JSON.stringify(body), {

0 commit comments

Comments
 (0)