Skip to content

Commit 03ffffe

Browse files
committed
feat: enhanced sections
1 parent ec2c283 commit 03ffffe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2451
-1174
lines changed

api-reference/errors.mdx

+164
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
---
2+
title: 'Error Handling'
3+
description: 'Understanding and handling ScrapeGraphAI API errors'
4+
---
5+
6+
## Error Format
7+
8+
All API errors follow a simple format:
9+
10+
```json
11+
{
12+
"error": "Detailed error message"
13+
}
14+
```
15+
16+
## HTTP Status Codes
17+
18+
### 400 Bad Request
19+
Indicates that the request was malformed or invalid.
20+
21+
<AccordionGroup>
22+
<Accordion title="Invalid Parameters" icon="circle-xmark">
23+
```json
24+
{
25+
"error": "Invalid URL format"
26+
}
27+
```
28+
The request contains invalid parameters.
29+
</Accordion>
30+
31+
<Accordion title="Invalid Schema" icon="table">
32+
```json
33+
{
34+
"error": "Invalid schema format"
35+
}
36+
```
37+
The provided output schema is invalid or malformed.
38+
</Accordion>
39+
40+
<Accordion title="Invalid HTML" icon="code">
41+
```json
42+
{
43+
"error": "Invalid HTML content"
44+
}
45+
```
46+
Applies to LocalScraper when the provided HTML is invalid.
47+
</Accordion>
48+
</AccordionGroup>
49+
50+
### 401 Unauthorized
51+
Authentication-related errors.
52+
53+
<AccordionGroup>
54+
<Accordion title="Invalid API Key" icon="key">
55+
```json
56+
{
57+
"error": "Invalid API key"
58+
}
59+
```
60+
The API key is invalid, revoked, or not provided.
61+
</Accordion>
62+
63+
<Accordion title="Insufficient Credits" icon="coins">
64+
```json
65+
{
66+
"error": "Insufficient credits"
67+
}
68+
```
69+
Your account doesn't have enough credits to perform the operation.
70+
</Accordion>
71+
</AccordionGroup>
72+
73+
### 429 Too Many Requests
74+
Rate limiting errors.
75+
76+
<AccordionGroup>
77+
<Accordion title="Rate Limit Exceeded" icon="gauge-high">
78+
```json
79+
{
80+
"error": "Too many requests"
81+
}
82+
```
83+
You've exceeded the rate limit. Wait before retrying.
84+
</Accordion>
85+
</AccordionGroup>
86+
87+
### 500 Server Error
88+
Internal server errors.
89+
90+
<AccordionGroup>
91+
<Accordion title="Processing Error" icon="triangle-exclamation">
92+
```json
93+
{
94+
"error": "An error occurred while processing your request"
95+
}
96+
```
97+
An unexpected error occurred while processing the request.
98+
</Accordion>
99+
100+
<Accordion title="Service Unavailable" icon="server">
101+
```json
102+
{
103+
"error": "Service temporarily unavailable"
104+
}
105+
```
106+
The service is temporarily unavailable. Try again later.
107+
</Accordion>
108+
</AccordionGroup>
109+
110+
## Error Handling Best Practices
111+
112+
### Retry Strategy
113+
114+
<Note>
115+
Our SDKs implement automatic retries for certain errors. For direct API usage, implement your own retry logic.
116+
</Note>
117+
118+
1. **Retryable Errors**
119+
- Rate limit exceeded (429)
120+
- Service unavailable (500, 503)
121+
- Network timeouts
122+
123+
2. **Non-Retryable Errors**
124+
- Invalid parameters (400)
125+
- Authentication errors (401)
126+
- Invalid schemas (400)
127+
128+
### Example Error Handling
129+
130+
<CodeGroup>
131+
```python Python
132+
try:
133+
response = client.smartscraper(
134+
website_url="https://example.com",
135+
user_prompt="Extract data"
136+
)
137+
except APIError as e:
138+
print(f"Error: {e.message}")
139+
```
140+
141+
```javascript JavaScript
142+
try {
143+
const response = await client.smartscraper({
144+
websiteUrl: 'https://example.com',
145+
userPrompt: 'Extract data'
146+
});
147+
} catch (error) {
148+
console.error('Error:', error.message);
149+
}
150+
```
151+
</CodeGroup>
152+
153+
## Support
154+
155+
If you encounter any errors not documented here or need assistance:
156+
157+
<CardGroup cols={2}>
158+
<Card title="Discord Community" icon="discord" href="https://discord.gg/uJN7TYcpNa">
159+
Get help from our community
160+
</Card>
161+
<Card title="Email Support" icon="envelope" href="mailto:[email protected]">
162+
Contact our technical team
163+
</Card>
164+
</CardGroup>

api-reference/introduction.mdx

+82-21
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,94 @@
11
---
22
title: 'Introduction'
3-
description: 'Example section for showcasing API endpoints'
3+
description: 'Complete reference for the ScrapeGraphAI REST API'
44
---
55

6+
## Overview
7+
8+
The ScrapeGraphAI API provides powerful endpoints for AI-powered web scraping and content extraction. Our RESTful API allows you to extract structured data from any website, process local HTML content, and convert web pages to clean markdown.
9+
10+
## Authentication
11+
12+
All API requests require authentication using an API key. You can get your API key from the [dashboard](https://dashboard.scrapegraphai.com).
13+
14+
```bash
15+
SGAI-APIKEY: your-api-key-here
16+
```
17+
618
<Note>
7-
If you're not looking to build API reference documentation, you can delete
8-
this section by removing the api-reference folder.
19+
Keep your API key secure and never expose it in client-side code. Use environment variables to manage your keys safely.
920
</Note>
1021

11-
## Welcome
22+
## Base URL
1223

13-
There are two ways to build API documentation: [OpenAPI](https://mintlify.com/docs/api-playground/openapi/setup) and [MDX components](https://mintlify.com/docs/api-playground/mdx/configuration). For the starter kit, we are using the following OpenAPI specification.
24+
```bash
25+
https://api.scrapegraphai.com/v1
26+
```
1427

15-
<Card
16-
title="Plant Store Endpoints"
17-
icon="leaf"
18-
href="https://github.com/mintlify/starter/blob/main/api-reference/openapi.json"
19-
>
20-
View the OpenAPI specification file
21-
</Card>
28+
## Available Services
2229

23-
## Authentication
30+
<CardGroup cols={2}>
31+
<Card title="SmartScraper" icon="robot" href="/api-reference/endpoint/smartscraper/start">
32+
Extract structured data from any website using AI
33+
</Card>
34+
<Card title="LocalScraper" icon="file-code" href="/api-reference/endpoint/localscraper/start">
35+
Process local HTML content with AI extraction
36+
</Card>
37+
<Card title="Markdownify" icon="markdown" href="/api-reference/endpoint/markdownify/start">
38+
Convert web content to clean markdown
39+
</Card>
40+
<Card title="User" icon="user" href="/api-reference/endpoint/user/get-credits">
41+
Manage credits and submit feedback
42+
</Card>
43+
</CardGroup>
2444

25-
All API endpoints are authenticated using Bearer tokens and picked up from the specification file.
45+
## SDKs & Integration
2646

27-
```json
28-
"security": [
29-
{
30-
"bearerAuth": []
31-
}
32-
]
33-
```
47+
We provide official SDKs to help you integrate quickly:
48+
49+
<CardGroup cols={2}>
50+
<Card title="Python SDK" icon="python" href="/sdks/python">
51+
Perfect for data science and backend applications
52+
</Card>
53+
<Card title="JavaScript SDK" icon="js" href="/sdks/javascript">
54+
Ideal for web applications and Node.js
55+
</Card>
56+
</CardGroup>
57+
58+
### AI Framework Integration
59+
60+
<CardGroup cols={2}>
61+
<Card title="LangChain" icon="link" href="/integrations/langchain">
62+
Use our services in your LLM workflows
63+
</Card>
64+
<Card title="LlamaIndex" icon="database" href="/integrations/llamaindex">
65+
Build powerful search and QA systems
66+
</Card>
67+
</CardGroup>
68+
69+
## Error Handling
70+
71+
Our API uses conventional HTTP response codes:
72+
73+
- `200` - Success
74+
- `400` - Bad Request
75+
- `401` - Unauthorized
76+
- `429` - Too Many Requests
77+
- `500` - Server Error
78+
79+
<Note>
80+
Check our [error handling guide](/api-reference/errors) for detailed information about error responses and how to handle them.
81+
</Note>
82+
83+
## Support
84+
85+
Need help with the API? We're here to assist:
86+
87+
<CardGroup cols={2}>
88+
<Card title="Discord Community" icon="discord" href="https://discord.gg/uJN7TYcpNa">
89+
Get help from our community
90+
</Card>
91+
<Card title="Email Support" icon="envelope" href="mailto:[email protected]">
92+
Contact our technical team
93+
</Card>
94+
</CardGroup>

contribute/feedback.mdx

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
---
2+
title: 'Feedback'
3+
description: 'Help us improve ScrapeGraphAI'
4+
icon: 'comments'
5+
---
6+
7+
## Share Your Experience
8+
9+
Your feedback helps us improve ScrapeGraphAI. There are several ways to share your thoughts and experiences with us.
10+
11+
### API Feedback
12+
13+
<CodeGroup>
14+
15+
```python Python
16+
from scrapegraph_py import Client
17+
18+
client = Client(api_key="your-api-key")
19+
20+
client.submit_feedback(
21+
request_id="your-request-id",
22+
rating=5,
23+
feedback_text="Great results for e-commerce product extraction!"
24+
)
25+
```
26+
27+
```javascript JavaScript
28+
const client = new Client('your-api-key');
29+
30+
await client.submitFeedback({
31+
requestId: 'your-request-id',
32+
rating: 5,
33+
feedbackText: 'Great results for e-commerce product extraction!'
34+
});
35+
```
36+
37+
</CodeGroup>
38+
39+
### Feature Requests
40+
41+
Have an idea for a new feature? We'd love to hear it!
42+
43+
<Card
44+
title="Submit Feature Request"
45+
icon="lightbulb"
46+
href="https://github.com/ScrapeGraphAI/scrapegraph-ai/issues/new?labels=enhancement"
47+
>
48+
Share your ideas on our GitHub repository
49+
</Card>
50+
51+
### Bug Reports
52+
53+
Found a bug? Help us improve by reporting it:
54+
55+
<CardGroup cols={2}>
56+
<Card
57+
title="Core Library"
58+
icon="bug"
59+
href="https://github.com/ScrapeGraphAI/scrapegraph-ai/issues/new?labels=bug"
60+
>
61+
Report issues with the core functionality
62+
</Card>
63+
<Card
64+
title="SDK Issues"
65+
icon="code"
66+
href="https://github.com/ScrapeGraphAI/scrapegraph-sdk/issues/new?labels=bug"
67+
>
68+
Report SDK-specific problems
69+
</Card>
70+
</CardGroup>
71+
72+
## Community Channels
73+
74+
Join our community to discuss ideas, share experiences, and get help:
75+
76+
<CardGroup cols={2}>
77+
<Card
78+
title="Discord Community"
79+
icon="discord"
80+
href="https://discord.gg/uJN7TYcpNa"
81+
>
82+
Chat with other developers and our team
83+
</Card>
84+
<Card
85+
title="GitHub Discussions"
86+
icon="github"
87+
href="https://github.com/ScrapeGraphAI/scrapegraph-ai/discussions"
88+
>
89+
Participate in technical discussions
90+
</Card>
91+
</CardGroup>
92+
93+
## Contact Us
94+
95+
Need to reach us directly?
96+
97+
<Card
98+
title="Email Support"
99+
icon="envelope"
100+
href="mailto:[email protected]"
101+
>
102+
Contact our support team for direct assistance
103+
</Card>
104+
105+
<Note>
106+
For urgent issues or private inquiries, please email us directly. For general questions and discussions, we encourage using our Discord community or GitHub discussions.
107+
</Note>

0 commit comments

Comments
 (0)