{
  "openapi": "3.0.1",
  "info": {
    "title": "Scraper Change Monitor: price & website changes + Slack alerts",
    "description": "Website change detection for any scraper: compare each run with the previous one and get only new, changed and removed items (new products, price changes), matched by your key fields (e.g. url). Slack notification, Discord, Telegram, email or webhook alert per run. Add it as an integration.",
    "version": "0.1",
    "x-build-id": "J0mY5h5spE9ZwtJdE"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/bosco_labs~dataset-change-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-bosco_labs-dataset-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/bosco_labs~dataset-change-monitor/runs": {
      "post": {
        "operationId": "runs-sync-bosco_labs-dataset-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/bosco_labs~dataset-change-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-bosco_labs-dataset-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": {
          "datasetId": {
            "title": "Dataset to check",
            "type": "string",
            "description": "Apify dataset to compare with the previous run, e.g. \"aBcD1234efGH5678i\": usually your scraper run's default dataset. As an integration on your scraper, set it to \"{{resource.defaultDatasetId}}\" (see the README). Optional if you paste items."
          },
          "items": {
            "title": "Or paste items (JSON) to try it",
            "type": "array",
            "description": "Items to check directly, as a JSON array of objects, e.g. [{\"url\": \"https://jobs.example.com/1042\", \"salary_eur\": 65000}]. Checked before the dataset. Pasted items are all reported as new on a monitor's first run (no silent baseline). Without a monitorName nothing is saved, so every run is a fresh try-out; give a monitorName and paste again with an edit to see a change."
          },
          "monitorName": {
            "title": "Monitor name",
            "pattern": "^[A-Za-z0-9_-]{0,100}$",
            "type": "string",
            "description": "Name of the saved state: one name = one watched list, e.g. \"shop-prices\". Runs with the same name are compared with each other; use a different name per scraper or task. Letters, digits, - and _. Empty = \"default\" with a datasetId; with only pasted items, empty = a try-out that saves nothing."
          },
          "keyFields": {
            "title": "Key fields (identify an item across runs)",
            "type": "array",
            "description": "Fields that identify the same item in every run, e.g. [\"url\"] or [\"placeId\"]. Dot paths work: [\"product.sku\"]. Required unless you use whole-item comparison. Items without any key field are skipped.",
            "items": {
              "type": "string",
              "pattern": "^[^\\[\\]{}<>\\r\\n]*$"
            }
          },
          "compareWholeItem": {
            "title": "No key: compare whole items",
            "type": "boolean",
            "description": "For datasets without an ID field: an item is identified by all its fields (minus ignored ones), so items are only reported as new or removed, never as changed. Default false. E.g. `true`.",
            "default": false
          },
          "ignoreFields": {
            "title": "Ignore fields",
            "type": "array",
            "description": "Fields that change on every run and are never compared, as dot paths. Default: scrapedAt, scraped_at, crawledAt, retrieved_at, timestamp and #debug. Set [] to compare everything. E.g. [\"scrapedAt\", \"#debug\"].",
            "items": {
              "type": "string",
              "pattern": "^[^\\[\\]{}<>\\r\\n]*$"
            },
            "default": [
              "scrapedAt",
              "scraped_at",
              "crawledAt",
              "retrieved_at",
              "timestamp",
              "#debug"
            ]
          },
          "watchFields": {
            "title": "Watch only these fields",
            "type": "array",
            "description": "Only changes in these fields count, e.g. [\"price\", \"stock\", \"offer.status\"]. The output then also shows the old values (previous). Empty = every field except the ignored ones.",
            "items": {
              "type": "string",
              "pattern": "^[^\\[\\]{}<>\\r\\n]*$"
            }
          },
          "report": {
            "title": "Report",
            "type": "array",
            "description": "Which changes become output rows (and are charged): new, changed and/or removed items. Removed is off by default, because a scraper run that stopped early would make many items look removed. E.g. [\"new\", \"changed\"].",
            "items": {
              "type": "string",
              "enum": [
                "new",
                "changed",
                "removed"
              ],
              "enumTitles": [
                "New items",
                "Changed items",
                "Removed items"
              ]
            },
            "default": [
              "new",
              "changed"
            ]
          },
          "reportOnFirstRun": {
            "title": "Report every item on the first run",
            "type": "boolean",
            "description": "The first run of a monitor only saves the baseline and reports nothing (free). Turn on to report every item as new on that first run (charged per item). E.g. `true`.",
            "default": false
          },
          "slackWebhookUrl": {
            "title": "Slack incoming webhook URL",
            "type": "string",
            "description": "Slack incoming webhook URL (https://hooks.slack.com/services/...). Secret input, stored encrypted. E.g. \"https://hooks.slack.com/services/T000/B000/XXXX\"."
          },
          "discordWebhookUrl": {
            "title": "Discord webhook URL",
            "type": "string",
            "description": "Discord channel webhook URL (https://discord.com/api/webhooks/...). Secret input, stored encrypted. E.g. \"https://discord.com/api/webhooks/123/abc\"."
          },
          "webhookUrl": {
            "title": "Webhook URL (JSON POST)",
            "type": "string",
            "description": "Any URL that receives a JSON POST with the counts, example rows and the link (Zapier, Make, n8n, your own API). Secret input, stored encrypted. E.g. \"https://hooks.zapier.com/hooks/catch/123/abc/\"."
          },
          "telegramBotToken": {
            "title": "Telegram bot token",
            "type": "string",
            "description": "Token of your Telegram bot from @BotFather. Needs the chat ID too. Secret input, stored encrypted. E.g. \"123456:ABC-DEF1234ghIkl\" (digits, colon, letters)."
          },
          "telegramChatId": {
            "title": "Telegram chat ID",
            "pattern": "^\\s*(-?\\d{1,20}|@[A-Za-z0-9_]{4,64})?\\s*$",
            "type": "string",
            "description": "Chat, group or channel ID the bot posts to, e.g. \"123456789\" or \"@mychannel\"."
          },
          "email": {
            "title": "Email to",
            "pattern": "^\\s*([^@\\s,;]+@[^@\\s,;]+\\.[^@\\s,;]+(\\s*[,;]\\s*[^@\\s,;]+@[^@\\s,;]+\\.[^@\\s,;]+)*)?\\s*$",
            "type": "string",
            "description": "Address(es) for an email alert, comma-separated. Sent by the public Actor apify/send-mail, which runs in your account (a few seconds of compute). E.g. \"alerts@example.com, ops@example.com\"."
          },
          "alertMaxItems": {
            "title": "Example lines per alert",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "How many changes to list in the alert as examples (key values and what changed). Default 10. E.g. 5.",
            "default": 10
          },
          "alertWhenNoChanges": {
            "title": "Alert also when nothing changed",
            "type": "boolean",
            "description": "Send the alert even when a run found no changes (a daily \"all quiet\"). Default false.",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}