> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# AgentQL

> Scrape web page text or extract data with a custom query using AgentQLTools.

**AgentQLTools** enable an Agent to browse and scrape websites using the AgentQL API.

## Prerequisites

The following example requires the `agentql` library and an API token which can be obtained from [AgentQL](https://agentql.com/).

```shell theme={null}
uv pip install -U agentql openai
playwright install
```

```shell theme={null}
export AGENTQL_API_KEY=***
```

## Example

The following agent will open a web browser and scrape all the text from the page.

```python theme={null}
from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.tools.agentql import AgentQLTools

agent = Agent(
    model=OpenAIResponses(id="gpt-5.2"), tools=[AgentQLTools()]
)

agent.print_response("https://docs.agno.com/introduction", markdown=True)
```

> [!NOTE]
>
> AgentQL will open up a browser instance (don't close it) and do scraping on
> the site.

## Toolkit Params

| Parameter | Type | Default | Description |
| - | - | - | - |
| `api_key` | `str` | `None` | API key for AgentQL |
| `agentql_query` | `str` | `""` | Custom AgentQL query |
| `enable_scrape_website` | `bool` | `True` | Enable the scrape\_website functionality. |
| `enable_custom_scrape_website` | `bool` | `False` | Enable the custom\_scrape\_website functionality. Auto-enabled when `agentql_query` is set. |
| `all` | `bool` | `False` | Enable all functionality. |

## Toolkit Functions

| Function | Description |
| - | - |
| `scrape_website` | Used to scrape all text from a web page |
| `custom_scrape_website` | Uses the custom `agentql_query` to scrape a web page |

## Developer Resources

* [Tools](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/agentql.py)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.