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.

pip install -U agentql
export AGENTQL_API_KEY=***

Example

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

cookbook/tools/agentql_tools.py
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.agentql import AgentQLTools

agent = Agent(
    model=OpenAIChat(id="gpt-4o"), tools=[AgentQLTools()], show_tool_calls=True
)

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

AgentQL will open up a browser instance (don’t close it) and do scraping on the site.

Toolkit Params

ParameterTypeDefaultDescription
api_keystrNoneAPI key for AgentQL
scrapeboolTrueWhether to use the scrape text tool
agentql_querystrNoneCustom AgentQL query

Toolkit Functions

FunctionDescription
scrape_websiteUsed to scrape all text from a web page
custom_scrape_websiteUses the custom agentql_query to scrape a web page

Developer Resources