You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Copy file name to clipboardExpand all lines: transition-from-v1-to-v2.mdx
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,9 +15,9 @@ Use this table to map old entry points to new ones. Details and examples follow
15
15
16
16
| v1 | v2 | Notes |
17
17
|----|-----|------|
18
+
|`markdownify`|**`scrape`** with `format="markdown"` (Python) or `format: "markdown"` (JS) | HTML → markdown and related “raw page” outputs live under **`scrape`**. |
18
19
|`smartscraper` / `smartScraper`|**`extract`**| Same job: structured extraction from a URL. Rename params and pass extra fetch/LLM options via config objects. |
19
20
|`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`**. |
21
21
|`crawl` (single start call) |**`crawl.start`**, then **`crawl.status`**, **`crawl.stop`**, **`crawl.resume`**| Crawl is explicitly async: you poll or track job id. |
22
22
| Monitors (if you used them) |**`monitor.create`**, **`monitor.list`**, **`monitor.get`**, pause/resume/delete | Same product, namespaced API. |
23
23
|`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
26
26
27
27
## Code-level transition
28
28
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`
30
36
31
37
**Before (v1):**`website_url` + `user_prompt`, optional flags on the same object.
**Before:**`searchscraper` / `searchScraper` with a prompt-style query.
84
90
@@ -101,12 +107,6 @@ const { data } = await sgai.search("Latest pricing for product X", {
101
107
102
108
</CodeGroup>
103
109
104
-
### 3. Markdownify → `scrape`
105
-
106
-
**Before:**`markdownify(url)`.
107
-
108
-
**After:**`scrape(url, format="markdown")` (Python) or `scrape(url, { format: "markdown" })` (JS).
109
-
110
110
### 4. Crawl jobs
111
111
112
112
**Before:** One-shot `crawl(...)` style usage depending on SDK version.
@@ -140,11 +140,11 @@ const status = await sgai.crawl.status(job.data.id);
140
140
141
141
If you call the API with `curl` or a generic HTTP client:
142
142
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`).
144
144
- Replace JSON fields to match v2 bodies (e.g. `url` and `prompt` instead of `website_url` and `user_prompt` on extract).
145
145
- Keep using the **`SGAI-APIKEY`** header unless the endpoint docs specify otherwise.
146
146
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).
0 commit comments