Skip to content

Commit 72e2cd6

Browse files
committed
docs: align transition endpoint order with Services nav
Reorder the v1-to-v2 migration mapping and REST endpoint examples to match the Services navigation sequence (scrape, extract, search, crawl, monitor). Made-with: Cursor
1 parent 5815408 commit 72e2cd6

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

transition-from-v1-to-v2.mdx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Use this table to map old entry points to new ones. Details and examples follow
1515

1616
| v1 | v2 | Notes |
1717
|----|-----|------|
18+
| `markdownify` | **`scrape`** with `format="markdown"` (Python) or `format: "markdown"` (JS) | HTML → markdown and related “raw page” outputs live under **`scrape`**. |
1819
| `smartscraper` / `smartScraper` | **`extract`** | Same job: structured extraction from a URL. Rename params and pass extra fetch/LLM options via config objects. |
1920
| `searchscraper` / `searchScraper` | **`search`** | Web search + extraction; use `query` (or positional string in JS). |
20-
| `markdownify` | **`scrape`** with `format="markdown"` (Python) or `format: "markdown"` (JS) | HTML → markdown and related “raw page” outputs live under **`scrape`**. |
2121
| `crawl` (single start call) | **`crawl.start`**, then **`crawl.status`**, **`crawl.stop`**, **`crawl.resume`** | Crawl is explicitly async: you poll or track job id. |
2222
| Monitors (if you used them) | **`monitor.create`**, **`monitor.list`**, **`monitor.get`**, pause/resume/delete | Same product, namespaced API. |
2323
| `sitemap` | **Removed from v2 SDKs** | Discover URLs with **`crawl.start`** and URL patterns, or call the REST sitemap endpoint if your integration still requires it—see [Sitemap](/services/sitemap) and SDK release notes. |
@@ -26,7 +26,13 @@ Use this table to map old entry points to new ones. Details and examples follow
2626

2727
## Code-level transition
2828

29-
### 1. SmartScraper → `extract`
29+
### 1. Markdownify → `scrape`
30+
31+
**Before:** `markdownify(url)`.
32+
33+
**After:** `scrape(url, format="markdown")` (Python) or `scrape(url, { format: "markdown" })` (JS).
34+
35+
### 2. SmartScraper → `extract`
3036

3137
**Before (v1):** `website_url` + `user_prompt`, optional flags on the same object.
3238

@@ -78,7 +84,7 @@ const { data, requestId } = await sgai.extract("https://example.com", {
7884

7985
</CodeGroup>
8086

81-
### 2. SearchScraper → `search`
87+
### 3. SearchScraper → `search`
8288

8389
**Before:** `searchscraper` / `searchScraper` with a prompt-style query.
8490

@@ -101,12 +107,6 @@ const { data } = await sgai.search("Latest pricing for product X", {
101107

102108
</CodeGroup>
103109

104-
### 3. Markdownify → `scrape`
105-
106-
**Before:** `markdownify(url)`.
107-
108-
**After:** `scrape(url, format="markdown")` (Python) or `scrape(url, { format: "markdown" })` (JS).
109-
110110
### 4. Crawl jobs
111111

112112
**Before:** One-shot `crawl(...)` style usage depending on SDK version.
@@ -140,11 +140,11 @@ const status = await sgai.crawl.status(job.data.id);
140140

141141
If you call the API with `curl` or a generic HTTP client:
142142

143-
- Use the v2 host and path pattern: **`https://api.scrapegraphai.com/api/v2/<endpoint>`** (e.g. `/api/v2/extract`, `/api/v2/monitor`).
143+
- Use the v2 host and path pattern: **`https://api.scrapegraphai.com/api/v2/<endpoint>`** (e.g. `/api/v2/scrape`, `/api/v2/extract`, `/api/v2/search`, `/api/v2/crawl`, `/api/v2/monitor`).
144144
- Replace JSON fields to match v2 bodies (e.g. `url` and `prompt` instead of `website_url` and `user_prompt` on extract).
145145
- Keep using the **`SGAI-APIKEY`** header unless the endpoint docs specify otherwise.
146146

147-
Exact paths and payloads are listed under each service (for example [Extract](/services/extract)) and in the [API reference](/api-reference/introduction).
147+
Exact paths and payloads are listed under each service (for example [Scrape](/services/scrape)) and in the [API reference](/api-reference/introduction).
148148

149149
## What else changed in v2 (docs & product)
150150

0 commit comments

Comments
 (0)