# Get only the new items from a scheduled scraper

**Use case:** 

When a scraper runs every day, most results are the same as yesterday. This task remembers what it has already seen (only hashes of the items are stored, in a key-value store you name) and returns just the items that are new since the last run, for example new job ads, listings or articles. The first run reports every item as new.

## Input

```json
{
  "stateStoreName": "my-scraper-seen-items",
  "keyFields": [
    "url"
  ],
  "ignoreFields": [
    "scrapedAt"
  ],
  "changeTypes": [
    "added"
  ],
  "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 only the new items from a scheduled scraper". [Sign up or log in](https://console.apify.com/create-task-from-example/fQYsdaZsWRBlqtRUA) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Get only the new items from a scheduled scraper" task

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

### 3. Receive the "Get only the new items from a scheduled scraper" 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 only the new items from a scheduled scraper" task via API](https://apify.com/quietworkslab/dataset-change-tracker.md).

## FAQ

### How does the new items task remember earlier runs?

The new items task saves hashes of the key and content of each item in the key-value store named in stateStoreName, and compares the next run with them. The items themselves are not stored.

### What happens on the first run?

On the first run with a new stateStoreName, the new items task has nothing to compare with, so it reports every item as added. From the second run on, only new items are returned.

### Can I connect it to my scraper?

Yes. Add the Dataset Change Tracker as an integration on your scraper's Integrations tab and set datasetId to {{resource.defaultDatasetId}}. With stateStoreName, each run is compared with the previous one automatically.

## 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`).
