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.
1uv pip install -U agentql1export AGENTQL_API_KEY=***Example
The following agent will open a web browser and scrape all the text from the page.
1from kern.agent import Agent2from kern.models.openai import OpenAIResponses3from kern.tools.agentql import AgentQLTools45agent = Agent(6 model=OpenAIResponses(id="gpt-5.2"), tools=[AgentQLTools()]7)89agent.print_response("https://kern.ndx.rocks/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 |
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