Skip to content

Commit e3f3927

Browse files
VinciGit00claude
andcommitted
feat: add v2 documentation with versioned navigation and updated SDKs
Migrate documentation to v2 structure with versioned nav (v2 default, v1 legacy). Update Python and JavaScript SDK docs to reflect v2 API changes (extract, search, scrape, crawl, monitor namespaces, FetchConfig/LlmConfig). Add v1/ legacy pages with deprecation banners. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b4b5143 commit e3f3927

29 files changed

Lines changed: 1674 additions & 1275 deletions

docs.json

Lines changed: 291 additions & 203 deletions
Large diffs are not rendered by default.

install.md

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Installation
3-
description: 'Install and get started with ScrapeGraphAI SDKs'
3+
description: 'Install and get started with ScrapeGraphAI v2 SDKs'
44
---
55

66
## Prerequisites
@@ -22,10 +22,10 @@ from scrapegraph_py import Client
2222

2323
client = Client(api_key="your-api-key-here")
2424

25-
# Scrape a website
26-
response = client.smartscraper(
27-
website_url="https://scrapegraphai.com",
28-
user_prompt="Extract information about the company"
25+
# Extract data from a website
26+
response = client.extract(
27+
url="https://scrapegraphai.com",
28+
prompt="Extract information about the company"
2929
)
3030
print(response)
3131
```
@@ -40,6 +40,8 @@ For more advanced usage, see the [Python SDK documentation](/sdks/python).
4040

4141
## JavaScript SDK
4242

43+
Requires **Node.js >= 22**.
44+
4345
Install using npm, pnpm, yarn, or bun:
4446

4547
```bash
@@ -59,20 +61,16 @@ bun add scrapegraph-js
5961
**Usage:**
6062

6163
```javascript
62-
import { smartScraper } from "scrapegraph-js";
64+
import scrapegraphai from "scrapegraph-js";
6365

64-
const apiKey = "your-api-key-here";
66+
const sgai = scrapegraphai({ apiKey: "your-api-key-here" });
6567

66-
const response = await smartScraper(apiKey, {
67-
website_url: "https://scrapegraphai.com",
68-
user_prompt: "What does the company do?",
69-
});
68+
const { data } = await sgai.extract(
69+
"https://scrapegraphai.com",
70+
{ prompt: "What does the company do?" }
71+
);
7072

71-
if (response.status === "error") {
72-
console.error("Error:", response.error);
73-
} else {
74-
console.log(response.data.result);
75-
}
73+
console.log(data);
7674
```
7775

7876
<Note>
@@ -85,18 +83,18 @@ For more advanced usage, see the [JavaScript SDK documentation](/sdks/javascript
8583

8684
## Key Concepts
8785

88-
### SmartScraper
86+
### Extract (formerly SmartScraper)
8987
Extract specific information from any webpage using AI. Provide a URL and a prompt describing what you want to extract. [Learn more](/services/smartscraper)
9088

91-
### SearchScraper
92-
Search and extract information from multiple web sources using AI. Start with just a prompt - SearchScraper will find relevant websites and extract the information you need. [Learn more](/services/searchscraper)
89+
### Search (formerly SearchScraper)
90+
Search and extract information from multiple web sources using AI. Start with just a query - Search will find relevant websites and extract the information you need. [Learn more](/services/searchscraper)
91+
92+
### Scrape
93+
Convert any webpage into markdown, HTML, screenshot, or branding format. Replaces the previous Markdownify endpoint with additional output formats. [Learn more](/services/scrape)
9394

9495
### SmartCrawler
9596
AI-powered extraction for any webpage with crawl capabilities. Automatically navigate and extract data from multiple pages. [Learn more](/services/smartcrawler)
9697

97-
### Markdownify
98-
Convert any webpage into clean, formatted markdown. Perfect for content aggregation and processing. [Learn more](/services/markdownify)
99-
10098
### Structured Output with Schemas
10199
Both SDKs support structured output using schemas:
102100
- **Python**: Use Pydantic models
@@ -119,34 +117,37 @@ class CompanyInfo(BaseModel):
119117
industry: str = Field(description="Industry sector")
120118

121119
client = Client(api_key="your-api-key")
122-
result = client.smartscraper(
123-
website_url="https://scrapegraphai.com",
124-
user_prompt="Extract company information",
120+
response = client.extract(
121+
url="https://scrapegraphai.com",
122+
prompt="Extract company information",
125123
output_schema=CompanyInfo
126124
)
127-
print(result)
125+
print(response)
128126
```
129127

130128
### JavaScript Example
131129

132130
```javascript
133-
import { smartScraper } from "scrapegraph-js";
131+
import scrapegraphai from "scrapegraph-js";
134132
import { z } from "zod";
135133

134+
const sgai = scrapegraphai({ apiKey: "your-api-key" });
135+
136136
const CompanySchema = z.object({
137-
company_name: z.string().describe("The company name"),
137+
companyName: z.string().describe("The company name"),
138138
description: z.string().describe("Company description"),
139139
website: z.string().url().describe("Company website URL"),
140140
industry: z.string().describe("Industry sector"),
141141
});
142142

143-
const apiKey = "your-api-key";
144-
const response = await smartScraper(apiKey, {
145-
website_url: "https://scrapegraphai.com",
146-
user_prompt: "Extract company information",
147-
output_schema: CompanySchema,
148-
});
149-
console.log(response.data.result);
143+
const { data } = await sgai.extract(
144+
"https://scrapegraphai.com",
145+
{
146+
prompt: "Extract company information",
147+
schema: CompanySchema,
148+
}
149+
);
150+
console.log(data);
150151
```
151152

152153
---

0 commit comments

Comments
 (0)