{
  "openapi": "3.0.1",
  "info": {
    "title": "Detect Price & Stock Changes | Dataset Diff",
    "description": "Spot price drops, stock changes, and catalog updates with Dataset Diff. Compare two JSON arrays or Apify datasets for field-level changes, before/after values, and numeric deltas. No scraping.",
    "version": "0.1",
    "x-build-id": "NF2LF4KweicK2hYUa"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/panda_studio~dataset-diff-change-detector/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-panda_studio-dataset-diff-change-detector",
        "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/panda_studio~dataset-diff-change-detector/runs": {
      "post": {
        "operationId": "runs-sync-panda_studio-dataset-diff-change-detector",
        "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/panda_studio~dataset-diff-change-detector/run-sync": {
      "post": {
        "operationId": "run-sync-panda_studio-dataset-diff-change-detector",
        "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": {
          "oldDatasetId": {
            "title": "Old dataset ID (previous snapshot)",
            "type": "string",
            "description": "Apify dataset ID of the PREVIOUS snapshot (e.g. yesterday's scrape). Your token must be able to read it. Leave empty to use the inline 'Old items' below."
          },
          "newDatasetId": {
            "title": "New dataset ID (current snapshot)",
            "type": "string",
            "description": "Apify dataset ID of the CURRENT snapshot (e.g. today's scrape). Leave empty to use the inline 'New items' below."
          },
          "oldItems": {
            "title": "Old items (inline previous snapshot)",
            "type": "array",
            "description": "Previous snapshot as an inline JSON array of objects. Ignored when 'Old dataset ID' is set. If you provide neither datasets nor inline items, a built-in demo snapshot is used so the run always returns a result."
          },
          "newItems": {
            "title": "New items (inline current snapshot)",
            "type": "array",
            "description": "Current snapshot as an inline JSON array of objects. Ignored when 'New dataset ID' is set."
          },
          "keyFields": {
            "title": "Key fields",
            "type": "array",
            "description": "Field name(s) that uniquely identify a record across snapshots (e.g. <code>id</code>, or <code>sku</code>+<code>variant</code> for a composite key). Records are matched by these.",
            "default": [
              "id"
            ],
            "items": {
              "type": "string"
            }
          },
          "compareFields": {
            "title": "Compare fields",
            "type": "array",
            "description": "Only these fields are checked for changes. Leave empty to compare ALL fields except the key fields and the ignored fields.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "ignoreFields": {
            "title": "Ignore fields",
            "type": "array",
            "description": "Volatile fields to exclude from comparison so they don't create noise (timestamps, debug metadata, etc.).",
            "default": [
              "scrapedAt",
              "fetchedAt",
              "crawledAt",
              "#debug"
            ],
            "items": {
              "type": "string"
            }
          },
          "numericFields": {
            "title": "Numeric fields",
            "type": "array",
            "description": "Fields treated as numbers so a delta is computed and the tolerance below applies (e.g. <code>price</code>, <code>stock</code>). Currency symbols and thousands separators are tolerated.",
            "default": [
              "price"
            ],
            "items": {
              "type": "string"
            }
          },
          "numericTolerance": {
            "title": "Numeric tolerance",
            "minimum": 0,
            "type": "integer",
            "description": "Ignore numeric changes whose absolute difference is at or below this value (e.g. 1 hides a price change of 1 or less). 0 reports every change.",
            "default": 0
          },
          "snapshotsComplete": {
            "title": "Snapshots are complete",
            "type": "boolean",
            "description": "Enable ONLY if both snapshots are guaranteed complete crawls. When on, records present in the old snapshot but absent from the new are reported as 'removed'. When off (safer), they are reported as 'missing' to avoid mistaking a partial scrape for deletions.",
            "default": false
          },
          "includeUnchanged": {
            "title": "Include unchanged records",
            "type": "boolean",
            "description": "Also emit a row for every record that did not change. Off by default to keep the output focused on changes.",
            "default": false
          },
          "maxRowsPerSnapshot": {
            "title": "Max rows per snapshot",
            "minimum": 1,
            "maximum": 500000,
            "type": "integer",
            "description": "Safety cap. If either snapshot exceeds this, the run stops with an error instead of silently truncating.",
            "default": 50000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}