{
  "openapi": "3.0.1",
  "info": {
    "title": "Web Page Change Monitor — Content & Visual Diffs",
    "description": "Monitor webpages for text, HTML, selector, and optional screenshot changes. Compare snapshots, ignore noisy regions, and export diff reports.",
    "version": "1.0",
    "x-build-id": "XRxSTZngzNEBLYadd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/junipr~web-page-change-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-junipr-web-page-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/junipr~web-page-change-monitor/runs": {
      "post": {
        "operationId": "runs-sync-junipr-web-page-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/junipr~web-page-change-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-junipr-web-page-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",
        "properties": {
          "pages": {
            "title": "Pages to Monitor",
            "type": "array",
            "description": "List of pages to monitor. Each entry defines a URL and what to watch. Defaults to a bounded Hacker News check.",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "title": "URL",
                  "type": "string",
                  "description": "Page URL to monitor (must include https://)"
                },
                "label": {
                  "title": "Label",
                  "type": "string",
                  "description": "Optional human-readable name for this monitor"
                },
                "selector": {
                  "title": "CSS Selector",
                  "type": "string",
                  "description": "CSS selector to target a specific section. Null means full page body."
                },
                "removeSelectors": {
                  "title": "Remove Selectors",
                  "type": "array",
                  "description": "CSS selectors for elements to exclude (ads, nav, timestamps, etc.)",
                  "items": {
                    "type": "string"
                  }
                },
                "waitForSelector": {
                  "title": "Wait For Selector",
                  "type": "string",
                  "description": "Wait for this CSS selector to appear before extracting (Playwright only)"
                },
                "waitForTimeout": {
                  "title": "Wait Timeout (ms)",
                  "type": "integer",
                  "description": "Milliseconds to wait after page load before extracting (Playwright only)",
                  "default": 2000
                }
              }
            },
            "default": [
              {
                "url": "https://news.ycombinator.com",
                "label": "hackernews"
              }
            ]
          },
          "maxPagesPerRun": {
            "title": "Max Pages Per Run",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of pages to check in a single run.",
            "default": 1
          },
          "renderJs": {
            "title": "Render JavaScript",
            "type": "boolean",
            "description": "Use Playwright browser for JavaScript-rendered pages (SPAs, dynamic content). Default false uses faster Cheerio for static HTML.",
            "default": false
          },
          "waitForNetworkIdle": {
            "title": "Wait For Network Idle",
            "type": "boolean",
            "description": "Wait until network requests finish before extracting content (Playwright only). Useful for lazy-loaded content.",
            "default": false
          },
          "changeThreshold": {
            "title": "Change Threshold",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Minimum fraction of content that must change to trigger a detection. 0 = any change. 0.01 = 1% change. Range: 0–1.",
            "default": 0.01
          },
          "ignoreWhitespace": {
            "title": "Ignore Whitespace Changes",
            "type": "boolean",
            "description": "Treat whitespace-only differences as no change. Recommended to reduce false positives.",
            "default": true
          },
          "ignoreCaseChanges": {
            "title": "Ignore Case Changes",
            "type": "boolean",
            "description": "Treat changes that differ only in capitalization as no change.",
            "default": false
          },
          "ignoreNumbers": {
            "title": "Ignore Numeric Changes",
            "type": "boolean",
            "description": "Ignore changes to numeric values. Useful for filtering timestamps, view counters, and live scores.",
            "default": false
          },
          "ignorePatterns": {
            "title": "Ignore Patterns (Regex)",
            "type": "array",
            "description": "Regular expression patterns for text to ignore. E.g., \"\\\\d{4}-\\\\d{2}-\\\\d{2}\" ignores ISO dates.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "contentType": {
            "title": "Content Type",
            "enum": [
              "text",
              "html",
              "attributes"
            ],
            "type": "string",
            "description": "What content to compare: text (extracted text), html (raw HTML markup), or attributes (element attributes only).",
            "default": "text"
          },
          "diffFormat": {
            "title": "Diff Format",
            "enum": [
              "unified",
              "sideBySide",
              "json"
            ],
            "type": "string",
            "description": "Output format for the diff: unified (git-style), sideBySide (left/right comparison), or json (structured changes array).",
            "default": "unified"
          },
          "diffContextLines": {
            "title": "Diff Context Lines",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Number of unchanged lines shown around each change in the diff.",
            "default": 3
          },
          "includeFullSnapshot": {
            "title": "Include Full Snapshot Text",
            "type": "boolean",
            "description": "Include the complete current page text in the output. Disabled by default to keep dataset items small.",
            "default": false
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "URL to POST change notifications to. Receives a JSON payload listing all changed pages. Leave empty to disable.",
            "default": ""
          },
          "webhookHeaders": {
            "title": "Webhook Headers",
            "type": "object",
            "description": "Custom headers for webhook requests. Use for authentication tokens (e.g., {\"Authorization\": \"Bearer TOKEN\"}).",
            "default": {}
          },
          "notificationEmail": {
            "title": "Notification Email",
            "type": "string",
            "description": "Email address to send change notifications to. Leave empty to disable email notifications.",
            "default": ""
          },
          "notifyOnNoChange": {
            "title": "Notify On No Change (Heartbeat)",
            "type": "boolean",
            "description": "Send a notification even when no changes are detected. Useful as a heartbeat to confirm the monitor is running.",
            "default": false
          },
          "notifyOnError": {
            "title": "Notify On Error",
            "type": "boolean",
            "description": "Send a notification when a page fails to load.",
            "default": true
          },
          "snapshotStore": {
            "title": "Snapshot Store Name",
            "type": "string",
            "description": "Name of the Key-Value Store to persist snapshots across runs. Use the same name every run to compare against previous state.",
            "default": "change-monitor-snapshots"
          },
          "maxSnapshotHistory": {
            "title": "Max Snapshot History",
            "minimum": 1,
            "maximum": 25,
            "type": "integer",
            "description": "Maximum number of historical snapshots to keep per page. Oldest are evicted first.",
            "default": 3
          },
          "maxRetries": {
            "title": "Max Retries",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Number of times to retry a failed page request before marking it as an error.",
            "default": 2
          },
          "requestTimeout": {
            "title": "Request Timeout (ms)",
            "minimum": 5000,
            "maximum": 60000,
            "type": "integer",
            "description": "Timeout per page request in milliseconds.",
            "default": 30000
          },
          "maxConcurrency": {
            "title": "Max Concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum number of pages to check simultaneously. Higher values are faster but use more memory.",
            "default": 1
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}