Open
Conversation
Port the Python SDK to the new v2 API surface, mirroring scrapegraph-js PR #11. Breaking changes: - smartscraper -> extract (POST /api/v1/extract) - searchscraper -> search (POST /api/v1/search) - scrape now uses format-specific config (markdown/html/screenshot/branding) - crawl/monitor are now namespaced: client.crawl.start(), client.monitor.create() - Removed: markdownify, agenticscraper, sitemap, healthz, feedback, scheduled jobs - Auth: sends both Authorization: Bearer and SGAI-APIKEY headers - Added X-SDK-Version header, base_url parameter for custom endpoints - Version bumped to 2.0.0 Tested against dev API (https://sgai-api-dev-v2.onrender.com/api/v1/scrape): - Scrape markdown: returns markdown content successfully - Scrape html: returns content successfully - All 72 unit tests pass with 81% coverage Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace old v1 examples with clean v2 examples: - scrape (sync + async) - extract with Pydantic schema (sync + async) - search - schema generation - crawl (namespaced: crawl.start/status/stop/resume) - monitor (namespaced: monitor.create/list/pause/resume/delete) - credits Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. Scanned FilesNone |
30 comprehensive examples covering every v2 endpoint: Scrape (5): markdown, html, screenshot, fetch config, async concurrent Extract (6): basic, pydantic schema, json schema, fetch config, llm config, async Search (4): basic, with schema, num results, async concurrent Schema (2): generate, refine existing Crawl (5): basic with polling, patterns, fetch config, stop/resume, async Monitor (5): create, with schema, with config, manage lifecycle, async History (1): filters and pagination Credits (2): sync, async All examples moved to root /examples/ directory (flat structure). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comprehensive migration guide covering: - Every renamed/removed endpoint with before/after code examples - Parameter mapping tables for all methods - New FetchConfig/LlmConfig shared models - Scheduled Jobs → Monitor namespace migration - Crawl namespace changes (start/status/stop/resume) - Removed features (mock mode, TOON, polling methods) - Quick find-and-replace cheatsheet for fast migration - Async client migration notes Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Member
Author
SDK v2 Integration Test ResultsTested against dev API: 1.
|
| Endpoint | Status |
|---|---|
scrape (markdown) |
✅ |
scrape (screenshot) |
✅ |
scrape (with FetchConfig) |
✅ |
extract (basic) |
✅ |
extract (Pydantic schema) |
✅ |
search |
✅ |
schema |
✅ |
history |
✅ |
credits |
7/8 endpoints working. credits returns 404 on the dev server — likely not yet deployed on that instance.
Open
5 tasks
VinciGit00
added a commit
to ScrapeGraphAI/Scrapegraph-ai
that referenced
this pull request
Mar 31, 2026
Update all SDK usage to match the new v2 API from ScrapeGraphAI/scrapegraph-py#82: - smartscraper() → extract(url=, prompt=) - searchscraper() → search(query=) - markdownify() → scrape(url=) - Bump dependency to scrapegraph-py>=2.0.0 BREAKING CHANGE: requires scrapegraph-py v2.0.0+ Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Port the Python SDK to the new v2 API surface, mirroring scrapegraph-js#11.
smartscraper,searchscraper,markdownify, etc.) with new v2 methods:scrape,extract,search,schema,credits,historycrawl.*andmonitor.*operations (replaces scheduled jobs)Authorization: BearerandSGAI-APIKEYheadersX-SDK-Version: python@2.0.0header andbase_urlparameter for custom endpointsFetchConfig,LlmConfig,ScrapeFormat,ExtractRequest,SearchRequest,CrawlRequest,MonitorCreateRequest,HistoryFiltermarkdownify,agenticscraper,sitemap,healthz,feedback, all scheduled job methodsDev API test results
Tested against
https://sgai-api-dev-v2.onrender.com/api/v1/scrape:{ "id": "0d6c4b31-931b-469b-9a7f-2f1e002e79ca", "format": "markdown", "content": [ "# Example Domain\n\nThis domain is for use in documentation examples..." ], "metadata": { "contentType": "text/html" } }Breaking Changes
smartscraper()extract()/api/v1/extractsearchscraper()search()/api/v1/searchscrape()scrape()/api/v1/scrapegenerate_schema()schema()/api/v1/schemaget_credits()credits()/api/v1/creditscrawl()crawl.start()/api/v1/crawlget_crawl()crawl.status()/api/v1/crawl/:idcrawl.stop()/api/v1/crawl/:id/stopcrawl.resume()/api/v1/crawl/:id/resumemonitor.*/api/v1/monitorhistory()/api/v1/historyTest plan
scrapeendpoint verified)🤖 Generated with Claude Code