{
  "openapi": "3.0.1",
  "info": {
    "title": "Website Change Monitor: Page Diff & Alerts",
    "description": "Watch web pages for changes and get only what changed: added and removed lines, links or HTML, for the whole page or one CSS selector, with ignore rules for dates and counters. Run it on a schedule and send alerts by email, Slack or Teams.",
    "version": "0.0",
    "x-build-id": "OlML7fhjnTgsRu6x0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/charlesmarkette~website-change-monitor-page-diff-alerts/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-charlesmarkette-website-change-monitor-page-diff-alerts",
        "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/charlesmarkette~website-change-monitor-page-diff-alerts/runs": {
      "post": {
        "operationId": "runs-sync-charlesmarkette-website-change-monitor-page-diff-alerts",
        "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/charlesmarkette~website-change-monitor-page-diff-alerts/run-sync": {
      "post": {
        "operationId": "run-sync-charlesmarkette-website-change-monitor-page-diff-alerts",
        "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": {
          "startUrls": {
            "title": "Pages to watch",
            "type": "array",
            "description": "The pages to check on every run. Each entry is a URL (\"https://example.com/pricing\"), or an object that watches one part of the page and names it: {\"url\": \"https://shop.example.com/item\", \"cssSelector\": \".price\", \"label\": \"Item price\"}. The same URL can be listed twice with different selectors."
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Runs with the same name share one memory of page snapshots, so you can add or remove pages without losing history. Leave empty to tie the memory to the exact URL list (changing the list then starts fresh baselines). Snapshots are kept in a named key-value store called change-monitor-<name>-<short code>."
          },
          "watch": {
            "title": "What to watch",
            "enum": [
              "text",
              "html",
              "links"
            ],
            "type": "string",
            "description": "Visible text: what a reader sees, one line per paragraph, heading or list item (scripts, styles and hidden elements are left out). HTML: the normalized markup, so attribute and structure changes count too. Links: the set of link URLs, for new or removed articles, files or products.",
            "default": "text"
          },
          "cssSelector": {
            "title": "CSS selector",
            "type": "string",
            "description": "Optional. Watch only the elements that match, for example .price, #stock-status or main article. Applies to every page unless an entry in 'Pages to watch' has its own cssSelector. If nothing matches, the row says selectorNotFound and the saved snapshot is kept."
          },
          "ignorePatterns": {
            "title": "Ignore patterns (regex)",
            "type": "array",
            "description": "Regular expressions (Python syntax) removed from each line before comparing, for parts that change on every visit: dates, view counters, \"x minutes ago\". Example: \\d+ (views|comments) or Updated .* ago. An invalid expression fails the run with a clear message.",
            "items": {
              "type": "string"
            }
          },
          "ignoreCase": {
            "title": "Ignore upper/lower case",
            "type": "boolean",
            "description": "Treat \"In stock\" and \"IN STOCK\" as the same.",
            "default": false
          },
          "ignoreNumbers": {
            "title": "Ignore numbers",
            "type": "boolean",
            "description": "Treat every number as equal, so only text changes count. Leave off to watch prices or stock counts.",
            "default": false
          },
          "minChangeChars": {
            "title": "Minimum change size (characters)",
            "minimum": 0,
            "type": "integer",
            "description": "Ignore changes smaller than this many characters (after the ignore rules). Small changes still add up: the comparison stays against the last reported version until the total is big enough. 0 reports every change.",
            "default": 0
          },
          "outputMode": {
            "title": "Output",
            "enum": [
              "changesOnly",
              "all"
            ],
            "type": "string",
            "description": "Changes only: rows for changed pages, first checks (baseline) and pages that couldn't be checked or whose selector matched nothing, so you notice when a watch breaks. An unchanged run leaves the dataset empty, which keeps alert integrations quiet. Every page: a row for each page, unchanged ones included.",
            "default": "changesOnly"
          },
          "maxDiffLines": {
            "title": "Max diff lines per page",
            "minimum": 0,
            "type": "integer",
            "description": "At most this many added and this many removed lines are listed per page; addedCount and removedCount always give the full numbers.",
            "default": 50
          },
          "maxResults": {
            "title": "Max output rows",
            "minimum": 1,
            "type": "integer",
            "description": "Optional cap on output rows. The run stops when it is reached; pages not checked yet keep their snapshots for the next run."
          },
          "datasetId": {
            "title": "Dataset of URLs",
            "type": "string",
            "description": "Optional. Watch the URLs in a dataset, for example a sitemap or scraper output. Use {{resource.defaultDatasetId}} in an integration. Set a Monitor name when you do, so the memory doesn't depend on the list."
          },
          "urlField": {
            "title": "URL field",
            "type": "string",
            "description": "The item field that holds the page URL. Dotted paths work (page.url).",
            "default": "url"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}