Skip to content

Commit f5ce697

Browse files
VinciGit00claude
andauthored
feat: point v2 base URL to v2-api.scrapegraphai.com/api/v2 (#17)
* feat: point v2 base URL to v2-api.scrapegraphai.com/api/v2 New API host for v2 endpoints. Verified against GET /credits. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat: drop /v2 suffix from API base URL Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 76a8c69 commit f5ce697

6 files changed

Lines changed: 17 additions & 17 deletions

File tree

.agent/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ npx @modelcontextprotocol/inspector scrapegraph-mcp
379379
## 📅 Changelog
380380

381381
### April 2026
382-
- ✅ Migrated MCP client and tools to **API v2** ([scrapegraph-py#84](https://github.com/ScrapeGraphAI/scrapegraph-py/pull/84)): base `https://api.scrapegraphai.com/api/v2`, `SGAI-APIKEY` header (matches SDK wire format), new crawl/monitor/credits/history tools; removed sitemap, agentic_scrapper, status polling tools. Env vars aligned with SDK: `SGAI_API_URL`, `SGAI_TIMEOUT` (legacy alias `SGAI_TIMEOUT_S` still honored).
382+
- ✅ Migrated MCP client and tools to **API v2** ([scrapegraph-py#84](https://github.com/ScrapeGraphAI/scrapegraph-py/pull/84)): base `https://v2-api.scrapegraphai.com/api`, `SGAI-APIKEY` header (matches SDK wire format), new crawl/monitor/credits/history tools; removed sitemap, agentic_scrapper, status polling tools. Env vars aligned with SDK: `SGAI_API_URL`, `SGAI_TIMEOUT` (legacy alias `SGAI_TIMEOUT_S` still honored).
383383
- ✅ Added `monitor_activity` tool for paginated tick history (GET /monitor/:id/activity), mirroring `sgai.monitor.activity()` in scrapegraph-py v2.
384384

385385
### January 2026

.agent/system/mcp_protocol.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ The **Model Context Protocol** (MCP) is an open standard that defines how AI ass
8686
└────────────┬────────────────────┘
8787
│ HTTPS API requests
8888
89-
┌─────────────────────────────────┐
90-
│ ScrapeGraphAI API │
91-
https://api.scrapegraphai.com │
92-
└─────────────────────────────────┘
89+
┌───────────────────────────────────
90+
│ ScrapeGraphAI API
91+
v2-api.scrapegraphai.com/api
92+
└───────────────────────────────────
9393
```
9494

9595
### FastMCP Framework

.agent/system/project_architecture.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ AI Assistant (Claude/Cursor)
130130
↓ (stdio via MCP)
131131
FastMCP Server (this project)
132132
↓ (HTTPS API calls)
133-
ScrapeGraphAI API (default https://api.scrapegraphai.com/api/v2)
133+
ScrapeGraphAI API (default https://v2-api.scrapegraphai.com/api)
134134
↓ (web scraping)
135135
Target Websites
136136
```
@@ -141,7 +141,7 @@ The server follows a simple, single-file architecture:
141141

142142
**`ScapeGraphClient` Class:**
143143
- HTTP client wrapper for ScrapeGraphAI API v2 ([scrapegraph-py#84](https://github.com/ScrapeGraphAI/scrapegraph-py/pull/84))
144-
- Base URL: `https://api.scrapegraphai.com/api/v2` (override with env `SGAI_API_URL`)
144+
- Base URL: `https://v2-api.scrapegraphai.com/api` (override with env `SGAI_API_URL`)
145145
- Auth: `SGAI-APIKEY`, `X-SDK-Version: scrapegraph-mcp@2.0.0` (matches scrapegraph-py v2)
146146
- v2 methods include `scrape_v2`, `extract`, `search_api`, `crawl_*`, `monitor_*`, `credits`, `history`, plus compatibility wrappers used by MCP tools
147147

@@ -391,7 +391,7 @@ If status is "completed":
391391

392392
### ScrapeGraphAI API
393393

394-
**Base URL:** `https://api.scrapegraphai.com/api/v2` (configurable via `SGAI_API_URL`)
394+
**Base URL:** `https://v2-api.scrapegraphai.com/api` (configurable via `SGAI_API_URL`)
395395

396396
**Authentication:**
397397
- Headers: `SGAI-APIKEY: <key>` (matches scrapegraph-py v2 wire format)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ A production-ready [Model Context Protocol](https://modelcontextprotocol.io/intr
2828

2929
## API v2
3030

31-
This MCP server targets **ScrapeGraph API v2** (`https://api.scrapegraphai.com/api/v2`), aligned 1:1 with
31+
This MCP server targets **ScrapeGraph API v2** (`https://v2-api.scrapegraphai.com/api`), aligned 1:1 with
3232
[scrapegraph-py PR #84](https://github.com/ScrapeGraphAI/scrapegraph-py/pull/84). Auth uses the
3333
`SGAI-APIKEY` header. Environment variables mirror the Python SDK:
3434

35-
- **`SGAI_API_URL`** — override the base URL (default `https://api.scrapegraphai.com/api/v2`)
35+
- **`SGAI_API_URL`** — override the base URL (default `https://v2-api.scrapegraphai.com/api`)
3636
- **`SGAI_TIMEOUT`** — request timeout in seconds (default `120`)
3737
- **`SGAI_API_KEY`** — API key (can also be passed via MCP `scrapegraphApiKey` or `X-API-Key` header)
3838

@@ -670,7 +670,7 @@ For comprehensive developer documentation, see:
670670

671671
### API Integration
672672
- **ScrapeGraph AI API** - Enterprise web scraping service
673-
- **Base URL**: `https://api.scrapegraphai.com/v1`
673+
- **Base URL**: `https://v2-api.scrapegraphai.com/api`
674674
- **Authentication**: API key-based
675675

676676
## License

server.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"name": "SGAI_API_KEY"
2525
},
2626
{
27-
"description": "Override API base URL (default https://api.scrapegraphai.com/api/v2)",
27+
"description": "Override API base URL (default https://v2-api.scrapegraphai.com/api)",
2828
"isRequired": false,
2929
"format": "string",
3030
"isSecret": false,

src/scrapegraph_mcp/server.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
Removed on v2 (no API equivalent): sitemap, agentic_scrapper, markdownify_status, smartscraper_status.
2525
2626
Environment variables (match scrapegraph-py v2):
27-
- SGAI_API_URL (default https://api.scrapegraphai.com/api/v2) — base URL override
27+
- SGAI_API_URL (default https://v2-api.scrapegraphai.com/api) — base URL override
2828
- SGAI_TIMEOUT (default 120) — request timeout in seconds
2929
- SCRAPEGRAPH_API_BASE_URL — legacy alias for SGAI_API_URL (still honored)
3030
- SGAI_TIMEOUT_S — legacy alias for SGAI_TIMEOUT (still honored)
@@ -88,8 +88,8 @@
8888
logger = logging.getLogger(__name__)
8989

9090
MCP_SERVER_VERSION = "2.0.0"
91-
# Matches scrapegraph-py v2 (env.py): https://api.scrapegraphai.com/api/v2
92-
DEFAULT_API_BASE_URL = "https://api.scrapegraphai.com/api/v2"
91+
# Matches scrapegraph-py v2 (env.py): https://v2-api.scrapegraphai.com/api
92+
DEFAULT_API_BASE_URL = "https://v2-api.scrapegraphai.com/api"
9393

9494

9595
def _api_base_url() -> str:
@@ -662,7 +662,7 @@ def web_scraping_guide() -> str:
662662
1. Use **markdownify** or **scrape** before **smartscraper** when you only need readable text.
663663
2. Multi-page **AI** extraction: run **smartscraper** per URL, or use **monitor_create** on a schedule.
664664
3. Poll **smartcrawler_fetch_results** until the crawl finishes.
665-
4. Override API host with env **SGAI_API_URL** if needed (default `https://api.scrapegraphai.com/api/v2`).
665+
4. Override API host with env **SGAI_API_URL** if needed (default `https://v2-api.scrapegraphai.com/api`).
666666
"""
667667

668668

@@ -727,7 +727,7 @@ def api_status() -> str:
727727
return """# ScapeGraph API Status (MCP v2)
728728
729729
- **MCP package version**: 2.0.0 (matches [scrapegraph-py#84](https://github.com/ScrapeGraphAI/scrapegraph-py/pull/84) API surface)
730-
- **Default API base**: `https://api.scrapegraphai.com/api/v2` (override with `SGAI_API_URL`)
730+
- **Default API base**: `https://v2-api.scrapegraphai.com/api` (override with `SGAI_API_URL`)
731731
- **Auth headers**: `SGAI-APIKEY`, `X-SDK-Version: scrapegraph-mcp@2.0.0`
732732
733733
## Tools

0 commit comments

Comments
 (0)