Dataset Dedup, Merge & Diff – New and Changed Items
Pricing
from $0.18 / 1,000 output items
Dataset Dedup, Merge & Diff – New and Changed Items
Deduplicate and merge Apify datasets by key fields, or compare with a previous dataset and get only new, changed and removed items. No web requests, your data stays in your account.
Pricing
from $0.18 / 1,000 output items
Rating
0.0
(0)
Developer
Steven Kramp
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
0
Monthly active users
13 hours ago
Last modified
Categories
Features
Share
A small utility for Apify datasets: remove duplicates across several runs, merge records that belong together, or compare today's dataset with yesterday's and keep only what is new, changed or removed.
$0.25 per 1,000 output items. No web requests, no proxy, no browser. Your data stays in your Apify account.
Modes
| mode | result |
|---|---|
dedup (default) | first item per key, in input order |
merge | one item per key; later non-empty values overwrite, missing fields are filled |
diff_new | items whose key is not in previousDatasetId |
diff_changes | new, changed and removed items compared with previousDatasetId |
In the diff modes every row has the extra field _diffStatus. A removed row is the item from the previous dataset.
Input
{"datasetIds": ["YOUR_DATASET_ID", "ANOTHER_DATASET_ID"],"keyFields": ["url"],"mode": "diff_changes","previousDatasetId": "YESTERDAYS_DATASET_ID","stripUrlQuery": true,"ignoreFields": ["scrapedAt"]}
| Field | Default | Meaning |
|---|---|---|
keyFields | required | fields that identify an item; dot paths such as meta.id work |
datasetIds | – | 1–50 datasets, read in this order |
inlineItems | – | JSON objects instead of datasets; ignored when datasetIds is set |
mode | dedup | see above |
previousDatasetId | – | required for the diff modes |
trimValues | true | ignore leading and trailing spaces |
ignoreCase | false | ignore upper and lower case in keys |
stripUrlQuery | false | ignore query and fragment of URL keys |
ignoreFields | ["scrapedAt"] | fields that do not count as a change |
maxInputItems | 200,000 | safety limit per side (up to 500,000) |
Memory: 256 MB is enough for dedup and diff_new. Use 512 MB for diff_changes with more than 300,000 previous items and for large merge runs; if the memory is too small for a merge, the run stops before saving anything.
Matching rules only affect the comparison. Output values are never rewritten. The numbers 5 and 5.0 and the text "5" are the same key.
Output example (fictional, diff_changes)
{"url": "https://example.com/a", "title": "New title", "price": 12, "_diffStatus": "changed"}{"url": "https://example.com/c", "title": "Third", "price": 9, "_diffStatus": "new"}{"url": "https://example.com/b", "title": "Second", "price": 7, "_diffStatus": "removed"}
The SUMMARY record in the key-value store has inputCount, outputCount, duplicatesRemoved, newCount, changedCount, removedCount, unchangedCount, missingKeyCount, previousCount, truncated, removalsChecked and stoppedBy. Counters that a mode does not compute are null.
Honest failure instead of wrong results
The run fails and saves nothing when:
- no item has any of the key fields (usually a typo in
keyFields), - a dataset cannot be read,
diff_changesgets an empty current input while the previous dataset has items (the source run probably failed),- the previous dataset is larger than
maxInputItems.
removed is only reported when the current input was read completely. Items without any key value are kept in dedup and merge and skipped in the diff modes (missingKeyCount). A run stopped by the timeout fails, because its output is incomplete.
Pricing
Pay per event. FREE is an Apify subscription tier, not a promise of free events.
| Billing event | Unit | FREE | BRONZE | SILVER | GOLD |
|---|---|---|---|---|---|
apify-actor-start | per run | $0.00005 | $0.00005 | $0.00005 | $0.00005 |
item | per 1,000 events | $0.25 | $0.225 | $0.20 | $0.175 |
You pay for output rows, not for input rows. Platform usage is included. Check the Pricing tab for the current rates, other applicable charges and taxes.
Chain it behind any Actor
Add this Actor as an integration after a scraper run and pass the run's default dataset as datasetIds. For daily monitoring, pass yesterday's dataset as previousDatasetId.
Use with AI agents (MCP)
https://mcp.apify.com?tools=stevenkramp/dataset-dedup-delta-merge
Example: “Compare these two datasets by id and show me only the new and changed records.”
FAQ
Does it change my input datasets? No. It reads them and writes to the run's own dataset.
Something broken? Open an issue in the Issues tab.