{
  "openapi": "3.0.1",
  "info": {
    "title": "Dataset Diff: Only New & Changed Items From Any Actor",
    "description": "Point it at any Apify Actor, Task or dataset and get only what changed since its last run: new rows, edited rows, rows that disappeared. Push the delta to Slack, Discord, Telegram or a webhook. No target website, so nothing breaks.",
    "version": "0.1",
    "x-build-id": "CqvZMCgCZVcFQkGaM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fayoussef~dataset-diff/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fayoussef-dataset-diff",
        "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/fayoussef~dataset-diff/runs": {
      "post": {
        "operationId": "runs-sync-fayoussef-dataset-diff",
        "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/fayoussef~dataset-diff/run-sync": {
      "post": {
        "operationId": "run-sync-fayoussef-dataset-diff",
        "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",
        "required": [
          "source"
        ],
        "properties": {
          "source": {
            "title": "Actor, Task or dataset to watch",
            "type": "string",
            "description": "What to compare against its own previous run. Paste any one of these: an Actor handle such as apify/instagram-scraper, an Actor or Task link copied from the Apify Console, a run link, or a dataset ID. For an Actor or a Task the newest successful run of your own account is used automatically, so a scheduled setup needs nothing else. Run the source Actor at least once before pointing this at it. Leave the word \"demo\" here to see what the output looks like on a built-in sample dataset, at no charge."
          },
          "emit": {
            "title": "What to report",
            "type": "array",
            "description": "Which changes end up in the results. Leave the default to get appearances and edits, and add \"Gone since last run\" to also be told what disappeared.",
            "items": {
              "type": "string",
              "enum": [
                "new",
                "changed",
                "removed"
              ],
              "enumTitles": [
                "New since last run",
                "Changed since last run",
                "Gone since last run"
              ]
            },
            "default": [
              "new",
              "changed"
            ]
          },
          "keyFields": {
            "title": "Item key fields",
            "type": "array",
            "description": "The field that identifies one item across runs, such as url, id or vin. Leave this empty and it is detected automatically, which is right for almost every Actor. Set it only when the automatic choice is wrong, or when identity needs two fields together.",
            "items": {
              "type": "string"
            }
          },
          "watchFields": {
            "title": "Only watch these fields",
            "type": "array",
            "description": "Narrow \"changed\" to the fields you actually care about, such as price or status. Leave empty and any edit to any field counts. Filling this in also lets the report show the old value next to the new one.",
            "items": {
              "type": "string"
            }
          },
          "notifyMaxItems": {
            "title": "Changes per notification",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many changes to list inside one Slack, Discord or Telegram message before it says \"and N more\". The full set is always in the results.",
            "default": 20
          },
          "slackWebhookUrl": {
            "title": "Slack webhook URL",
            "type": "string",
            "description": "An incoming webhook URL from your Slack workspace. Create one under Slack apps, Incoming Webhooks, and pick the channel there."
          },
          "discordWebhookUrl": {
            "title": "Discord webhook URL",
            "type": "string",
            "description": "A channel webhook URL from Discord, under Channel Settings, Integrations, Webhooks."
          },
          "telegramBotToken": {
            "title": "Telegram bot token",
            "type": "string",
            "description": "The token BotFather gave your own bot. Needs the chat ID below as well."
          },
          "telegramChatId": {
            "title": "Telegram chat ID",
            "type": "string",
            "description": "The chat, group or channel your bot posts to."
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Any HTTPS endpoint, for n8n, Make, Zapier or your own service. It receives the changes as JSON rather than as a message."
          },
          "outputMode": {
            "title": "Results contain",
            "enum": [
              "deltaOnly",
              "annotated"
            ],
            "type": "string",
            "description": "\"Only what changed\" is the usual choice and keeps results small. \"Every item, labelled\" returns the whole dataset with a change column added, which suits a Google Sheet you keep looking at.",
            "default": "deltaOnly"
          },
          "firstRunBehaviour": {
            "title": "On the very first run",
            "enum": [
              "baselineOnly",
              "emitAll"
            ],
            "type": "string",
            "description": "There is nothing to compare against the first time, so the default records a baseline and reports nothing. Choose the other option to get the whole dataset as \"new\" once.",
            "default": "baselineOnly"
          },
          "ignoreFields": {
            "title": "Fields to ignore",
            "type": "array",
            "description": "Fields that change every run on their own, such as timestamps and row positions, and would otherwise mark every item as changed. A sensible list is already applied; anything you enter here replaces it.",
            "items": {
              "type": "string"
            }
          },
          "monitorKey": {
            "title": "Watchlist name",
            "type": "string",
            "description": "Names the history this run compares against. Leave empty and the source names it, which is what you want. Set it to keep two separate watchlists on the same source apart."
          },
          "maxItems": {
            "title": "Maximum items to compare",
            "minimum": 1,
            "maximum": 500000,
            "type": "integer",
            "description": "Safety cap on how much of the source dataset to read. Items past the cap look missing, so keep this above the size of the dataset you are watching.",
            "default": 50000
          },
          "apifyToken": {
            "title": "Apify API token",
            "type": "string",
            "description": "Optional. Leave empty: on the Apify platform the run already has the access it needs. Fill this in only to read a dataset that belongs to a different Apify account, or when running this Actor outside the platform."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}