openapi: 3.0.3 info: title: AgentQL API description: AgentQL connects LLMs and AI agents to the entire web through natural language queries, enabling structured data extraction from web pages, documents, and browser sessions. Generated from documentation. version: v1 x-generated-from: documentation servers: - url: https://api.agentql.com/v1 description: AgentQL Production API security: - ApiKeyAuth: [] paths: /query-data: post: operationId: queryWebPageData summary: AgentQL Query Web Page Data description: Extract structured JSON data from a web page using AgentQL query language or natural language prompt. Supports URL-based and raw HTML input with configurable browser behavior. tags: - Query Data requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/QueryDataRequest' examples: QueryDataRequest200Example: summary: Default queryWebPageData request x-microcks-default: true value: url: "https://news.ycombinator.com" query: "{ posts[] { title link score } }" params: mode: standard wait_for: 2000 responses: '200': description: Successful data extraction content: application/json: schema: $ref: '#/components/schemas/QueryDataResponse' examples: QueryWebPageData200Example: summary: Default queryWebPageData 200 response x-microcks-default: true value: data: posts: - title: "Show HN: AgentQL connects AI agents to the web" link: "https://news.ycombinator.com/item?id=500123" score: 142 metadata: request_id: "req-a1b2c3d4" response_time_ms: 1847 '400': description: Bad request — invalid query or missing required parameters content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '401': description: Unauthorized — invalid or missing API key content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '429': description: Rate limit exceeded content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' x-microcks-operation: delay: 0 dispatcher: FALLBACK /tetra/sessions: post: operationId: createRemoteBrowserSession summary: AgentQL Create Remote Browser Session description: Establish a managed remote Chrome browser session with Chrome DevTools Protocol (CDP) access for authenticated web automation and stealth browsing. tags: - Remote Browser requestBody: required: false content: application/json: schema: $ref: '#/components/schemas/CreateSessionRequest' examples: CreateRemoteBrowserSessionRequestExample: summary: Default createRemoteBrowserSession request x-microcks-default: true value: browser_ua_preset: macos browser_profile: stealth inactivity_timeout_seconds: 300 responses: '200': description: Browser session created successfully content: application/json: schema: $ref: '#/components/schemas/CreateSessionResponse' examples: CreateRemoteBrowserSession200Example: summary: Default createRemoteBrowserSession 200 response x-microcks-default: true value: session_id: "sess-a1b2c3d4e5f6" cdp_url: "wss://tetra.agentql.com/sessions/sess-a1b2c3d4e5f6/cdp" expires_at: "2026-04-19T15:30:00Z" '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' x-microcks-operation: delay: 0 dispatcher: FALLBACK /query-document: post: operationId: queryDocument summary: AgentQL Query Document description: Extract structured data from PDF documents or images (JPEG, PNG) using AgentQL query language or natural language prompts. tags: - Query Document requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/QueryDocumentRequest' examples: QueryDocumentRequestExample: summary: Default queryDocument request x-microcks-default: true value: url: "https://example.com/invoice.pdf" query: "{ invoice { total_amount vendor_name date items[] { description amount } } }" responses: '200': description: Successful document extraction content: application/json: schema: $ref: '#/components/schemas/QueryDataResponse' examples: QueryDocument200Example: summary: Default queryDocument 200 response x-microcks-default: true value: data: invoice: total_amount: 4250.00 vendor_name: "Acme Corp" date: "2026-04-01" items: - description: "Professional Services" amount: 4000.00 - description: "Travel Expenses" amount: 250.00 metadata: request_id: "req-d4e5f6a1" response_time_ms: 2103 '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' x-microcks-operation: delay: 0 dispatcher: FALLBACK components: securitySchemes: ApiKeyAuth: type: apiKey in: header name: X-API-Key description: API key from the AgentQL Dev Portal (https://dev.agentql.com) schemas: QueryDataRequest: type: object description: Request body for querying data from a web page. properties: url: type: string format: uri description: The URL of the web page to query. example: "https://news.ycombinator.com" html: type: string description: Raw HTML content to query instead of a URL. example: "

Hello World

" query: type: string description: AgentQL query string for structured data extraction. example: "{ posts[] { title link score } }" prompt: type: string description: Natural language description of the data to extract (alternative to query). example: "Extract the top 10 posts with their titles, links, and scores" params: $ref: '#/components/schemas/QueryParams' QueryParams: type: object description: Optional configuration parameters for the query. properties: mode: type: string enum: [fast, standard] description: Extraction speed mode. Fast is quicker but may miss dynamic content. example: standard wait_for: type: integer description: Milliseconds to wait for dynamic content to load before extraction. example: 2000 scroll_to_bottom: type: boolean description: If true, scroll to the bottom of the page before extraction. example: false include_screenshot: type: boolean description: If true, include a base64-encoded screenshot in the response. example: false browser_profile: type: string enum: [light, stealth] description: Browser profile to use for the request. example: light CreateSessionRequest: type: object description: Request body for creating a remote browser session. properties: browser_ua_preset: type: string enum: [windows, macos, linux] description: Operating system to simulate in the browser user agent. example: macos browser_profile: type: string enum: [light, stealth] description: Browser behavior profile. example: stealth inactivity_timeout_seconds: type: integer description: Seconds of inactivity before the session is automatically terminated. example: 300 proxy: type: object description: Proxy configuration for the browser session. properties: type: type: string enum: [tetra, custom] example: tetra CreateSessionResponse: type: object description: Response containing the remote browser session details. properties: session_id: type: string description: Unique identifier for the created session. example: "sess-a1b2c3d4e5f6" cdp_url: type: string format: uri description: WebSocket URL for Chrome DevTools Protocol access. example: "wss://tetra.agentql.com/sessions/sess-a1b2c3d4/cdp" expires_at: type: string format: date-time description: ISO 8601 timestamp when the session will expire. example: "2026-04-19T15:30:00Z" QueryDocumentRequest: type: object description: Request body for querying data from a document. properties: url: type: string format: uri description: URL of the document to query (PDF or image). example: "https://example.com/invoice.pdf" query: type: string description: AgentQL query string for structured data extraction. example: "{ invoice { total_amount vendor_name date } }" prompt: type: string description: Natural language description of the data to extract. example: "Extract invoice totals and vendor information" QueryDataResponse: type: object description: Response containing extracted structured data. properties: data: type: object description: Extracted data matching the structure defined in the query. metadata: $ref: '#/components/schemas/ResponseMetadata' ResponseMetadata: type: object description: Metadata about the API response. properties: request_id: type: string description: Unique identifier for this API request. example: "req-a1b2c3d4" response_time_ms: type: integer description: Time taken to complete the request in milliseconds. example: 1847 ErrorResponse: type: object description: Error response returned when a request fails. properties: error: type: string description: Error type or code. example: "invalid_query" message: type: string description: Human-readable error description. example: "The provided query is not valid AgentQL syntax." request_id: type: string description: Request ID for debugging. example: "req-a1b2c3d4" tags: - name: Query Data description: Extract structured data from web pages using AgentQL queries - name: Remote Browser description: Manage remote Chrome browser sessions with CDP access - name: Query Document description: Extract structured data from PDF and image documents