Skip to content

Install

AgentQL provides both Python and JavaScript SDKs. Both depend on Playwright as the underlying browser driver.

Prerequisites

Python

1. Install the SDK:

bash
pip3 install agentql

2. Install the Playwright Chromium driver:

bash
playwright install chromium

3. Configure your API key (choose one method):

bash
# Option A: interactive CLI setup (prompts for key)
agentql init

# Option B: set environment variable directly
export AGENTQL_API_KEY=your-api-key

JavaScript

1. Install the SDK:

bash
npm install agentql

2. Install the AgentQL CLI (for agentql init):

bash
npm install -g agentql-cli

3. Install the Playwright Chromium driver:

bash
npx playwright install chromium

4. Configure your API key (choose one method):

bash
# Option A: interactive CLI setup (prompts for key)
agentql init

# Option B: set environment variable directly
export AGENTQL_API_KEY=your-api-key

In JavaScript you can also pass the key inline via configure():

javascript
const { configure } = require('agentql');
configure({ apiKey: process.env.AGENTQL_API_KEY });

Notes

  • The agentql init command prompts for your API key and writes it to a local config file so you do not need to set the environment variable on every shell.
  • All API calls are metered against your plan quota. Free trial includes 300 calls.