
Installation
Install the package using npm, pnpm, yarn or bun:Features
- AI-Powered Extraction: Smart web scraping with artificial intelligence
- Async by Design: Fully asynchronous architecture
- Type Safety: Built-in TypeScript support with Zod schemas
- Production Ready: Automatic retries and detailed logging
- Developer Friendly: Comprehensive error handling
Quick Start
Basic example
Store your API keys securely in environment variables. Use
.env
files and
libraries like dotenv
to load them into your app.Services
SmartScraper
Extract specific information from any webpage using AI:Parameters
Parameter | Type | Required | Description |
---|---|---|---|
apiKey | string | Yes | The ScrapeGraph API Key. |
websiteUrl | string | Yes | The URL of the webpage that needs to be scraped. |
prompt | string | Yes | A textual description of what you want to achieve. |
schema | object | No | The Pydantic or Zod object that describes the structure and format of the response. |
Basic Schema Example
Basic Schema Example
Define a simple schema using Zod:
Advanced Schema Example
Advanced Schema Example
Define a complex schema for nested data structures:
SearchScraper
Search and extract information from multiple web sources using AI:Parameters
Parameter | Type | Required | Description |
---|---|---|---|
apiKey | string | Yes | The ScrapeGraph API Key. |
prompt | string | Yes | A textual description of what you want to achieve. |
schema | object | No | The Pydantic or Zod object that describes the structure and format of the response |
Basic Schema Example
Basic Schema Example
Define a simple schema using Zod:
Advanced Schema Example
Advanced Schema Example
Define a complex schema for nested data structures:
Markdownify
Convert any webpage into clean, formatted markdown:Parameters
Parameter | Type | Required | Description |
---|---|---|---|
apiKey | string | Yes | The ScrapeGraph API Key. |
websiteUrl | string | Yes | The URL of the webpage to convert to markdown. |
API Credits
Check your available API credits:Feedback
Help us improve by submitting feedback programmatically:Support
License
License
This project is licensed under the MIT License. See the
LICENSE
file for details.