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

# AgentQL

**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
```

```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 cookbook/14_tools/agentql_tools.py 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.
</Note>

## Toolkit Params

| Parameter                      | Type   | Default | Description                                       |
| ------------------------------ | ------ | ------- | ------------------------------------------------- |
| `api_key`                      | `str`  | `None`  | API key for AgentQL                               |
| `scrape`                       | `bool` | `True`  | Whether to use the scrape text tool               |
| `agentql_query`                | `str`  | `None`  | Custom AgentQL query                              |
| `enable_scrape_website`        | `bool` | `True`  | Enable the scrape\_website functionality.         |
| `enable_custom_scrape_website` | `bool` | `True`  | Enable the custom\_scrape\_website functionality. |
| `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

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