Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to AgentQL

Scalekit connector
Open markdown

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.

Tools
2
What they doRead · write · destructive
1 · 1 · 01 read1 write0 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .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.

  4. Authorize a user and make your first call

    quickstart.mts
    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)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their AgentQL credentials there. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • agentql_data_queryExtract structured data from a public web page (by url) or raw HTML (by html), using an AgentQL query or a natural-language prompt.Read-only

    Query Web Page Data

    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.

    Inputs

    browser_profilestring
    Browser profile: light (default) or stealth, which is harder for sites to detect as automation. Example: stealth.one of lightstealth
    htmlstring
    Raw HTML to query instead of fetching a URL. Example: <ul><li>Widget - $5</li></ul>.
    is_screenshot_enabledboolean
    Set true to also return a base64 screenshot of the page. Example: true.
    is_scroll_to_bottom_enabledboolean
    Set true to scroll to the bottom of the page before querying, to load lazy content. Example: true.
    modestring
    fast (default) or standard; standard is slower and more thorough on complex pages. Example: standard.one of faststandard
    promptstring
    Natural-language description of the data to extract. Use this or query. Example: The product names and prices on the page.
    proxyobject
    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"}.
    querystring
    AgentQL query describing the fields to extract. Use this or prompt. Example: { products[] { name price } }.
    urlstring
    Public URL of the page to query. Use this or html. Example: https://scrapeme.live/shop/.
    wait_fornumber
    Seconds to wait for the page to load before querying (default 0). Example: 2.
  • agentql_browser_session_createStart a remote Chrome browser session that you control over the Chrome DevTools Protocol, for example with Playwright connect_over_cdp.Write

    Create Browser Session

    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.

    Inputs

    browser_profilestring
    Browser profile: light (default) or stealth, which is harder for sites to detect as automation. Example: stealth.one of lightstealth
    browser_ua_presetstring
    Operating system the browser's user agent claims: windows, macos or linux (default). Example: windows.one of windowsmacoslinux
    inactivity_timeout_secondsinteger
    Seconds without activity before the session can end (default 300). Example: 600.
    proxyobject
    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_modestring
    When the session ends: on_disconnect (default, when the CDP client disconnects) or on_inactivity_timeout. Example: on_inactivity_timeout.one of on_disconnecton_inactivity_timeout