Merge & Deduplicate Datasets: Remove Duplicates, Only New Rows avatar

Merge & Deduplicate Datasets: Remove Duplicates, Only New Rows

Pricing

from $0.05 / 1,000 rows

Go to Apify Store
Merge & Deduplicate Datasets: Remove Duplicates, Only New Rows

Merge & Deduplicate Datasets: Remove Duplicates, Only New Rows

Merge Apify datasets with CSV, TSV, JSON and JSON Lines files and drop duplicate rows by any fields or whole rows, matching URLs, e-mails, case and spacing smartly. Scheduled runs can return only rows that earlier runs did not. $0.05 per 1,000 unique rows, $0.001 per 1,000 rows read.

Pricing

from $0.05 / 1,000 rows

Rating

0.0

(0)

Developer

Greenrun

Greenrun

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

15 hours ago

Last modified

Categories

Features

Limited permissions

Share

Merge Apify datasets with CSV, TSV, JSON and JSON Lines files and drop duplicate rows by any fields or whole rows, matching URLs, e-mails, case and spacing smartly. Scheduled runs can return only rows that earlier runs did not. $0.05 per 1,000 unique rows, $0.001 per 1,000 rows read.

Give it the datasets of your scraper runs, links to CSV, TSV, JSON or JSON Lines files, or rows pasted as JSON, and get one clean dataset with every row once. Duplicates are found by the fields you choose (url, email, name + city ...) or by the whole row, after smart normalization: https://www.shop.com/p/1/?utm_source=x and http://shop.com/p/1 are the same product, ADA@Example.com and ada@example.com the same person. With only-new mode a scheduled run returns just the rows your earlier runs have not returned yet. You pay $0.05 per 1,000 unique rows written and $0.001 per 1,000 rows read, duplicates included, with no fee per file or dataset. Made for scraper pipelines, lead lists, product catalogs and AI agents that collect data in several runs.

What it does

  • Merges any number of Apify datasets, public CSV, TSV, JSON and JSON Lines files (plain or gzip) and rows given in the input, in that order, into one dataset.
  • Removes duplicates by one or more fields, dot paths for nested values (seller.id, images.0), or by the whole row when no field is given. The first copy is kept.
  • Normalizes before comparing: web addresses without http/https, www., default port, #fragment, trailing slash and tracking parameters (utm_*, gclid, fbclid ...), query parameters in any order; e-mails in any letter case; upper and lower case; extra whitespace; 1, 1.0 and "1" are equal. The output keeps your original values.
  • Returns only new rows when you want: the keys of written rows are remembered in a key-value store in your account (12 bytes per row), and later runs with the same memory name skip them.
  • Filters and trims: skip rows without the required fields, keep only the output fields you list, add a _source field with the dataset or file each row came from, stop after a number of rows.
  • Reports every source in the RUN-REPORT record: format detected, rows read, written, duplicates, seen before, filtered, rejected, and why a source could not be read.

Why use it

  • $0.05 per 1,000 unique rows written, $0.001 per 1,000 rows read. No fee per file or dataset; links that cannot be read cost nothing beyond the start of the run.
  • Large datasets in small memory. Rows are streamed from the datasets and files; memory holds a 12-byte key per unique row, never the rows. About 7 million unique rows fit in the default 1 GB.
  • Reliable runs. Datasets are read in windows that resume after a broken connection, a run moved to another server by the platform continues where it stopped without writing or charging a row twice, and a silent server never keeps a run waiting longer than the run has paid for.
  • Works with limited permissions. It reads only the datasets you pick (read-only), so it runs in the Apify MCP server and in integrations. No proxies, no login; robots.txt is respected for file links.
  • Built for AI agents. One status message with the numbers (Done: 249 unique rows written from 498 read; 249 duplicates (not written)), inline rows in the input, and common field names of other merge Actors accepted (fields, rows, maxItems ...).

How to use

In Apify Console

  1. Pick your datasets in Apify datasets, or paste links in File links, or both.
  2. Optional: list the fields in Remove duplicates by these fields (empty: whole rows); switch on Only rows not written by earlier runs and give a Memory name for scheduled runs.
  3. Press Start. The Output tab shows the merged rows; download them as CSV, Excel, JSON or XML from the dataset. The RUN-REPORT record has the counts per source.

After another Actor (integration)

Add this Actor as an integration of your scraper, with "datasetIds": ["{{resource.defaultDatasetId}}"], "dedupeFields": ["url"] and "onlyNew": true: every scraper run then ends with a dataset of the new rows only.

From an AI agent (MCP)

Connect any MCP client to the Apify MCP server with only this Actor as a tool:

https://mcp.apify.com?tools=greenrun/dataset-merge-dedup

Through the API

curl -X POST "https://api.apify.com/v2/acts/greenrun~dataset-merge-dedup/run-sync-get-dataset-items" \
-H "Authorization: Bearer <APIFY_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"datasetIds": ["<DATASET_ID_1>", "<DATASET_ID_2>"], "dedupeFields": ["url"], "onlyNew": true, "memoryName": "my-shop-monitor"}'

Dataset IDs given through the API work like datasets picked in the form; a dataset can also be given by its name.

Input

FieldDefaultDescription
datasetIdsApify datasets to merge, in this order (picker in the form, IDs or names through the API).
fileUrlsLinks to CSV, TSV, JSON (an array, or one object with the rows inside) or JSON Lines files, plain or gzip. Read after the datasets.
itemsRows as a JSON array of objects, read last.
dedupeFieldswhole rowRows with the same values in all these fields are duplicates. Dot paths for nested fields.
normalizeUrlstrueCompare web addresses and e-mails in their normalized form.
dedupeIgnoreCasetrueIgnore upper and lower case when comparing.
trimWhitespacetrueIgnore extra spaces, tabs and line breaks when comparing.
keepRowsWithoutKeytrueRows where every field in dedupeFields is empty: keep each (on) or only the first (off).
requiredFieldsRows where any of these fields is missing or empty are skipped (read, not written).
onlyNewfalseSkip rows written by earlier runs with the same memory name (read, not written).
memoryNamedefaultRuns with the same name share their memory (key-value store dataset-merge-dedup-<name> in your account, 12 bytes per row).
outputFieldsallKeep only these fields, in this order; a dot path becomes a field with the dotted name.
addSourceFieldfalseAdd _source: dataset:<ID>, the file link or input items.
maxRows0Stop after this many unique rows; 0 means no limit.
csvDelimiterdetected, ; `
itemsPathdetectedFor a JSON file that is one object: the dotted path to its list of rows, for example data.items.

Output

From a run on the Apify platform on 21 November 2026 with the prefilled input, two identical CSV files (the main and master copies of the country list from github.com/datasets): 249 rows, all from the first file.

[
{"Name": "Afghanistan", "Code": "AF"},
{"Name": "Albania", "Code": "AL"},
{"Name": "Algeria", "Code": "DZ"}
]

Status message: Done: 249 unique rows written from 498 read; 249 duplicates (not written). All 2 sources read. The same day, a scheduled-style run in only-new mode over a 20,000-row dataset whose first 19,900 rows were remembered from earlier runs wrote just the 100 new rows: Done: 100 unique rows written from 20,000 read; 19,900 seen in earlier runs (not written).

RUN-REPORT (shortened) lists each source and the events the run charged:

{
"summary": "Done: 249 unique rows written from 498 read; 249 duplicates (not written). All 2 sources read",
"totals": {"read": 498, "written": 249, "duplicates": 249, "seenBefore": 0, "filtered": 0, "rejected": 0, "notWritten": 0},
"sources": [
{"source": "https://raw.githubusercontent.com/datasets/country-list/main/data.csv", "type": "file", "status": "read", "format": "csv (delimiter ,)", "read": 249, "written": 249, "duplicates": 0, "error": null},
{"source": "https://raw.githubusercontent.com/datasets/country-list/master/data.csv", "type": "file", "status": "read", "format": "csv (delimiter ,)", "read": 249, "written": 0, "duplicates": 249, "error": null}
],
"dedupeFields": "whole row",
"events": {"row-read": 50, "row": 249},
"readUnits": 498,
"startEvents": 1,
"stoppedBecause": null
}

A source has the status read, partial (rows up to a broken place in the file were used), failed, blocked (robots.txt or the site refused), not_found, stopped (the run stopped in it at maxRows, the maximum cost or the memory limit) or skipped (the run stopped before it), with the reason in error.

Pricing

Pay per event, no subscription. Each part of the work has its own small price, so every run pays for what it uses:

EventPriceWhen
Row$0.00005One unique row written to the output, per started 100 KB of the row.
Row read$0.00001Each started 10 rows read, summed over the whole run: datasets, files and the input, duplicates and filtered rows too; a row counts once per started 2 KB. A file counts per started 2 KB as it downloads, and its rows use that up first.
Only-new memory$0.0002Each started 100,000 keys of the only-new memory, read or added in a run (at least one when only-new is on).
Actor start$0.0045 per GB of memoryCharged by Apify when the run starts (the default memory is 1 GB).

Examples: 1,000 rows read and 600 unique ones written cost $0.03 + $0.001 (100 row-read events), plus $0.0045 for the start. A daily only-new run after a scraper that reads 20,000 rows and finds 100 new ones costs $0.02 + $0.005 + $0.0002 + $0.0045 = $0.0297. Rows read are summed over the run and rounded up once: 1,005 rows read are 101 row-read events ($0.00101).

Not charged: rows of links and datasets that cannot be read (missing, blocked or broken). You can cap the cost of a run with the maximum charge in the run options; the run stops cleanly at that limit and the status message says so.

Limits

  • Formats: Apify datasets, CSV, TSV, JSON, JSON Lines, gzip-compressed or not. No Excel and no Google Sheets: save the sheet as CSV and use its link.
  • File links must be public; no login, cookies or proxies, and robots.txt is respected. A file can be up to twice the run memory in size (1 GB memory: about 1.7 GB). A JSON file that is one object (not an array) is read whole, up to 100 MB.
  • Waiting: the Actor waits for a server only as long as the run has already paid for (about 20 seconds for the first link at 1 GB of memory, more once rows come in). A link that stays silent fails, and when the links so far gave no data, the rest are skipped with the reason in RUN-REPORT.
  • One row can be up to 8 MB (the dataset limit is 9 MB per row).
  • Memory: 512 MB to 4 GB; one CPU core does the work, so more memory would not be faster. About 7 million unique rows (including the remembered rows of only-new mode) fit in the default 1 GB; the run stops cleanly and says so when the memory is full.
  • The first copy of a duplicate is kept, in the order datasets, files, rows. Rows without a key (every dedupe field empty) are not remembered by only-new mode. Two only-new runs with the same memory name at the same time can each miss the other's new rows: run them one after another.

FAQ

Do you keep the data? No. Results stay in your run's dataset and key-value store, and the only-new memory in the dataset-merge-dedup-<name> key-value store, all in your own Apify account under your data retention settings.

How do I start the only-new memory again? Use a new memoryName, or delete the dataset-merge-dedup-<name> key-value store in Storage.

What did my run cost? The RUN-REPORT record in the key-value store has events, the number of each event the run charged, and readUnits, the rows read in 2 KB units (one row-read event per started 10 of them), next to the counts per source (read, written, duplicates, seen before, filtered, rejected), examples of rejected rows and the reason for every source that could not be read.

Can I get the result as CSV or Excel? Yes: download the run's dataset in the format you need from the Storage tab or through the API (format=csv, format=xlsx).

Something is wrong with a result? Open an issue on the Actor's Issues tab with the input.