{
  "openapi": "3.0.1",
  "info": {
    "title": "Visual + Text Change Monitor (screenshot diff)",
    "description": "Screenshot and text change monitor: each run compares a page with the previous run and returns the percentage changed, the changed regions, a highlighted diff image, before and after screenshots and a text diff. Ignore selectors for ads and timestamps.",
    "version": "1.0",
    "x-build-id": "qxVuP8O396Lvlwmzs"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/saksham1341~visual-change-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-saksham1341-visual-change-monitor",
        "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/saksham1341~visual-change-monitor/runs": {
      "post": {
        "operationId": "runs-sync-saksham1341-visual-change-monitor",
        "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/saksham1341~visual-change-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-saksham1341-visual-change-monitor",
        "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",
        "required": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "URLs",
            "type": "array",
            "description": "Pages to watch. Each page is compared with its own previous snapshot.",
            "items": {
              "type": "string"
            }
          },
          "stateKey": {
            "title": "State store name",
            "type": "string",
            "description": "Name of the key-value store in your account that keeps the last snapshot of each URL. Use different names for separate watch lists. Lowercase letters, digits and hyphens.",
            "default": "visual-change-monitor-state"
          },
          "alwaysReturn": {
            "title": "Always return a result",
            "type": "boolean",
            "description": "Return an item for every URL, also when nothing changed. Off: only changed URLs (and first-run baselines) are returned.",
            "default": false
          },
          "textOnly": {
            "title": "Text-only mode",
            "type": "boolean",
            "description": "Compare only the visible text, no screenshot. Cheaper: only the per-URL check is charged.",
            "default": false
          },
          "viewport": {
            "title": "Viewport",
            "enum": [
              "desktop",
              "tablet",
              "mobile"
            ],
            "type": "string",
            "description": "Desktop 1440x900, tablet 820x1180 or mobile 390x844 (mobile/tablet emulate a touch device).",
            "default": "desktop"
          },
          "viewportWidth": {
            "title": "Custom viewport width (px)",
            "minimum": 320,
            "maximum": 3840,
            "type": "integer",
            "description": "Optional. Overrides the preset's width."
          },
          "fullPage": {
            "title": "Full page",
            "type": "boolean",
            "description": "Capture the whole scrollable page. Off: only the first screen (above the fold).",
            "default": true
          },
          "maxPageHeight": {
            "title": "Maximum page height (px)",
            "minimum": 500,
            "maximum": 30000,
            "type": "integer",
            "description": "Full-page captures are cut at this height. Longer pages are flagged with heightTruncated.",
            "default": 15000
          },
          "waitFor": {
            "title": "Wait strategy",
            "enum": [
              "networkidle",
              "selector",
              "delay"
            ],
            "type": "string",
            "description": "When to take the snapshot after the page loads: when the network is idle (at most 20 s), when a CSS selector appears, or after a fixed delay.",
            "default": "networkidle"
          },
          "waitSelector": {
            "title": "Wait for selector",
            "type": "string",
            "description": "Used when the wait strategy is 'CSS selector appears', e.g. #main-content."
          },
          "waitMs": {
            "title": "Fixed delay (ms)",
            "minimum": 0,
            "maximum": 60000,
            "type": "integer",
            "description": "Used when the wait strategy is 'Fixed delay'.",
            "default": 2000
          },
          "ignoreSelectors": {
            "title": "Ignore these elements (CSS selectors)",
            "type": "array",
            "description": "Ads, timestamps, carousels, cookie banners: these are painted over in the screenshot and removed from the text before comparing.",
            "items": {
              "type": "string"
            }
          },
          "pixelThreshold": {
            "title": "Pixel threshold (%)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "How different a pixel's colour must be (0-100 % of the full range) to count as changed. Raise it to ignore anti-aliasing and compression noise.",
            "default": 10
          },
          "minChangedPercent": {
            "title": "Minimum changed area (%)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "A visual change is reported only when at least this share of the page changed. Text changes are always reported.",
            "default": 0.1
          },
          "mergeDistance": {
            "title": "Merge distance (px)",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Changed areas closer than this are reported as one region.",
            "default": 24
          },
          "maxDiffLines": {
            "title": "Maximum text diff lines",
            "minimum": 10,
            "maximum": 5000,
            "type": "integer",
            "description": "Caps the added/removed line lists and the unified diff.",
            "default": 200
          },
          "timeoutSecs": {
            "title": "Page timeout (s)",
            "minimum": 10,
            "maximum": 180,
            "type": "integer",
            "description": "Maximum time to load one page.",
            "default": 45
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}