{
  "openapi": "3.0.1",
  "info": {
    "title": "Website Change Monitor — Pricing, Content & Sitemap Diff",
    "description": "Fast HTTP/Cheerio competitor pricing, website content, and sitemap change monitor for scheduled runs. Tracks CSS selectors, JSON-LD & table prices with numeric deltas, line/field diffs, new or removed sitemap URLs, and sends HMAC Webhook & Telegram alerts.",
    "version": "0.1",
    "x-build-id": "09HljMqaFJxUA3flJ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/memo23~website-change-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-memo23-website-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/memo23~website-change-monitor/runs": {
      "post": {
        "operationId": "runs-sync-memo23-website-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/memo23~website-change-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-memo23-website-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": {
          "monitorMode": {
            "title": "Monitor Mode",
            "enum": [
              "Content & Pricing Diff ($1/1k checks + $5/1k changes)",
              "Sitemap New/Removed Pages ($1/1k sitemaps + $5/1k new URLs)",
              "Full Page + Pricing + Sitemap ($2/1k checks + $5/1k changes)"
            ],
            "type": "string",
            "description": "Choose what to monitor. Content & Pricing Diff tracks HTML/CSS/JSON-LD pricing and page copy. Sitemap New/Removed Pages detects newly published or deleted competitor pages. Full runs both.",
            "default": "Content & Pricing Diff ($1/1k checks + $5/1k changes)"
          },
          "urls": {
            "title": "URLs to Monitor",
            "type": "array",
            "description": "List of page URLs to check (e.g. `https://competitor.com/pricing`). In Sitemap or Full mode, sitemaps are automatically discovered from these domains when `sitemapUrls` is empty. Also accepts objects `{ \"url\": \"...\", \"label\": \"Acme Pricing\", \"selectors\": { \"proPrice\": \".price\" } }` or `startUrls` via API.",
            "items": {
              "type": "string"
            }
          },
          "sitemapUrls": {
            "title": "Sitemap URLs (optional)",
            "type": "array",
            "description": "Explicit `sitemap.xml` or sitemap index URLs (supports `.xml` and `.xml.gz`). Leave empty to auto-discover from each URL's domain (`/sitemap.xml` and `robots.txt`).",
            "items": {
              "type": "string"
            }
          },
          "cssSelectors": {
            "title": "Named CSS Selectors (optional)",
            "type": "object",
            "description": "Map of field names to CSS selectors for targeted tracking and price delta detection, e.g. `{\"proPrice\": \".pricing-pro .amount\", \"enterpriseCta\": \".plan-ent button\"}`."
          },
          "monitorOnlySelectors": {
            "title": "Monitor Only Named Selectors",
            "type": "boolean",
            "description": "When `cssSelectors` is configured, compare only the named selector values and extracted prices instead of full page body text. Ideal for noisy marketing pages.",
            "default": false
          },
          "ignoreRegexPatterns": {
            "title": "Ignore Regex Patterns",
            "type": "array",
            "description": "Regular expressions stripped from extracted text before hashing and diffing (e.g. `\"nonce-[a-f0-9]+\"`, `\"Updated: \\\\d{4}-\\\\d{2}-\\\\d{2}\"`, `\"csrf_token=[^&\\\\s]+\"`).",
            "items": {
              "type": "string"
            }
          },
          "minChangeChars": {
            "title": "Minimum Changed Characters (Noise Threshold)",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Suppress pure text diffs smaller than this many added + removed characters (default 10). Numeric price changes always bypass this threshold so `$49` -> `$59` is never missed.",
            "default": 10
          },
          "emitUnchanged": {
            "title": "Emit Unchanged Rows After Baseline",
            "type": "boolean",
            "description": "Output dataset rows even when a previously baselined URL has not changed. Keep `false` (default) so scheduled runs emit clean change-only datasets. Initial baseline capture still outputs baseline rows.",
            "default": false
          },
          "emitBaseline": {
            "title": "Emit Initial Baseline Rows",
            "type": "boolean",
            "description": "Output a baseline snapshot row on the first run for a URL or sitemap (default `true`). Baseline rows charge only the check event, never the change event.",
            "default": true
          },
          "stateStoreName": {
            "title": "Snapshot Key-Value Store Name",
            "type": "string",
            "description": "Named Apify Key-Value Store holding previous page and sitemap snapshots across scheduled runs. Use different names to isolate separate monitoring projects.",
            "default": "website-change-monitor-state"
          },
          "mongoDbConnectionString": {
            "title": "BYO MongoDB Connection String (optional)",
            "type": "string",
            "description": "Optional MongoDB URI (e.g. `mongodb+srv://...`) to store snapshots in your own database instead of Apify Key-Value Store."
          },
          "mongoDbDatabase": {
            "title": "MongoDB Database Name",
            "type": "string",
            "description": "Database name used when `mongoDbConnectionString` is configured.",
            "default": "website_change_monitor"
          },
          "mongoDbCollection": {
            "title": "MongoDB Collection Name",
            "type": "string",
            "description": "Collection name used when `mongoDbConnectionString` is configured.",
            "default": "snapshots"
          },
          "webhookUrl": {
            "title": "Webhook URL (Custom, Slack, Discord, Make, Zapier, n8n)",
            "type": "string",
            "description": "HTTP endpoint to receive a JSON POST payload when changes are detected. Automatically formats payloads for Slack and Discord webhook URLs."
          },
          "webhookSecret": {
            "title": "Webhook HMAC-SHA256 Secret (optional)",
            "type": "string",
            "description": "Optional shared secret used to sign webhook payloads with header `X-Monitor-Signature-256: sha256=<hex>`."
          },
          "telegramBotToken": {
            "title": "Telegram Bot Token (optional)",
            "type": "string",
            "description": "Bot token from `@BotFather` for instant Telegram change alerts (requires `telegramChatId`)."
          },
          "telegramChatId": {
            "title": "Telegram Chat / Channel ID (optional)",
            "type": "string",
            "description": "Target Telegram user, group, or channel ID (e.g. `-1001234567890`)."
          },
          "maxConcurrency": {
            "title": "Max Concurrency",
            "minimum": 1,
            "maximum": 25,
            "type": "integer",
            "description": "Number of URLs checked in parallel (1–25, default 5).",
            "default": 5
          },
          "requestTimeoutSecs": {
            "title": "Request Timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Per-request HTTP timeout in seconds (5–120, default 25).",
            "default": 25
          },
          "maxSitemapsPerDomain": {
            "title": "Max Child Sitemaps per Index",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum child sitemap XML files to follow inside a `<sitemapindex>` (1–100, default 20).",
            "default": 20
          },
          "maxNewUrlsPerSitemap": {
            "title": "Max Emitted Change Rows per Sitemap",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Safety cap on how many newly added or removed URL rows are emitted per sitemap per run (1–5000, default 200).",
            "default": 200
          },
          "customHeaders": {
            "title": "Custom HTTP Headers (optional)",
            "type": "object",
            "description": "Optional extra HTTP request headers (e.g. `{\"Accept-Language\": \"en-US,en;q=0.9\"}`)."
          },
          "proxy": {
            "title": "Proxy Configuration (optional)",
            "type": "object",
            "description": "Optional proxy settings for anti-bot protected competitor sites. Direct HTTP works out of the box for most public pages and sitemaps.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}