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
- API key
Setup
Install the SDK
Terminal window npm install @scalekit-sdk/node dotenvTerminal window pip install scalekit-sdk-python python-dotenvSet your credentials
Add your Scalekit credentials to your
.envfile. 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>Create the AgentQL connection
In AgentKit > Connections, create an AgentQL connection. The name you give it is the
connection_nameyour code passes. See Configure connections.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.actionsconst connector = 'agentql'const identifier = 'user_123'// Generate an authorization link for the userconst { 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 callconst result = await actions.executeTool({connector,identifier,toolName: 'agentql_data_query',toolInput: {},})console.log(result)Terminal window npx tsx quickstart.mtsquickstart.py import osfrom scalekit import ScalekitClientfrom dotenv import load_dotenvload_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.actionsconnection_name = "agentql"identifier = "user_123"# Generate an authorization link for the userlink_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 callresult = actions.execute_tool(tool_input={},tool_name="agentql_data_query",connection_name=connection_name,identifier=identifier,)print(result)Terminal window python quickstart.pyEach 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 toexecute_toolagentql_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-onlyQuery 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.WriteCreate 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
No tools match.