Appearance
Install
AgentQL provides both Python and JavaScript SDKs. Both depend on Playwright as the underlying browser driver.
Prerequisites
- An AgentQL API key from https://dev.agentql.com/
- Python 3.8+ (for Python SDK) or Node.js (for JavaScript SDK)
Python
1. Install the SDK:
bash
pip3 install agentql2. Install the Playwright Chromium driver:
bash
playwright install chromium3. 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-keyJavaScript
1. Install the SDK:
bash
npm install agentql2. Install the AgentQL CLI (for agentql init):
bash
npm install -g agentql-cli3. Install the Playwright Chromium driver:
bash
npx playwright install chromium4. 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-keyIn 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 initcommand 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.