Merge Datasets & Remove Duplicates — Deduplicate, Filter, Excel
Pricing
from $0.20 / 1,000 row in the results
Merge Datasets & Remove Duplicates — Deduplicate, Filter, Excel
Merge datasets and remove duplicates in one call: combine Apify datasets, CSV, Excel, JSON or Google Sheets, dedupe by any field (smart URL/email/phone matching), filter, sort, keep only new rows, export CSV/Excel/JSON. Works from AI agents via Apify MCP (Claude, ChatGPT), n8n and the API.
Pricing
from $0.20 / 1,000 row in the results
Rating
0.0
(0)
Developer
tidydata
Maintained by CommunityActor stats
0
Bookmarked
73
Total users
46
Monthly active users
2 days ago
Last modified
Categories
Features
Share
🧹 Merge Datasets & Remove Duplicates — Deduplicate, Filter, Transform, CSV, Excel, JSON

Combine several Apify datasets, CSV, Excel and JSON files or Google Sheets into one clean dataset: remove duplicates (exact, smart or by merging the copies), filter, sort, add computed columns, split lists into rows, rename / pick / drop columns, keep only the rows you haven't seen in earlier runs, and export CSV, Excel or JSON with a download link. Built to run after your scrapers — one step between the scraper and your sheet, CRM or database.
$0.25 per 1,000 rows in the result. Rows removed as duplicates or by filters are free.
- ✅ Pick datasets from a list: the Apify selector gives this Actor exactly the permission it needs (no API tokens to paste)
- ✅ Merge any number of datasets plus CSV, Excel (.xlsx), JSON / JSON Lines files and public Google Sheets in one run
- ✅ Deduplicate by any field(s) (
url,placeId,email, or a combination) and keep the first, the last (most recent) or merge them — one row per group with empty fields filled from the other copies - ✅ Smart matching: ignore case and spaces; URLs ignore
http/https,www., trailing/,#anchorsand tracking parameters (utm_*,fbclid,gclid…); phones compare digits only - ✅ "Only new rows": remembers what earlier runs saw, so each scheduled run outputs just the new items
- ✅ Filters in plain text with AND / OR:
price < 50,country in ES, FR, IT,title contains phone,url regex /product/,email exists - ✅ Computed columns:
domain = {website|domain},fullName = {firstName} {lastName},price = {price|number} - ✅ Split a list column into rows (emails, reviews, variants…), sort by several columns, keep only some columns in your order, rename / drop columns, add a
_sourcecolumn - ✅ Flatten nested JSON (
price.value) so it fits a spreadsheet - ✅ CSV (Excel-friendly UTF-8), XLSX and JSON files with download links; cells that start with
=,+,-or@are neutralised so scraped text can't run as a formula - ✅ Clear error messages that tell you what to fix — input mistakes are never charged
- ✅ Free demo if you run it with an empty input
Filter a dataset (keep only the rows you want)
Use it as a dataset filter on its own — no merging needed: pick one dataset, write one rule per line and get only the matching rows, already sorted and exported to Excel or CSV.
rating >= 4.5reviewsCount > 100country in ES, PTwebsite existstitle not_contains closed
Choose all rules (AND) or any rule (OR). Operators: =, !=, >, >=, <, <=, contains, not_contains, starts_with, ends_with, in, not_in, regex, exists, not_exists. With >, >=, < and <=, prices written like 12,50 € or $1,299.00 are compared as numbers. You only pay for the rows you keep ($0.25 per 1,000) — filtered-out rows are free.
Typical uses
- Combine scheduled runs of Google Maps, Amazon, Instagram, TikTok, job or real-estate scrapers into one list without duplicates.
- Only new items: get just the listings, products, leads or posts that appeared since yesterday.
- Merge leads from several sources and fill the gaps (phone from one run, email from another).
- Clean before export: drop columns, rename them for your CRM, sort, filter and send a tidy CSV/Excel to Google Sheets, HubSpot, Airtable, Make, Zapier or n8n.
- Normalise URLs from different scrapers so the same page counts once.
How to use it
- Datasets to merge: pick them from your storages (or paste IDs). Optionally add CSV / Excel / JSON links or a Google Sheet.
- Remove duplicates by: type the field(s), e.g.
url. Choose first, last or merge them. Turn on Smart duplicate matching for messy URLs, emails or phones. - Optional: filters, Transform options (computed columns, split lists, sort, columns to keep / drop / rename,
_source), Only new rows, and the file formats you want. - Run. The result is in the dataset; files are in the Output tab.
Run it automatically after another Actor
Add it as an integration of your scraper and set Datasets to merge to {{resource.defaultDatasetId}}. Turn on Only new rows and every scheduled run outputs just the new items.
Full pipeline: scraper → clean → Google Sheets or your API
- In your scraper's Integrations tab add this Actor, with Datasets to merge =
{{resource.defaultDatasetId}}and Only new rows on. - In this Actor's Integrations tab add Google Sheets Export & Import (Dataset =
{{resource.defaultDatasetId}}, write mode Append without duplicates) or HTTP Request & Bulk API Calls to send every new row to your CRM, webhook or Clay table.
Every scheduled run then delivers only new, clean rows where you work.
Use it from AI agents (Claude, ChatGPT, Cursor) and n8n
Agents connected to Apify through the Apify MCP server (Claude, ChatGPT, Cursor, VS Code…) can call this Actor as a tool to merge datasets and remove duplicates after they run one or more scrapers — one call, no code:
- The agent runs the scrapers and keeps each run's
defaultDatasetId. - It calls
tidydata/merge-dedupe-datasetswith the minimal input:
{ "datasetIds": ["<defaultDatasetId 1>", "<defaultDatasetId 2>"], "dedupeFields": ["url"], "normalizeKeys": true }
- It reads the clean rows from this run's default dataset. The status message says what happened, e.g.
6 rows in → 3 after removing duplicates → 3 rows out.
- No token and no extra permissions: it runs with Apify's limited permissions and reads only the datasets listed in
datasetIds. - Mistakes are free and explained: a wrong input returns one row
{"error": "...", "charged": false}that says what to fix, so the agent can correct it and call again. - Files instead of datasets:
"fileUrls": [{"url": "https://…/leads.csv"}](CSV, Excel, JSON or a public Google Sheet). - Things you can ask your agent: "merge these two Google Maps runs and drop duplicate places", "dedupe these leads by email and keep the most recent", "keep only rows with rating >= 4.5 and give me a CSV".
- n8n, Make, Zapier or your own code: same input, see the next section.
Use it from n8n, Make or the API
Every example below uses the same input. It merges two small public sample CSV files, keeps companies with 4+ employees and removes duplicate emails (Info@BlueFox.example and info@bluefox.example count as the same one). Copy it, run it, then put your own dataset IDs or files in:
{"fileUrls": [{ "url": "https://api.apify.com/v2/key-value-stores/zCfleofV9kYG6liyw/records/sample-leads-a.csv" },{ "url": "https://api.apify.com/v2/key-value-stores/zCfleofV9kYG6liyw/records/sample-leads-b.csv" }],"dedupeFields": ["email"],"normalizeKeys": true,"keepRowsWithoutKey": true,"filters": ["employees >= 4"]}
Result: 8 rows in → 7 after filters → 5 after removing duplicates → 5 rows out (Northwind Bakery, Blue Fox Studio, Cedar Dental, Atlas Bikes and Harbor Cafe, which has no email and is kept).
API (one call, rows back in the response). Replace YOUR_APIFY_TOKEN with your token (Console → Settings → API & Integrations):
curl -X POST "https://api.apify.com/v2/acts/tidydata~merge-dedupe-datasets/run-sync-get-dataset-items" \-H "Authorization: Bearer YOUR_APIFY_TOKEN" \-H "Content-Type: application/json" \-d '{"fileUrls":[{"url":"https://api.apify.com/v2/key-value-stores/zCfleofV9kYG6liyw/records/sample-leads-a.csv"},{"url":"https://api.apify.com/v2/key-value-stores/zCfleofV9kYG6liyw/records/sample-leads-b.csv"}],"dedupeFields":["email"],"normalizeKeys":true,"keepRowsWithoutKey":true,"filters":["employees >= 4"]}'
It answers with the clean rows as a JSON array. This call waits up to 300 seconds; for very big merges start the run with POST /v2/acts/tidydata~merge-dedupe-datasets/runs and read /v2/datasets/{defaultDatasetId}/items when it finishes.
n8n. Two ways:
- Apify node (
@apify/n8n-nodes-apify) → operation Run an Actor and get dataset → Actortidydata/merge-dedupe-datasets→ Custom input = the JSON above. To clean what a scraper just found, put the scraper's Run an Actor node first and use"datasetIds": ["{{ $json.defaultDatasetId }}"]in Custom input (field in Expression mode). - Or an HTTP Request node → Import cURL → paste the curl command above (with your token).
Make. Apify app → Run an Actor → Actor Merge Datasets & Remove Duplicates, Run synchronously = Yes, input = the JSON above. Then Apify → Get Dataset Items with Dataset ID = the Default dataset ID of the first module. From a scraper: run it first and map its Default dataset ID into "datasetIds".
Zapier. Apify app → Run Actor (synchronously; Zapier waits at most 30 seconds, plenty for a merge like this one) with the same input, then Fetch dataset items.
Example: two scraper runs → one clean list
A real run: two lead lists of the same businesses, scraped on different days. The website is written differently in each (www., http, a trailing /, a utm_source tag), one list has the phone and the other the email.
Input
{"datasetIds": ["<Monday run>", "<Tuesday run>"],"dedupeFields": ["website"],"normalizeKeys": true,"keep": "merge","filters": ["rating >= 4.5"],"addSourceField": true,"exportFormats": ["csv"]}
What happened (status message of the run): 6 rows in → 5 after filters → 3 after removing duplicates → 3 rows out
Output (dataset, also saved as merged.csv in the Output tab)
[{"title": "Sunrise Bakery","website": "https://www.sunrise-bakery.example/","phone": "+34 600 111 222","email": "hello@sunrise-bakery.example","rating": 4.7,"_source": "<Monday run>","_duplicates": 2},{"title": "Corner Books","website": "https://cornerbooks.example/?utm_source=maps","phone": "+34 600 555 666","email": "info@cornerbooks.example","rating": 4.9,"_source": "<Monday run>","_duplicates": 2},{"title": "Green Leaf Florist","website": "https://greenleaf.example/","phone": "+34 600 777 888","email": "shop@greenleaf.example","rating": 4.6,"_source": "<Tuesday run>"}]
The café rated 4.4 was filtered out, the two bakeries and the two bookshops were recognised as the same website and merged, and each merged row got the phone from one list and the email from the other. You pay for 3 rows (less than $0.001) plus one CSV file.
Filters
One rule per line: field operator value. Choose whether a row must pass all rules (AND) or any of them (OR).
| Operator | Example |
|---|---|
=, != | country = ES |
>, >=, <, <= | price < 50 (numbers are compared as numbers) |
contains, not_contains | title contains phone |
starts_with, ends_with | url starts_with https://shop. |
in, not_in | country in ES, FR, IT |
regex, not_regex | url regex /product/\d+ (case-insensitive) |
exists, not_exists | email exists |
Filters, duplicate keys, sorting and Keep only these columns use the original column names (and computed columns); renaming and dropping happen at the end.
Computed columns
One per line: newColumn = template. Use {field} (nested fields with dots: {price.value}) and functions with |:
| Function | Example | Result |
|---|---|---|
domain | {website|domain} | https://www.shop.com/a → shop.com (also from emails) |
number | {price|number} | "1.234,50 €" → 1234.5 |
digits | {phone|digits} | +1 (202) 456-1111 → 12024561111 |
lower, upper, title, trim | {email|lower} | Ana@Gmail.com → ana@gmail.com |
first, length | {images|first}, {reviews|length} | first item / number of items |
nohtml, slug | {description|nohtml} | text without HTML tags |
Example: fullName = {firstName} {lastName} · site = {url|domain} · priceNum = {price|number}.
Merge duplicates instead of dropping them
With Which duplicate to keep → Merge them, each group of duplicates becomes one row: the first copy is the base and every empty field is filled from the other copies. A _duplicates column tells how many rows were merged. Perfect when one run found the phone and another the email.
Analyze the results with AI
After merging and cleaning, enrich the rows with Bulk ChatGPT & Claude for Datasets: classify, extract fields from messy text, summarize or translate every row into new columns.
Run it as an integration: in this Actor's Integrations tab add Bulk ChatGPT & Claude and set its datasets to {{resource.defaultDatasetId}}, so every run is analyzed automatically. No API key needed.
Pricing
- $0.25 per 1,000 rows in the result ($0.00025 each)
- $0.005 per file created (CSV, XLSX or JSON)
Rows removed as duplicates or by filters are free. A 100,000-row dataset reduced to 60,000 unique rows costs $15. Higher Apify plans get an automatic discount.
Notes
- Memory for "only new rows" is a named storage in your account (default name
merge-dedupe-memory); use a different name per project, or delete the storage to start over. Changing the duplicate fields or Smart duplicate matching changes what counts as "seen". - By default, rows where all duplicate fields are empty count as one group; turn on Keep rows with empty duplicate fields to keep them all.
- Google Sheets must be shared as "Anyone with the link can view". Only the first sheet of an Excel file is read.
- Big merges happen in memory. With the default 2 GB a run handles roughly 100,000 rows of rich scraper data (long texts, many columns) up to about 1,000,000 short rows. If the data doesn't fit, the run stops before charging anything and says how much memory to choose (Run options → Memory); if only an export file doesn't fit, the rows are delivered and that file is skipped (not charged).
- Only your own data is processed and it is never sent anywhere else. If a run crashes, the Actor sends us only an anonymous error code (error type and line of our code, no input, no data) so we can fix it fast.
FAQ
Do I need an API token or any setup? No. Pick your datasets with the selector in the input and the Actor gets permission to read exactly those. Files and Google Sheets only need a public link.
Does it work with limited permissions? Yes. It runs with Apify's limited permissions (it can't touch anything in your account except the datasets you pick and its own storages), so you can dedupe datasets safely in shared and organization accounts, schedules and integrations.
What does a row in the result look like? Your own columns, cleaned the way you chose (nested JSON flattened to price.value, renamed, dropped or computed columns), plus _source and _duplicates if you turned them on. See the example above.
How do I get only the new rows every day? Turn on Only new rows with at least one duplicate field (e.g. url). The Actor remembers what earlier runs saw in a named storage of your account, so each scheduled run outputs only what is new. Use a different memory name per project.
Can it run automatically after my scraper? Yes. Add it as an integration of your scraper with Datasets to merge = {{resource.defaultDatasetId}}, or put both in a schedule. It also works from Make, Zapier, n8n or the Apify API like any other Actor.
Can an AI agent use it through the Apify MCP server? Yes. Claude, ChatGPT, Cursor or any MCP client connected to Apify can find it with words like merge datasets or remove duplicates and call it with {"datasetIds": ["<id>"], "dedupeFields": ["url"]}. It needs no token or extra permissions, and input mistakes come back as a free row that explains the fix.
What do I pay for? $0.25 per 1,000 rows in the result and $0.005 per export file. Rows removed as duplicates or by filters are free, input mistakes are never charged, and an empty input runs a free demo.
How big can the data be? It depends on the memory of the run (the merge happens in memory): with the default 2 GB, roughly 100,000 rich scraper rows up to about 1,000,000 short rows. If it doesn't fit, you get a free message telling you which memory to pick, never a half-charged crash. For more, raise the run memory or merge in batches.
Why are two rows I expected to merge still separate? The duplicate fields must match. Turn on Smart duplicate matching for URLs, emails and phones written differently, and check the run log: it warns when a duplicate field doesn't exist in your data.
Related Actors
- Phone Number Validator & Formatter and Email Validator & List Cleaner — clean the contact columns of the merged list.
- Google Sheets Export & Import — send the result to a Google Sheet, appending without duplicates.
- HTTP Request & Bulk API Calls — call your API, CRM or a webhook once for every row of the result (
{{column}}templates, retries, $1 per 1,000 requests).