Merge & Dedup Apify Datasets - Only New Items avatar

Merge & Dedup Apify Datasets - Only New Items

Pricing

from $0.25 / 1,000 output items

Go to Apify Store
Merge & Dedup Apify Datasets - Only New Items

Merge & Dedup Apify Datasets - Only New Items

Merge any number of Apify datasets and dedup items by one or more fields (url, id, product.id + shop). Only-new-items mode makes scheduled scrapers output new results only. Remove duplicates from JSON datasets at scale, limited permissions. Duplicates are never charged.

Pricing

from $0.25 / 1,000 output items

Rating

0.0

(0)

Developer

Grace M. Hartwell

Grace M. Hartwell

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

19 days ago

Last modified

Features

Limited permissions

Share

Hartwell Toolworks

Deduplicate & Merge Apify Datasets combines any number of Apify datasets into one and removes duplicate items by one or more fields, such as url, id or product.id + shop. Pick your datasets, name the dedup field, click Start. With only-new-items mode, a scheduled scraper delivers only results it has not delivered before. You pay $0.25 per 1,000 unique output items plus $0.005 per run start; duplicates are free.

What can you use Deduplicate & Merge Apify Datasets for?

  • 🧩 Combine parallel scraper runs into one clean dataset.
  • 📅 Incremental scraping: schedule a scraper and output only new listings, jobs, products or posts each day.
  • 🚫 Skip already-processed records with reference datasets ("already in the CRM").
  • ✂️ Shrink exports: dedupe and keep only the fields you need before Google Sheets, Airtable, a CRM or a vector database.
  • 🧽 Clean up: remove fully identical items, or compare keys case-insensitively and trimmed.

Example output: three scraper runs, one clean dataset

Run summary (OUTPUT record) from our test: three synthetic datasets of 10,000 rows each, deduplicated by url:

{
"read": 30000,
"output": 23400,
"duplicates": 6600,
"seenInPreviousRuns": 0,
"perDataset": {
"shop-crawl-mon": { "itemCount": 10000, "read": 10000, "output": 7827 },
"shop-crawl-wed": { "itemCount": 10000, "read": 10000, "output": 7804 },
"shop-crawl-fri": { "itemCount": 10000, "read": 10000, "output": 7769 }
},
"stoppedReason": null,
"dedupFields": ["url"],
"onlyNewItems": false
}

The dataset holds your original items (or only outputFields), unique by your key, for example:

{ "url": "https://shop.example/p/0", "title": "Product 0", "price": 72.06, "source": "shop-crawl-mon", "scrapedAt": "2026-10-19T08:35:40.028Z" }

How fast does it remove duplicates? Our test

Result
Input3 datasets × 10,000 = 30,000 rows, 6,600 planted duplicate URLs (22.00 %)
Removedall 6,600 (23,400 distinct URLs in the output, checked independently)
Wall-clock time9.5 s (local run with file storage; on the Apify platform, time depends on dataset API reads)
Cost at list price23,400 × $0.00025 + $0.005 = $5.855. Billing all 30,000 rows would have been $7.505. Simulated locally; nothing was billed.

Synthetic data with exact URL duplicates is the easy case. Near-duplicates (same product, slightly different URL) are not detected; see Limitations.

Measured by Hartwell Toolworks, Oct 2026. Your results will vary.

Key features

  • ✅ Pre-flight check: every dataset is checked for existence and read access before anything is written or charged.
  • 🔐 Limited permissions: datasets are picked with Apify's dataset picker (READ only); the Actor does not list your runs, Actors or other storages.
  • 🌊 Streaming: reads 5,000 items per page and writes in batches of 1,000; memory is mainly one 80-bit hash per unique key.
  • 🔁 Retry-safe and migration-safe: backoff with jitter; checkpoints at page boundaries.
  • 🧮 Collision-safe keys: "ab"+"c" never equals "a"+"bc"; objects are compared regardless of key order.
  • 💸 Budget-aware: stops cleanly at Max total charge or maxOutputItems; items not output are not remembered as seen.

How much does it cost to deduplicate a dataset?

EventPriceWhen
item-output$0.00025 per unique item ($0.25 per 1,000)when a unique item is written
apify-actor-start$0.005 per start eventat run start (once per GB of memory; default 1 GB = 1 event)

Free: items read, duplicates, items seen in previous runs, items filtered by reference datasets, dropped items. Example: 100,000 items with 60,000 unique = $15.00 + $0.005.

How to merge and deduplicate Apify datasets

  1. Click Try for free.
  2. Datasets to merge: select datasets with the picker (use the dataset ID).
  3. Deduplicate by fields: e.g. url, or product.id and shop.
  4. Optional: Only output items not seen in previous runs + a State key (one per pipeline).
  5. Optional: reference datasets, output fields, max output items, Max total charge.
  6. Click Start. For scheduled scrapers, run it as a follow-up step with the same stateKey every time.

Input example

{
"datasetIds": ["aBcD1234EfGh5678", "IjKl9012MnOp3456"],
"dedupFields": ["url"],
"caseInsensitive": false,
"trimStrings": true,
"missingFieldMode": "keep-all",
"onlyNewItems": true,
"stateKey": "daily-products",
"updateState": true,
"outputFields": ["url", "title", "price.value"],
"addSourceDatasetId": true
}
FieldDefaultDescription
datasetIds–Datasets to merge (READ access). Without it, a 5-item demo runs.
dedupFieldsprefill ["url"]Fields whose combined value must be unique; dot paths allowed; empty = whole-item comparison.
caseInsensitive / trimStringsfalse / trueKey normalization (top-level string values).
missingFieldModekeep-allItems missing all dedup fields: keep-all, as-empty, drop.
onlyNewItems / stateKey / updateStatefalse / default / trueRemember output keys in dedup-state-<stateKey>; updateState: false = dry run.
referenceDatasetIds–Skip items whose key appears here.
outputFields / addSourceDatasetId– / falseField selection; add _sourceDatasetId.
maxOutputItems / pageSize / pushBatchSize0 / 5000 / 1000Limits and batch sizes.

Remove duplicates via API

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('grace_hartwell/dataset-merge-dedup').call({
datasetIds: ['aBcD1234EfGh5678', 'IjKl9012MnOp3456'],
dedupFields: ['url'],
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
const summary = await client.keyValueStore(run.defaultKeyValueStoreId).getRecord('OUTPUT');

FAQ

Which item is kept when there are duplicates?

The first one, in the order of the datasets you selected and the order of items within each.

How do I remove duplicates from JSON by more than one field?

List several fields, e.g. ["product.id", "shop"]. Items are duplicates only if all values match.

How does only-new-items mode work?

The Actor stores a hash of each output key in dedup-state-<stateKey>. The next run with the same key skips those items (seenInPreviousRuns).

Can it write into an existing dataset?

No. Output always goes to the run's default dataset (limited-permissions design).

Limitations: what this Actor does not do

  • Apify datasets only: no CSV/JSON files or URLs.
  • Exact matching only: no fuzzy or near-duplicate detection.
  • Keeps the first item; does not merge fields from duplicates.
  • Items missing all dedup fields are never deduplicated in keep-all mode and are output (and charged) again each run.
  • Datasets are read with clean: true (empty items and # fields are skipped).
  • No custom sorting; output follows read order.

Other Actors by Hartwell Toolworks

ActorWhat it does
HTML to Markdown Converter for LLM & RAGTurn the pages you scraped into clean Markdown for RAG
Broken Link Checker & Redirect Chain Checker404s, redirect chains and loops, with every hop
Bulk PageSpeed Insights & Core Web Vitals CheckLCP, INP, CLS with regression alerts

Found a bug or an edge case? Open an issue on the Issues tab.