Skip to content

Commit ed78c26

Browse files
VinciGit00claude
andauthored
docs(js): align SDK docs with scrapegraph-js 2.1.0 type rename (#53)
Upstream PR ScrapeGraphAI/scrapegraph-js#17 drops the `Api` prefix from all exported TypeScript types and Zod schemas (only `ApiResult<T>` keeps it) and renames monitor `*Input`/`*Params` to `*Request`. Runtime surface is unchanged. - sdks/javascript.mdx: note the 2.1.0 type/schema rename, bump version requirement, rename `FormatEntry[]` -> `FormatConfig[]` in the scrape and crawl parameter tables. - services/{scrape,extract,search,crawl,monitor}.mdx + transition-from-v1-to-v2.mdx: bump `scrapegraph-js` version pin from >= 2.0.1 to >= 2.1.0. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 00f8f5b commit ed78c26

7 files changed

Lines changed: 30 additions & 26 deletions

File tree

sdks/javascript.mdx

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,18 @@ icon: "js"
2020
</CardGroup>
2121

2222
<Note>
23-
These docs cover **`scrapegraph-js` ≥ 2.0.1**. The v2 SDK is **ESM-only** and requires **Node ≥ 22**. Earlier `0.x`/`1.x` releases expose a different, deprecated API.
23+
These docs cover **`scrapegraph-js` ≥ 2.1.0**. The v2 SDK is **ESM-only** and requires **Node ≥ 22**. Earlier `0.x`/`1.x` releases expose a different, deprecated API.
2424
</Note>
2525

26+
<Warning>
27+
**Breaking in 2.1.0 (types only):** all exported TypeScript types and Zod schemas dropped the `Api` prefix and now match `scrapegraph-py` 1:1 (`ApiScrapeRequest``ScrapeRequest`, `ApiFetchConfig``FetchConfig`, `apiScrapeRequestSchema``scrapeRequestSchema`, etc.). Monitor input types are also renamed: `ApiMonitorCreateInput``MonitorCreateRequest`, `ApiMonitorUpdateInput``MonitorUpdateRequest`, `ApiMonitorActivityParams``MonitorActivityRequest`. `ApiResult<T>` is the only type that keeps the prefix. Runtime JS code is unchanged — only TypeScript consumers need to rename imports.
28+
</Warning>
29+
2630
## Installation
2731

2832
```bash
2933
# npm
30-
npm i scrapegraph-js@latest # pins a version >= 2.0.1
34+
npm i scrapegraph-js@latest # pins a version >= 2.1.0
3135

3236
# pnpm
3337
pnpm add scrapegraph-js@latest
@@ -117,12 +121,12 @@ const res = await sgai.scrape({
117121
118122
#### Parameters
119123
120-
| Parameter | Type | Required | Description |
121-
| ------------- | --------------- | -------- | ------------------------------------------------------------- |
122-
| `url` | `string` | Yes | URL to scrape |
123-
| `formats` | `FormatEntry[]` | No | Defaults to `[{ type: "markdown" }]` |
124-
| `contentType` | `string` | No | Override detected content type (e.g. `"application/pdf"`) |
125-
| `fetchConfig` | `FetchConfig` | No | Fetch configuration |
124+
| Parameter | Type | Required | Description |
125+
| ------------- | ---------------- | -------- | ------------------------------------------------------------- |
126+
| `url` | `string` | Yes | URL to scrape |
127+
| `formats` | `FormatConfig[]` | No | Defaults to `[{ type: "markdown" }]` |
128+
| `contentType` | `string` | No | Override detected content type (e.g. `"application/pdf"`) |
129+
| `fetchConfig` | `FetchConfig` | No | Fetch configuration |
126130
127131
**Formats:**
128132
- `markdown` — Clean markdown (modes: `normal`, `reader`, `prune`)
@@ -290,18 +294,18 @@ await sgai.crawl.delete(crawlId);
290294
291295
#### `crawl.start()` parameters
292296
293-
| Parameter | Type | Required | Description |
294-
| ------------------ | --------------- | -------- | -------------------------------------------------------- |
295-
| `url` | `string` | Yes | Starting URL |
296-
| `formats` | `FormatEntry[]` | No | Defaults to `[{ type: "markdown" }]` |
297-
| `maxDepth` | `number` | No | Maximum crawl depth. Default: `2` |
298-
| `maxPages` | `number` | No | Maximum pages (1–1000). Default: `50` |
299-
| `maxLinksPerPage` | `number` | No | Links followed per page. Default: `10` |
300-
| `allowExternal` | `boolean` | No | Allow crossing domains. Default: `false` |
301-
| `includePatterns` | `string[]` | No | URL patterns to include |
302-
| `excludePatterns` | `string[]` | No | URL patterns to exclude |
303-
| `contentTypes` | `string[]` | No | Allowed content types |
304-
| `fetchConfig` | `FetchConfig` | No | Fetch configuration |
297+
| Parameter | Type | Required | Description |
298+
| ------------------ | ---------------- | -------- | -------------------------------------------------------- |
299+
| `url` | `string` | Yes | Starting URL |
300+
| `formats` | `FormatConfig[]` | No | Defaults to `[{ type: "markdown" }]` |
301+
| `maxDepth` | `number` | No | Maximum crawl depth. Default: `2` |
302+
| `maxPages` | `number` | No | Maximum pages (1–1000). Default: `50` |
303+
| `maxLinksPerPage` | `number` | No | Links followed per page. Default: `10` |
304+
| `allowExternal` | `boolean` | No | Allow crossing domains. Default: `false` |
305+
| `includePatterns` | `string[]` | No | URL patterns to include |
306+
| `excludePatterns` | `string[]` | No | URL patterns to exclude |
307+
| `contentTypes` | `string[]` | No | Allowed content types |
308+
| `fetchConfig` | `FetchConfig` | No | Fetch configuration |
305309
306310
### `sgai.monitor.*`
307311

services/crawl.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ asyncio.run(main())
231231

232232
### Official SDKs
233233
- [Python SDK](/sdks/python)
234-
- [JavaScript SDK](/sdks/javascript) (`scrapegraph-js` ≥ 2.0.1, Node ≥ 22)
234+
- [JavaScript SDK](/sdks/javascript) (`scrapegraph-js` ≥ 2.1.0, Node ≥ 22)
235235

236236
### AI Framework Integrations
237237
- [LangChain Integration](/integrations/langchain)

services/extract.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ asyncio.run(main())
244244
245245
### Official SDKs
246246
- [Python SDK](/sdks/python)
247-
- [JavaScript SDK](/sdks/javascript) (`scrapegraph-js` ≥ 2.0.1, Node ≥ 22)
247+
- [JavaScript SDK](/sdks/javascript) (`scrapegraph-js` ≥ 2.1.0, Node ≥ 22)
248248
249249
### AI Framework Integrations
250250
- [LangChain Integration](/integrations/langchain)

services/monitor.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ asyncio.run(main())
222222
223223
### Official SDKs
224224
- [Python SDK](/sdks/python)
225-
- [JavaScript SDK](/sdks/javascript) (`scrapegraph-js` ≥ 2.0.1, Node ≥ 22)
225+
- [JavaScript SDK](/sdks/javascript) (`scrapegraph-js` ≥ 2.1.0, Node ≥ 22)
226226
227227
## Support & Resources
228228

services/scrape.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ asyncio.run(main())
340340
341341
### Official SDKs
342342
- [Python SDK](/sdks/python) — perfect for automation and data processing
343-
- [JavaScript SDK](/sdks/javascript) — ideal for web applications and Node.js (`scrapegraph-js` ≥ 2.0.1, Node ≥ 22)
343+
- [JavaScript SDK](/sdks/javascript) — ideal for web applications and Node.js (`scrapegraph-js` ≥ 2.1.0, Node ≥ 22)
344344
345345
### AI Framework Integrations
346346
- [LangChain Integration](/integrations/langchain) — use Scrape in your content pipelines

services/search.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ asyncio.run(main())
199199
200200
### Official SDKs
201201
- [Python SDK](/sdks/python)
202-
- [JavaScript SDK](/sdks/javascript) (`scrapegraph-js` ≥ 2.0.1, Node ≥ 22)
202+
- [JavaScript SDK](/sdks/javascript) (`scrapegraph-js` ≥ 2.1.0, Node ≥ 22)
203203
204204
### AI Framework Integrations
205205
- [LangChain Integration](/integrations/langchain)

transition-from-v1-to-v2.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ Exact paths and payloads are listed under each service (for example [Scrape](/se
231231
1. Log in at [scrapegraphai.com/login](https://scrapegraphai.com/login)
232232
2. Start from [Introduction](/introduction)
233233
3. Follow [Installation](/install)
234-
4. Upgrade packages: `pip install -U scrapegraph-py` / `npm i scrapegraph-js@latest` (requires **`scrapegraph-js`2.0.1** and **Node22**)
234+
4. Upgrade packages: `pip install -U scrapegraph-py` / `npm i scrapegraph-js@latest` (requires **`scrapegraph-js`2.1.0** and **Node22**)
235235

236236
## SDK migration guides (detailed changelogs)
237237

0 commit comments

Comments
 (0)