Skip to content

feat!: migrate langchain-scrapegraph to v2 API surface#7

Open
VinciGit00 wants to merge 1 commit intomainfrom
feat/migrate-to-v2-api
Open

feat!: migrate langchain-scrapegraph to v2 API surface#7
VinciGit00 wants to merge 1 commit intomainfrom
feat/migrate-to-v2-api

Conversation

@VinciGit00
Copy link
Copy Markdown
Member

@VinciGit00 VinciGit00 commented Apr 1, 2026

Summary

Port the LangChain integration to the new ScrapeGraph v2 API, mirroring scrapegraph-py#82.

  • Replace old tools with new v2 API methods: ExtractTool, SearchTool, ScrapeTool, CrawlStartTool, CrawlStatusTool, CrawlStopTool, CrawlResumeTool
  • Add MonitorCreateTool, MonitorListTool, MonitorGetTool, MonitorPauseTool, MonitorResumeTool, MonitorDeleteTool (replaces scheduled job tools)
  • Add HistoryTool for request history
  • Keep MarkdownifyTool (now uses client.scrape(format="markdown") internally)
  • Keep GetCreditsTool (now uses client.credits())
  • Remove AgenticScraperTool (removed in v2)
  • Version bumped to 2.0.0

Breaking Changes

v1 Tool v2 Tool v2 Client Method
SmartScraperTool ExtractTool client.extract(url, prompt)
SearchScraperTool SearchTool client.search(query)
ScrapeTool ScrapeTool client.scrape(url, format)
SmartCrawlerTool CrawlStartTool client.crawl.start(url)
-- CrawlStatusTool client.crawl.status(id)
-- CrawlStopTool client.crawl.stop(id)
-- CrawlResumeTool client.crawl.resume(id)
CreateScheduledJobTool MonitorCreateTool client.monitor.create()
GetScheduledJobsTool MonitorListTool client.monitor.list()
GetScheduledJobTool MonitorGetTool client.monitor.get(id)
PauseScheduledJobTool MonitorPauseTool client.monitor.pause(id)
ResumeScheduledJobTool MonitorResumeTool client.monitor.resume(id)
DeleteScheduledJobTool MonitorDeleteTool client.monitor.delete(id)
MarkdownifyTool MarkdownifyTool client.scrape(url, "markdown")
GetCreditsTool GetCreditsTool client.credits()
-- HistoryTool client.history()
AgenticScraperTool (removed) --

Test plan

  • All pre-commit hooks pass (black, ruff, isort, mypy, poetry-check)
  • Unit tests pass with mock client
  • Integration tests with v2 API (requires SGAI_API_KEY)

🤖 Generated with Claude Code

Port the LangChain integration to the new ScrapeGraph v2 API, mirroring
scrapegraph-py PR #82.

Breaking changes:
- SmartScraperTool -> ExtractTool (client.extract)
- SearchScraperTool -> SearchTool (client.search)
- SmartCrawlerTool -> CrawlStartTool/CrawlStatusTool/CrawlStopTool/CrawlResumeTool
- Scheduled job tools -> MonitorCreateTool/MonitorListTool/MonitorGetTool/MonitorPauseTool/MonitorResumeTool/MonitorDeleteTool
- ScrapeTool now uses url+format params instead of website_url+render_heavy_js
- GetCreditsTool now uses client.credits() instead of client.get_credits()
- MarkdownifyTool preserved but now uses client.scrape(format="markdown") internally
- Removed: AgenticScraperTool (removed in v2)
- New: HistoryTool for request history
- Version bumped to 2.0.0, scrapegraph-py dependency updated to >=1.31.0

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant