Skip to main content

Main Concepts

To fully grasp the capabilities of AgentQL and how it can revolutionize working with the Web, it's essential to understand its core concepts. This guide will walk you through the main components of AgentQL, including the AgentQL Query, Chrome Extension, and AgentQL SDK, and explain how they work together to simplify and enhance web scraping and web automation tasks.

At the high level, AgentQL consists of the following components:

  • AgentQL Query - A query language that simplifies the process of locating web elements.
  • Chrome Extension - A tool for writing and testing AgentQL queries in real time.
  • AgentQL SDK - A Python SDK for integrating AgentQL queries into automation scripts.

AgentQL Query


The AgentQL Query is the core concept of AgentQL, designed to give users an easy way to describe what web elements to locate on the given web page. It addresses two main aspects:

  1. Defining what needs to be found: The query specifies which web elements to locate and interact with.
  2. Response format structure: It determines the structure of the responses, making it easy to extract and use the desired data.

Defining Web Elements

AgentQL queries use a simple, natural language-like syntax to define the elements you want to interact with on a webpage. This approach abstracts away the complexity of DOM traversal, allowing you to focus on the elements that matter.

Example Query:

QUERY = """

In this query, search_input_field, search_button, and about_link are the elements being located. This simplicity makes it easy to write and understand queries.

Defining Response Format

The response from an AgentQL query is structured according to the specified AgentQL Query, providing a clear and organized format that can be easily parsed and used in further automation tasks.

Example Response Handling:

response = session.query(QUERY)
response.search_input_field.fill("Top movies in 2024")

This structure ensures that the data returned is exactly what you need, in a format that is ready for immediate use.

To learn more about AgentQL queries, refer to the AgentQL Query Language documentation.

Chrome Extension

Main Playground for Iterating on AgentQL Queries

The AgentQL Chrome Extension serves as a powerful tool for developers to write and test AgentQL queries in real-time. It provides an interactive environment where you can see the immediate results of your queries, making it easier to debug and refine them.

Key Features

  • Immediate Feedback: Write queries and see the elements AgentQL finds in real-time.
  • Interactive Debugging: Quickly identify and fix issues with your queries.
  • User-Friendly Interface: Designed to be intuitive, the extension allows you to focus on developing effective queries without getting bogged down by complex configurations.

Using the Chrome Extension, developers can efficiently iterate on their queries, ensuring they work correctly before integrating them into larger automation scripts.

Please refer to the AgentQL Chrome Extension documentation for detailed instructions on how to install and use the extension.


Taking Automation to the Next Level

The AgentQL SDK is intended for developers who want to incorporate AgentQL queries into their programmatic scripts. It provides a robust set of tools for working with raw AgentQL response and writing sophisticated web scraping and automation tasks using AgentQL.

Features and Benefits

  • Programmatic Access: Integrate AgentQL queries directly into your Python scripts.
  • Comprehensive Documentation: Detailed guides and references to help you get the most out of the SDK.
  • Asynchronous and Synchronous Support: Flexible options to suit different web scraping and automation needs.

Example Script Using SDK:

import agentql

session = agentql.start_session("")
QUERY = """
response = session.query(QUERY)
response.search_input_field.fill("Top movies in 2024")

The SDK extends the capabilities of AgentQL, enabling the creation of complex automation workflows that are both powerful and efficient.


Understanding these main concepts—AgentQL Query, Chrome Extension, and AgentQL SDK—is crucial for leveraging the full power of AgentQL in your web automation tasks. Each component plays a distinct role in simplifying and enhancing the development process, making AgentQL an indispensable tool for modern web automation.

For more detailed information, visit our Github repository with a collection of examples or refer to AgentQL SDK API Documentation.