Skip to content

docs: migrate homes-forsale SDK cookbook to v2 API (4/N)#94

Draft
Vikrant-Khedkar wants to merge 3 commits into
mainfrom
docs/cookbook-homes-forsale-v2
Draft

docs: migrate homes-forsale SDK cookbook to v2 API (4/N)#94
Vikrant-Khedkar wants to merge 3 commits into
mainfrom
docs/cookbook-homes-forsale-v2

Conversation

@Vikrant-Khedkar
Copy link
Copy Markdown
Collaborator

@Vikrant-Khedkar Vikrant-Khedkar commented May 11, 2026

image

⚠️ DO NOT MERGE — Draft

Fourth of N PRs (follows #91, #92, #93) restoring + migrating the cookbook notebooks that were removed in 1f3b123 to the v2 SDK API. This PR migrates cookbook/homes-forsale/scrapegraph_sdk.ipynb.

Migration

Old New
from scrapegraph_py import Client from scrapegraph_py import ScrapeGraphAI, FetchConfig
Client(api_key=...) ScrapeGraphAI() (auto-reads SGAI_API_KEY)
smartscraper(website_url=, user_prompt=, output_schema=HouseListingsSchema) extract(prompt, url=, schema=HouseListingsSchema.model_json_schema(), fetch_config=FetchConfig(stealth=True))
response['result'] / response['request_id'] response.data.json_data + .status / .error check
broken async link → examples/async_smartscraper_example.py (404) examples/extract/extract_basic_async.py
https://dashboard.scrapegraphai.com/ https://scrapegraphai.com/dashboard
Old "Presentazione" banner (517 KB inline base64) New ScrapeGraphAI banner (193 KB inline base64)

Notes

  • Stealth fetch enabledhomes.com has anti-bot defenses; passing FetchConfig(stealth=True) is necessary for the live API run to return real data.

Pending before this can leave draft

  • Run notebook end-to-end against live API to confirm stealth fetch returns populated result["houses"] data
  • Visual review of all cells in Jupyter

Follow-ups (separate PRs, not blocking)

  • cookbook/chat-webpage-simple-rag/scrapegraph_burr_lancedb.ipynb (heavier: markdownify → scrape, sgai_logger removal)
  • LangChain / LlamaIndex / LangGraph / CrewAI integration notebooks (13 files — need separate verification that the wrapper packages target v2)

Test plan

  • SGAI_API_KEY=... jupyter lab cookbook/homes-forsale/scrapegraph_sdk.ipynb → Run All, no exceptions
  • result["houses"] is a populated list of dicts (stealth bypasses anti-bot)
  • Pandas dataframe renders (df)
  • CSV written (houses_forsale.csv)

🤖 Generated with Claude Code

- Client -> ScrapeGraphAI (auto-reads SGAI_API_KEY)
- smartscraper(website_url=, user_prompt=, output_schema=)
  -> extract(prompt, url=, schema=model_json_schema())
- Add FetchConfig(stealth=True) since homes.com has anti-bot defenses
- Response shape: response['result'] -> response.data.json_data
- Fix broken async example link
- Update dashboard URL: dashboard.scrapegraphai.com -> scrapegraphai.com/dashboard
- Swap outdated banner image

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 11, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

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.

2 participants