Airtop AI Query API

Query, extract, and scrape page content with AI.

OpenAPI Specification

airtop-ai-query-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Airtop AI Query API
  description: REST API for Airtop, a cloud-browser platform for AI agents. Create and manage remote Chromium browser sessions, open and navigate windows, drive pages with natural-language interactions (click, type, hover, scroll), query and extract page content with AI, capture screenshots, and persist state with profiles. All requests are authenticated with a Bearer API key.
  termsOfService: https://www.airtop.ai/legal/terms-of-service
  contact:
    name: Airtop Support
    url: https://docs.airtop.ai
  version: '1.0'
servers:
- url: https://api.airtop.ai/api/v1
  description: Airtop production API
security:
- bearerAuth: []
tags:
- name: AI Query
  description: Query, extract, and scrape page content with AI.
paths:
  /sessions/{sessionId}/windows/{windowId}/scrape:
    post:
      operationId: scrapeContent
      tags:
      - AI Query
      summary: Scrape content
      description: Scrapes the raw content of the page loaded in a window.
      parameters:
      - $ref: '#/components/parameters/SessionId'
      - $ref: '#/components/parameters/WindowId'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScrapeRequest'
      responses:
        '200':
          description: Scraped content.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIResponse'
  /sessions/{sessionId}/windows/{windowId}/page-query:
    post:
      operationId: pageQuery
      tags:
      - AI Query
      summary: Query a page
      description: Asks a natural-language question about the current page and returns an AI model response, optionally shaped by a JSON output schema.
      parameters:
      - $ref: '#/components/parameters/SessionId'
      - $ref: '#/components/parameters/WindowId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PageQueryRequest'
      responses:
        '200':
          description: The AI model response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIResponse'
  /sessions/{sessionId}/windows/{windowId}/paginated-extraction:
    post:
      operationId: paginatedExtraction
      tags:
      - AI Query
      summary: Query a page with pagination
      description: Extracts structured data from a page and follows pagination links to gather results across multiple pages.
      parameters:
      - $ref: '#/components/parameters/SessionId'
      - $ref: '#/components/parameters/WindowId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaginatedExtractionRequest'
      responses:
        '200':
          description: The extracted data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIResponse'
components:
  schemas:
    ScrapeRequest:
      type: object
      properties:
        clientRequestId:
          type: string
        costThresholdCredits:
          type: integer
        timeThresholdSeconds:
          type: integer
        configuration:
          type: object
    AIResponse:
      allOf:
      - $ref: '#/components/schemas/Envelope'
      - type: object
        properties:
          data:
            type: object
            properties:
              modelResponse:
                type: string
                description: The AI model's textual response to the prompt.
          meta:
            type: object
            properties:
              requestId:
                type: string
              status:
                type: string
              usage:
                type: object
                properties:
                  credits:
                    type: number
              screenshots:
                type: array
                items:
                  type: object
    PageQueryRequest:
      type: object
      properties:
        prompt:
          type: string
          description: The question or instruction for analyzing page content.
        clientRequestId:
          type: string
        followPaginationLinks:
          type: boolean
          default: false
        costThresholdCredits:
          type: integer
        timeThresholdSeconds:
          type: integer
        configuration:
          type: object
          properties:
            outputSchema:
              type: object
              description: JSON schema describing the desired structured output.
            scrape:
              type: object
            visualAnalysis:
              type: object
            experimental:
              type: object
      required:
      - prompt
    PaginatedExtractionRequest:
      type: object
      properties:
        prompt:
          type: string
        clientRequestId:
          type: string
        costThresholdCredits:
          type: integer
        timeThresholdSeconds:
          type: integer
        configuration:
          type: object
          properties:
            outputSchema:
              type: object
            paginationMode:
              type: string
              enum:
              - auto
              - paginated
              - infinite-scroll
      required:
      - prompt
    Envelope:
      type: object
      properties:
        meta:
          type: object
          properties:
            requestId:
              type: string
            status:
              type: string
        errors:
          type: array
          items:
            type: object
        warnings:
          type: array
          items:
            type: object
  parameters:
    SessionId:
      name: sessionId
      in: path
      required: true
      description: Identifier of the cloud browser session.
      schema:
        type: string
    WindowId:
      name: windowId
      in: path
      required: true
      description: Identifier of the window within the session.
      schema:
        type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Airtop API key supplied as a Bearer token in the Authorization header: `Authorization: Bearer YOUR_API_KEY`.'