> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langchain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ScrapeGraph AI integrations

> Integrate with ScrapeGraph AI using LangChain Python.

> [ScrapeGraph AI](https://scrapegraphai.com) is a service that provides AI-powered web scraping capabilities.
> It offers tools for extracting structured data, converting webpages to markdown, and processing local HTML content
> using natural language prompts.

## Installation and setup

Install the required packages:

<CodeGroup>
  ```bash pip theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  pip install langchain-scrapegraph
  ```

  ```bash uv theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  uv add langchain-scrapegraph
  ```
</CodeGroup>

Set up your API key:

```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
export SGAI_API_KEY="your-scrapegraph-api-key"
```

## Tools

See a [usage example](/oss/python/integrations/tools/scrapegraph).

There are four tools available:

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
from langchain_scrapegraph.tools import (
    SmartScraperTool,    # Extract structured data from websites
    SmartCrawlerTool,    # Extract data from multiple pages with crawling
    MarkdownifyTool,     # Convert webpages to markdown
    AgenticScraperTool,  # Extract specifying steps
    GetCreditsTool,      # Check remaining API credits
)
```

Each tool serves a specific purpose:

* `SmartScraperTool`: Extract structured data from websites given a URL, prompt and optional output schema
* `SmartCrawlerTool`: Extract data from multiple pages with advanced crawling options like depth control, page limits, and domain restrictions
* `MarkdownifyTool`: Convert any webpage to clean markdown format
* `AgenticScraperTool`: Extract specifying steps
* `GetCreditsTool`: Check your remaining ScrapeGraph AI credits

***

<div className="source-links">
  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>

  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/oss/python/integrations/providers/scrapegraph.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
