# Get new, changed and removed items between two scraper runs

**Use case:** 

Compares the latest dataset of your scraper with the previous one and returns only what is different: added items, changed items (with the names and old values of the fields that changed) and removed items. Items are matched by the key fields you choose, such as url, and fields that change on every run, such as scrapedAt, are ignored. Run it as it is to compare two small built-in sample datasets.

## Input

```json
{
  "keyFields": [
    "url"
  ],
  "ignoreFields": [
    "scrapedAt"
  ],
  "changeTypes": [
    "added",
    "changed",
    "removed"
  ],
  "ignoreArrayOrder": false
}
```

## Output

```json
{
  "changeType": {
    "label": "Change type",
    "format": "string"
  },
  "key": {
    "label": "Key",
    "format": "string"
  },
  "keyHash": {
    "label": "Key hash",
    "format": "string"
  },
  "changedFields": {
    "label": "Changed fields",
    "format": "array"
  },
  "previousValues": {
    "label": "Previous values",
    "format": "object"
  },
  "item": {
    "label": "Item",
    "format": "object"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Dataset Change Tracker Actor is ready to run with the inputs already set for "Get new, changed and removed items between two scraper runs". [Sign up or log in](https://console.apify.com/create-task-from-example/0BGWw1FBMbibjxpKA) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Get new, changed and removed items between two scraper runs" task

The Dataset Change Tracker Actor will start running based on the input automatically. You can also change all the input fields, like key fields, fields to ignore, and more, to match your specific use case.

### 3. Receive the "Get new, changed and removed items between two scraper runs" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as change type, key, key hash, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Get new, changed and removed items between two scraper runs" task via API](https://apify.com/quietworkslab/dataset-change-tracker.md).

## FAQ

### How are items matched between the two runs?

The scraper run comparison task matches items by the key fields you choose, for example url or a product ID. Two items with the same key values are compared field by field.

### What does a changed item row contain?

A changed row from the scraper run comparison task contains the current item, the names of the changed fields and their previous values, so you can see for example what the price was before.

### How much does comparing two datasets cost?

The Dataset Change Tracker charges $0.00002 per item of the current dataset ($0.02 per 1,000 items), plus Apify's Actor start event. The built-in sample comparison has no per-item charge.

## About this Actor

This example demonstrates how to use [Dataset Change Tracker](https://apify.com/quietworkslab/dataset-change-tracker.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/quietworkslab/dataset-change-tracker.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/quietworkslab/dataset-change-tracker.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
