Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
AgentQL is a tool that allows you to extract structured data from webpages using AI Agents.
pip install langchain_agentql langchain-community
os.environ["AGENTQL_API_KEY"] = "your_api_key_here"
from praisonaiagents import Agent, AgentTeam
from langchain_agentql.tools import ExtractWebDataTool
from dotenv import load_dotenv
import os
os.environ["AGENTQL_API_KEY"] = os.getenv('AGENTQL_API_KEY')
def extract_web_data_tool(url, query):
agentql_tool = ExtractWebDataTool().invoke(
{
"url": url,
"prompt": query,
},)
return agentql_tool
# Create agent with web extraction instructions
orchestration_agent = Agent(
instructions="""Extract All 37 products from the url https://www.colorbarcosmetics.com/bestsellers along with its name, overview, description, price and additional information by recursively clicking on each product""",
tools=[extract_web_data_tool]
)
# Initialize and run agents
agents = AgentTeam(agents=[orchestration_agent])
agents.start()
Getting Started
- Get your AgentQL API key from AgentQL Dashboard
- Set the API key in your environment variables
- Install the required dependencies
- Use the example code to start extracting structured data