{
  "openapi": "3.0.1",
  "info": {
    "title": "Dataset Change Monitor",
    "description": "Compare every scraper run with the previous one and get only new, changed and removed items, with field-level before/after diffs. Alerts via Telegram, Slack, webhook or email. Works with any Apify Actor, dataset, JSON or CSV.",
    "version": "1.0",
    "x-build-id": "86fGgUcesbCfyK3BS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/egra_van~dataset-change-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-egra_van-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/egra_van~dataset-change-monitor/runs": {
      "post": {
        "operationId": "runs-sync-egra_van-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/egra_van~dataset-change-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-egra_van-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 ID",
            "type": "string",
            "description": "ID or name of the Apify dataset to check, e.g. the default dataset of your scraper's latest run. Leave empty when this Actor runs as an integration after another Actor: the finished run's dataset is used automatically."
          },
          "actorRunId": {
            "title": "…or Actor run ID",
            "type": "string",
            "description": "ID of a finished Actor run. Its default dataset is compared."
          },
          "datasetUrl": {
            "title": "…or JSON / CSV URL",
            "type": "string",
            "description": "Public link to a JSON array, JSON Lines or CSV file, e.g. an Apify dataset export link (https://api.apify.com/v2/datasets/…/items?format=json)."
          },
          "items": {
            "title": "…or items (JSON)",
            "type": "array",
            "description": "Array of objects to compare. Handy for testing or when calling the Actor from Make, Zapier or n8n."
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Each name keeps its own memory of the previous run. Use a different name for every scraper or search you track, e.g. \"amazon-laptops\". If empty, the name is taken from the source Actor or task (integration) or \"default\"."
          },
          "idFields": {
            "title": "Unique key fields",
            "type": "array",
            "description": "Field(s) that identify the same item between runs, e.g. url, id or asin. Nested fields use dots (offer.id). If empty, the whole item is the key: items can then only be new or removed, never changed.",
            "items": {
              "type": "string"
            }
          },
          "compareFields": {
            "title": "Fields to watch",
            "type": "array",
            "description": "Only these fields decide whether an item changed, e.g. price, stock, title. Leave empty to watch all fields except the ignored ones.",
            "items": {
              "type": "string"
            }
          },
          "ignoreFields": {
            "title": "Fields to ignore",
            "type": "array",
            "description": "Fields that change on every run and are not real changes, e.g. scrapedAt, timestamp, position. Used when \"Fields to watch\" is empty.",
            "items": {
              "type": "string"
            }
          },
          "reportNew": {
            "title": "Report new items",
            "type": "boolean",
            "description": "Items whose key did not exist in the previous run.",
            "default": true
          },
          "reportChanged": {
            "title": "Report changed items",
            "type": "boolean",
            "description": "Items whose watched fields differ from the previous run.",
            "default": true
          },
          "trackRemoved": {
            "title": "Report removed items",
            "type": "boolean",
            "description": "Items that were in the previous run but are missing now.",
            "default": true
          },
          "reportAllOnFirstRun": {
            "title": "Report all items as new on the first run",
            "type": "boolean",
            "description": "By default the first run only saves a baseline and reports nothing.",
            "default": false
          },
          "detailedDiff": {
            "title": "Show which fields changed (before → after)",
            "type": "boolean",
            "description": "Keeps a compact copy of each item between runs. Turn off for very large datasets to use less memory; changed items are still detected.",
            "default": true
          },
          "maxChangesPerItem": {
            "title": "Max field changes listed per item",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Limits the size of the \"changes\" list for items with many modified fields.",
            "default": 20
          },
          "maxItems": {
            "title": "Max items to compare",
            "minimum": 0,
            "type": "integer",
            "description": "0 = no limit. When the limit is hit, removed items are not reported for that run.",
            "default": 0
          },
          "notifyMaxItems": {
            "title": "Changes listed in a message",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "How many changes Telegram, Slack and email messages list before \"…and N more\".",
            "default": 10
          },
          "notifyOnNoChanges": {
            "title": "Also notify when nothing changed",
            "type": "boolean",
            "description": "Sends a short \"no changes\" message after every run, useful to know the monitor is alive.",
            "default": false
          },
          "telegramBotToken": {
            "title": "Telegram bot token",
            "type": "string",
            "description": "Create a bot with @BotFather and paste its token."
          },
          "telegramChatId": {
            "title": "Telegram chat ID",
            "type": "string",
            "description": "Your user, group or channel ID (e.g. 123456789 or -1001234567890). Add the bot to the group or channel first."
          },
          "slackWebhookUrl": {
            "title": "Slack incoming webhook URL",
            "type": "string",
            "description": "https://hooks.slack.com/services/…"
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Receives a POST with a JSON summary and the first changes. Works with Make, Zapier, n8n or your own server."
          },
          "webhookMaxItems": {
            "title": "Changes included in the webhook",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of change records included in the webhook JSON. The full list is always in the dataset.",
            "default": 100
          },
          "emailTo": {
            "title": "Email to",
            "type": "string",
            "description": "Sends a summary email through the apify/send-mail Actor (billed as a separate small run on your account). Several addresses: separate with commas."
          },
          "emailSubject": {
            "title": "Email subject",
            "type": "string",
            "description": "Default: \"<monitor>: 3 new, 1 changed, 0 removed\"."
          },
          "resetState": {
            "title": "Start over",
            "type": "boolean",
            "description": "Forget the previous snapshot of this monitor and create a new baseline.",
            "default": false
          },
          "allowEmptySource": {
            "title": "Allow an empty source",
            "type": "boolean",
            "description": "By default an empty dataset is treated as a failed scrape: nothing is reported as removed and the snapshot is kept. Enable if an empty result can be real.",
            "default": false
          },
          "stateStoreName": {
            "title": "State storage name",
            "type": "string",
            "description": "Named key-value store that keeps the snapshots between runs. Letters, digits and \"-\" only.",
            "default": "change-monitor-state"
          },
          "payload": {
            "title": "Integration payload",
            "type": "object",
            "description": "Filled automatically when this Actor runs as an integration after another Actor. Leave empty."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}