Prerequisites
- Obtain your API key by signing up on the ScrapeGraphAI Dashboard
Python SDK
You can also set the
SGAI_API_KEY environment variable and initialize the client without parameters: client = Client()JavaScript SDK
Install using npm, pnpm, yarn, or bun:Store your API keys securely in environment variables. Use
.env files and libraries like dotenv to load them into your app.Key Concepts
SmartScraper
Extract specific information from any webpage using AI. Provide a URL and a prompt describing what you want to extract. Learn moreSearchScraper
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 moreSmartCrawler
AI-powered extraction for any webpage with crawl capabilities. Automatically navigate and extract data from multiple pages. Learn moreMarkdownify
Convert any webpage into clean, formatted markdown. Perfect for content aggregation and processing. Learn moreStructured Output with Schemas
Both SDKs support structured output using schemas:- Python: Use Pydantic models
- JavaScript: Use Zod schemas
Example: Extract Structured Data with Schema
Python Example
JavaScript Example
Next Steps
- Explore our use cases to see how ScrapeGraphAI can help your projects
- Check out the Cookbook for real-world examples
- Read the API Reference for detailed endpoint documentation
- Join our Discord community for support and updates