> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to AgentQL

The AgentQL connector lets your AI agent act in each user's AgentQL account. Each user connects their own AgentQL API key once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 2 tools.

**Authentication:** API Key
**Categories:** Developer Tools, AI
**Tools:** 2: 1 read, 1 write, 0 destructive
**Users sign in with:** API key
**Built by:** Scalekit connector
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=AGENTQL)

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
   SCALEKIT_CLIENT_ID=<your-client-id>
   SCALEKIT_CLIENT_SECRET=<your-client-secret>
   ```

3. ### Create the AgentQL connection

   In **AgentKit > Connections**, create an AgentQL connection. The name you give it is the `connection_name` your code passes. See [Configure connections](/agentkit/connections/).

4. ### Authorize a user and make your first call

   **Node.js** (`quickstart.mts`)

   ```typescript
   import { ScalekitClient } from '@scalekit-sdk/node'
   import 'dotenv/config'
   import { createInterface } from 'node:readline/promises'

   const scalekit = new ScalekitClient(
     process.env.SCALEKIT_ENVIRONMENT_URL,
     process.env.SCALEKIT_CLIENT_ID,
     process.env.SCALEKIT_CLIENT_SECRET,
   )
   const actions = scalekit.actions

   const connector = 'agentql'
   const identifier = 'user_123'

   // Generate an authorization link for the user
   const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
   console.log('Authorize AgentQL:', link)
   const rl = createInterface({ input: process.stdin, output: process.stdout })
   await rl.question('Press Enter after authorizing...')
   rl.close()

   // Make your first call
   const result = await actions.executeTool({
     connector,
     identifier,
     toolName: 'agentql_data_query',
     toolInput: {},
   })
   console.log(result)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_dotenv()

   scalekit_client = ScalekitClient(
       env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),
       client_id=os.getenv("SCALEKIT_CLIENT_ID"),
       client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),
   )
   actions = scalekit_client.actions

   connection_name = "agentql"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_response = actions.get_authorization_link(
       connection_name=connection_name,
       identifier=identifier,
   )
   print("Authorize AgentQL:", link_response.link)
   input("Press Enter after authorizing...")

   # Make your first call
   result = actions.execute_tool(
       tool_input={},
       tool_name="agentql_data_query",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user opens the link once and enters their AgentQL credentials there. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'agentql_data_query',
  toolInput: {},
  connector: 'agentql',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="agentql_data_query",
    tool_input={},
    connection_name="agentql",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `agentql_data_query`

Query Web Page Data · Read-only

Extract structured data from a public web page (by url) or raw HTML (by html), using an AgentQL query or a natural-language prompt.
Returns data shaped like the query, plus metadata.request_id and metadata.screenshot (base64, when enabled).
Use this to scrape a page into JSON. Give either query or prompt, and either url or html.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `browser_profile` (`string`, optional): Browser profile: light (default) or stealth, which is harder for sites to detect as automation. Example: stealth. One of: `light`, `stealth`.
- `html` (`string`, optional): Raw HTML to query instead of fetching a URL. Example: <ul><li>Widget - $5</li></ul>.
- `is_screenshot_enabled` (`boolean`, optional): Set true to also return a base64 screenshot of the page. Example: true.
- `is_scroll_to_bottom_enabled` (`boolean`, optional): Set true to scroll to the bottom of the page before querying, to load lazy content. Example: true.
- `mode` (`string`, optional): fast (default) or standard; standard is slower and more thorough on complex pages. Example: standard. One of: `fast`, `standard`.
- `prompt` (`string`, optional): Natural-language description of the data to extract. Use this or query. Example: The product names and prices on the page.
- `proxy` (`object`, optional): Proxy for the browser: {"type": "tetra"} for AgentQL's built-in proxy (optional country_code such as us), or {"type": "custom", "url": "http://proxy.example.com:8080"} with optional username and password. Example: {"type": "tetra", "country_code": "us"}.
- `query` (`string`, optional): AgentQL query describing the fields to extract. Use this or prompt. Example: { products[] { name price } }.
- `url` (`string`, optional): Public URL of the page to query. Use this or html. Example: https://scrapeme.live/shop/.
- `wait_for` (`number`, optional): Seconds to wait for the page to load before querying (default 0). Example: 2.

Example input: `{}`

### `agentql_browser_session_create`

Create Browser Session · Write

Start a remote Chrome browser session that you control over the Chrome DevTools Protocol, for example with Playwright connect_over_cdp.
Returns session_id, cdp_url (to connect to) and base_url (for session resources and streaming).
Use this for multi-step browsing. Use Query Web Page Data to extract data from one page.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `browser_profile` (`string`, optional): Browser profile: light (default) or stealth, which is harder for sites to detect as automation. Example: stealth. One of: `light`, `stealth`.
- `browser_ua_preset` (`string`, optional): Operating system the browser's user agent claims: windows, macos or linux (default). Example: windows. One of: `windows`, `macos`, `linux`.
- `inactivity_timeout_seconds` (`integer`, optional): Seconds without activity before the session can end (default 300). Example: 600.
- `proxy` (`object`, optional): Proxy for the browser: {"type": "tetra"} for AgentQL's built-in proxy (optional country_code such as us), or {"type": "custom", "url": "http://proxy.example.com:8080"} with optional username and password. Example: {"type": "tetra", "country_code": "us"}.
- `shutdown_mode` (`string`, optional): When the session ends: on_disconnect (default, when the CDP client disconnects) or on_inactivity_timeout. Example: on_inactivity_timeout. One of: `on_disconnect`, `on_inactivity_timeout`.

Example input: `{}`

## Related

Other Developer Tools connectors ([all 200](/agentkit/connectors/?category=developer-tools)):

- [GitHub](/agentkit/connectors/github/): Scalekit connector, OAuth, 217 tools
- [Datadog](/agentkit/connectors/datadog/): Scalekit connector, API key, 105 tools
- [Linear](/agentkit/connectors/linear/): Scalekit connector, OAuth, 64 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
