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

# Camel.loaders.scrapegraph reader

<a id="camel.loaders.scrapegraph_reader" />

<a id="camel.loaders.scrapegraph_reader.ScrapeGraphAI" />

## ScrapeGraphAI

```python theme={"system"}
class ScrapeGraphAI:
```

ScrapeGraphAI allows you to perform AI-powered web scraping and
searching.

**Parameters:**

* **api\_key** (Optional\[str]): API key for authenticating with the ScrapeGraphAI API.
* **References**:
* **https**: //scrapegraph.ai/

<a id="camel.loaders.scrapegraph_reader.ScrapeGraphAI.__init__" />

### **init**

```python theme={"system"}
def __init__(self, api_key: Optional[str] = None):
```

<a id="camel.loaders.scrapegraph_reader.ScrapeGraphAI.search" />

### search

```python theme={"system"}
def search(self, user_prompt: str):
```

Perform an AI-powered web search using ScrapeGraphAI.

**Parameters:**

* **user\_prompt** (str): The search query or instructions.

**Returns:**

Dict\[str, Any]: The search results including answer and reference
URLs.

<a id="camel.loaders.scrapegraph_reader.ScrapeGraphAI.scrape" />

### scrape

```python theme={"system"}
def scrape(
    self,
    website_url: str,
    user_prompt: str,
    website_html: Optional[str] = None
):
```

Perform AI-powered web scraping using ScrapeGraphAI.

**Parameters:**

* **website\_url** (str): The URL to scrape.
* **user\_prompt** (str): Instructions for what data to extract.
* **website\_html** (Optional\[str]): Optional HTML content to use instead of fetching from the URL.

**Returns:**

Dict\[str, Any]: The scraped data including request ID and result.

<a id="camel.loaders.scrapegraph_reader.ScrapeGraphAI.close" />

### close

```python theme={"system"}
def close(self):
```

Close the ScrapeGraphAI client connection.
