Official SDKs
JavaScript SDK
Official JavaScript/TypeScript SDK for ScrapeGraphAI
Installation
Install the package using npm or yarn:
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. |
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 |
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
Was this page helpful?