---
title: "Query Data Service"
method: POST
path: "/query-data"
tags: ["AgentQL REST API"]
---

# Query Data Service

`POST /query-data`

Get the AgentQL response for the data query.

If the AQL query is not provided, generate it using the prompt from request.

## Headers

- `X-TF-Request-Origin` string
- `content-type` string, required

## Request body

- RestWebPageQueryRequest
  - `query` string, nullable — AgentQL query
  - `prompt` string, nullable — A description of expected data to be extracted
  - `url` string, nullable — The URL of the webpage to query
  - `html` string, nullable — The HTML of the webpage to query
  - `params` RestUrlQueryParams
    - `mode` 'fast' | 'standard' — FAST: Uses a faster pipeline for generating the response. STANDARD: Uses the standard pipeline for generating the response.
    - `wait_for` integer — Wait for the page to load content for a specified duration (in seconds). Maximum wait time is 10 seconds
    - `is_scroll_to_bottom_enabled` boolean — Indicates whether scroll to the bottom of the page before capturing the snapshot is enabled
    - `is_screenshot_enabled` boolean — Indicates whether screenshot capture is enabled
    - `browser_profile` 'light' | 'stealth' | 'tf-browser' — Browser profile types. LIGHT provides fast headless browsing for standard automation. STEALTH provides enhanced anti-detection capabilities with full browser features TF_BROWSER provides agent-focused capabilities with full browser features.
    - `proxy` union — Proxy configuration for the browser session
      - TetraProxy — Tetra built-in proxy configuration
        - `type` 'tetra' — Type of proxy: 'tetra' for built-in proxy
        - `country_code` string — Country code for tetra proxy
      - CustomProxy — Custom external proxy configuration
        - `type` 'custom' — Type of proxy: 'custom' for external proxy
        - `url` string, required — Proxy server URL
        - `username` string, nullable — Username for proxy authentication
        - `password` string, nullable — Password for proxy authentication

## Response `200`

Successful Response

- RestQueryResponse
  - `data` object, required
  - `metadata` ResponseMetadata
    - `request_id` string
    - `generated_query` string, nullable
    - `screenshot` string, nullable

## Other responses

- `4XX` — Client Error

---

[API](https://skmtc.dev/agentql/apis/agentql-api.md) · [All operations](https://skmtc.dev/agentql/apis/agentql-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/agentql/agentql-api/revisions/d7edf0ed4272/schema)
