{
  "openapi": "3.0.1",
  "info": {
    "title": "Web Screenshot, Visual Diff & AI Annotator API",
    "description": "Capture crisp full-page or element screenshots, catch competitor pricing and UI changes automatically with highlighted visual diffs, label clickable controls for AI vision agents, or export pages to PDF. Pay only for delivered captures ($0 on broken URLs).",
    "version": "1.0",
    "x-build-id": "6hZrkqOpPaXv6ed49"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/alias_md5~web-screenshot-visual-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-alias_md5-web-screenshot-visual-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/alias_md5~web-screenshot-visual-api/runs": {
      "post": {
        "operationId": "runs-sync-alias_md5-web-screenshot-visual-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/alias_md5~web-screenshot-visual-api/run-sync": {
      "post": {
        "operationId": "run-sync-alias_md5-web-screenshot-visual-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "Capture Mode",
            "enum": [
              "screenshot",
              "ai_annotate",
              "visual_diff",
              "pdf_export"
            ],
            "type": "string",
            "description": "Select the visual processing workflow: lossless screenshots, AI Set-of-Mark element annotation, pixel-exact visual regression diff, or vector PDF/MHTML document export.",
            "default": "screenshot"
          },
          "urls": {
            "title": "Target Web Page URLs",
            "type": "array",
            "description": "One or more public HTTP(S) web page URLs to capture, annotate, or export. Duplicates are removed automatically. Broken or 404 URLs are skipped at $0.",
            "items": {
              "type": "string"
            },
            "default": [
              "https://example.com"
            ]
          },
          "diffPairs": {
            "title": "Visual Diff Pairs (Batch Mode)",
            "type": "array",
            "description": "For visual_diff mode: list of comparison pairs with targetUrl plus either baselineUrl (live web page) or baselineImageUrl (reference lossless PNG URL).",
            "items": {
              "type": "object"
            }
          },
          "baselineUrl": {
            "title": "Baseline Page URL (Single Visual Diff)",
            "type": "string",
            "description": "Optional single baseline web page URL to compare against targetUrl in visual_diff mode."
          },
          "baselineImageUrl": {
            "title": "Baseline Reference PNG URL (Single Visual Diff)",
            "type": "string",
            "description": "Optional direct URL to an existing lossless PNG baseline image to compare against targetUrl in visual_diff mode."
          },
          "targetUrl": {
            "title": "Target Page URL (Single Visual Diff)",
            "type": "string",
            "description": "Target web page URL to compare against baselineUrl or baselineImageUrl in visual_diff mode."
          },
          "channelThreshold": {
            "title": "Per-Channel Pixel Tolerance (0–255)",
            "minimum": 0,
            "maximum": 255,
            "type": "integer",
            "description": "Per-channel RGBA delta threshold (0 = strict bit-exact pixel comparison).",
            "default": 0
          },
          "failThresholdPercent": {
            "title": "Pass Threshold (% Mismatched Pixels)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "Maximum mismatch percentage allowed for diff.passed to be true (0 = zero differing pixels allowed).",
            "default": 0
          },
          "includeSourceSnapshots": {
            "title": "Save Baseline & Target Snapshots",
            "type": "boolean",
            "description": "When enabled, saves baseline and target PNGs alongside the highlighted diff PNG in Key-Value Storage.",
            "default": true
          },
          "viewportPreset": {
            "title": "Viewport Preset",
            "enum": [
              "desktop",
              "mobile",
              "tablet",
              "custom"
            ],
            "type": "string",
            "description": "Standard device viewport preset or custom dimensions.",
            "default": "desktop"
          },
          "viewportWidth": {
            "title": "Custom Viewport Width (px)",
            "minimum": 200,
            "maximum": 3840,
            "type": "integer",
            "description": "Optional custom CSS viewport width in pixels (200–3840)."
          },
          "viewportHeight": {
            "title": "Custom Viewport Height (px)",
            "minimum": 200,
            "maximum": 4320,
            "type": "integer",
            "description": "Optional custom CSS viewport height in pixels (200–4320)."
          },
          "deviceScaleFactor": {
            "title": "Device Scale Factor (1x or 2x Retina)",
            "minimum": 1,
            "maximum": 2,
            "type": "integer",
            "description": "Pixel density multiplier: 1 for standard resolution or 2 for crisp Retina captures.",
            "default": 1
          },
          "fullPage": {
            "title": "Full-Page Capture",
            "type": "boolean",
            "description": "Capture the full scrollable height of the web page instead of only the visible viewport.",
            "default": false
          },
          "selector": {
            "title": "Element CSS Selector (Optional Crop)",
            "type": "string",
            "description": "Optional CSS selector to capture and crop a specific element on the page."
          },
          "format": {
            "title": "Screenshot Image Format",
            "enum": [
              "png",
              "jpeg",
              "webp"
            ],
            "type": "string",
            "description": "Output image encoding for screenshot mode. PNG preserves bit-exact lossless fidelity (maxChannelDelta = 0).",
            "default": "png"
          },
          "quality": {
            "title": "JPEG / WebP Compression Quality (1–100)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Compression quality applied when format is jpeg or webp.",
            "default": 90
          },
          "hideCookieBanners": {
            "title": "Hide Cookie Consent Banners",
            "type": "boolean",
            "description": "Automatically hide common cookie consent banners and privacy popups before capture.",
            "default": true
          },
          "darkMode": {
            "title": "Emulate Dark Color Scheme",
            "type": "boolean",
            "description": "Request prefers-color-scheme: dark while rendering pages.",
            "default": false
          },
          "waitUntil": {
            "title": "Page Readiness Strategy",
            "enum": [
              "load",
              "domContentLoaded",
              "networkIdle"
            ],
            "type": "string",
            "description": "Lifecycle event to wait for before capturing the page.",
            "default": "load"
          },
          "waitForSelector": {
            "title": "Wait for CSS Selector (Optional)",
            "type": "string",
            "description": "Optional CSS selector that must become visible before capture starts."
          },
          "delayMs": {
            "title": "Extra Settle Delay (ms)",
            "minimum": 0,
            "maximum": 15000,
            "type": "integer",
            "description": "Optional additional pause in milliseconds (0–15000) after page load before capture.",
            "default": 0
          },
          "timeoutSeconds": {
            "title": "Navigation Timeout (Seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Maximum time in seconds to wait for each target URL (5–120).",
            "default": 30
          },
          "maxElements": {
            "title": "Max Annotated Interactive Elements",
            "minimum": 1,
            "maximum": 250,
            "type": "integer",
            "description": "Maximum number of visible interactive elements to label in ai_annotate mode (1–250).",
            "default": 60
          },
          "labelPrefix": {
            "title": "Element Badge Prefix",
            "type": "string",
            "description": "Short prefix printed on element badges (for example E produces E1, E2, E3).",
            "default": "E"
          },
          "borderWidth": {
            "title": "Bounding Box Border Width (px)",
            "minimum": 1,
            "maximum": 6,
            "type": "integer",
            "description": "Stroke width in pixels for drawn annotation boxes (1–6).",
            "default": 2
          },
          "includeCleanScreenshot": {
            "title": "Also Save Unannotated Clean PNG",
            "type": "boolean",
            "description": "When enabled in ai_annotate mode, stores the original unannotated PNG alongside the annotated PNG.",
            "default": false
          },
          "exportFormat": {
            "title": "Document Archive Format",
            "enum": [
              "pdf",
              "mhtml"
            ],
            "type": "string",
            "description": "Select vector PDF or single-file MHTML archive for pdf_export mode.",
            "default": "pdf"
          },
          "paperFormat": {
            "title": "PDF Paper Size",
            "enum": [
              "A4",
              "Letter",
              "Legal",
              "Tabloid"
            ],
            "type": "string",
            "description": "Standard paper format used for PDF export.",
            "default": "A4"
          },
          "landscape": {
            "title": "Landscape Orientation",
            "type": "boolean",
            "description": "Print PDF pages in landscape orientation.",
            "default": false
          },
          "printBackground": {
            "title": "Print Background Graphics",
            "type": "boolean",
            "description": "Include CSS background colors and images in exported PDFs.",
            "default": true
          },
          "marginInches": {
            "title": "PDF Page Margins (Inches)",
            "minimum": 0,
            "maximum": 3,
            "type": "number",
            "description": "Uniform top/bottom/left/right page margin in inches (0–3).",
            "default": 0.4
          },
          "pageRanges": {
            "title": "PDF Page Ranges (Optional)",
            "type": "string",
            "description": "Optional page ranges to export (for example 1-3, 5). Leave empty for all pages."
          },
          "includeTextSummary": {
            "title": "Include Page Text Summary",
            "type": "boolean",
            "description": "Attach normalized page text excerpt and word count alongside exported PDF/MHTML records.",
            "default": true
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}