Merge & Dedupe Datasets: CSV, JSON, Excel Converter avatar

Merge & Dedupe Datasets: CSV, JSON, Excel Converter

Pricing

from $0.10 / 1,000 row in the results

Go to Apify Store
Merge & Dedupe Datasets: CSV, JSON, Excel Converter

Merge & Dedupe Datasets: CSV, JSON, Excel Converter

Merge Apify datasets and CSV, JSON or JSON Lines files into one clean table. Remove duplicates by any fields (exact or fuzzy: case, accents, URLs, phones), rename and pick columns, export to CSV, Excel, JSON. Streams millions of rows. $0.10 per 1,000 rows.

Pricing

from $0.10 / 1,000 row in the results

Rating

0.0

(0)

Developer

Kacper Gumieniuk

Kacper Gumieniuk

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

14 days ago

Last modified

Features

Limited permissions

Share

Merge & Dedupe Datasets combines Apify datasets and CSV, JSON or JSON Lines files into one clean table. It removes duplicates by the fields you choose (exact, or normalized: case, accents, punctuation, www/https/trailing slashes, utm_ tracking, phone formats), renames and picks columns, and writes the result to a dataset plus CSV, Excel (XLSX), JSON and JSON Lines files. It streams page by page, so a million-row merge fits in the default 1 GB of memory.

Try it now: press Start. The prefilled input merges two public country lists (a CSV and a CSV with other column names), renames the columns to match, removes 249 duplicates and gives you a 249-row dataset, CSV and Excel file in a few seconds for about $0.03. Price: $0.10 per 1,000 rows in the result. Duplicates, filtered rows and failed sources are free. Apify's free plan ($5 of monthly credit) covers about 49,000 result rows a month.

Use cases

  • Merge runs of a scraper: combine yesterday's and today's datasets (or 20 parallel runs) into one table without repeats. Keep last keeps the freshest copy of each item.
  • Only new items for scheduled pipelines: turn on Only new items and attach the actor to your scraper's runs; each run outputs only rows you have never received before, ready for Slack, Sheets or a CRM. Already-seen rows are free.
  • Delta between two runs (no setup): put today's dataset in Datasets and yesterday's in Compare with datasets: you get only the rows that are new today. Ideal before "append to Google Sheets" steps in n8n or Make, which otherwise create duplicates. Matched by your dedupe fields; skipped rows are free.
  • Clean lead or product lists: dedupe by website, email or phone even when they are written differently (HTTPS://www.acme.com/ and acme.com match; +1 (415) 555-0100 and 14155550100 match).
  • Convert formats: dataset → Excel or CSV with nested fields flattened into columns; CSV/TSV/JSON/JSONL files → an Apify dataset you can query through the API.
  • Combine sources with different column names: rename link to url in one source and dedupe across both.
  • Prepare data for AI agents and LLMs: drop heavy fields (HTML, screenshots), keep the columns that matter and hand over one compact file.

How to use Merge & Dedupe Datasets

  1. Pick datasets in Datasets (from your storage or past runs) and/or paste File URLs: JSON, JSON Lines, CSV or TSV (gzipped too), Apify API item URLs with your token, or Google Sheets shared as "anyone with the link".
  2. Put the identity of a row into Deduplicate by fields (e.g. url, or name + city). Leave it empty to remove rows that are identical in every field.
  3. Optionally rename, keep only or remove fields, and choose Output formats.
  4. Press Start. The run's Output tab links the dataset and the files (merged.csv, merged.xlsx, ...); the SUMMARY record shows rows read, duplicates and errors per source.
  5. To process every run of another actor automatically: open that actor → Integrations → Connect Actor or Task → this actor, with input {"datasetIds": ["{{resource.defaultDatasetId}}"], "onlyNewItems": true, ...}.

The pipeline runs in a fixed order: rename → required fields → deduplicate → keep/remove fields → flatten.

Input

{
"datasetIds": ["aBcDeFgHiJkLmNoPq", "QrStUvWxYz0123456"],
"sourceUrls": ["https://example.com/export/products.csv"],
"renameFields": { "link": "url", "title": "name" },
"dedupeFields": ["url"],
"dedupeMode": "normalized",
"keep": "last",
"fields": ["url", "name", "price", "seller.name"],
"outputFormats": ["dataset", "csv", "xlsx"]
}
FieldWhat it does
datasetIdsApify datasets, picked in the dataset picker (gives this actor read access to just those datasets).
sourceUrlsJSON array, JSON Lines, CSV/TSV (delimiter detected), .gz; Apify API .../items?token= URLs (paged); Google Sheets links.
dedupeFieldsFields that identify a row; nested paths like address.city. Empty = whole-row duplicates.
dedupeModenormalized (default), exact or none.
keepfirst (default) or last occurrence of each duplicate.
renameFields{"old": "new"}, applied first so sources line up before deduplication.
fields / omitFieldsKeep only these fields (in this order) / drop these fields.
requireFieldsDrop rows where any of these is empty (free).
onlyNewItems + memoryNameSkip rows output by earlier runs with the same memory name.
compareDatasetIds, compareUrlsDelta mode: skip rows whose identity is in these previous datasets or files.
outputFormatsAny of dataset, csv, xlsx, json, jsonl (one price per row, however many).
arrayFormatArrays in CSV/Excel: join (a; b), columns (tags/0, tags/1) or json.
maxItems, addSourceField, flattenDataset, csvDelimiter, inputFormatLimits and format details.

Output

The dataset holds the merged rows in their original shape (or flattened, with flattenDataset). A row from the advanced example (examples/input-advanced.json: two overlapping product exports, keep: last, picked fields):

{
"id": 1,
"name": "Essence Mascara Lash Princess",
"brand": "Essence",
"price": 9.99,
"tags": ["beauty", "mascara"],
"dimensions": { "width": 15.14, "height": 13.08, "depth": 22.99 },
"meta.barcode": "5784719087687",
"_source": "https://dummyjson.com/products?limit=100"
}

The same row in merged.csv and merged.xlsx (nested fields as dimensions/width columns, like Apify's own export; Excel gets real numbers, a bold frozen header row and no row limit below Excel's 1,048,575):

id,name,brand,price,tags,dimensions/width,dimensions/height,dimensions/depth,meta.barcode,_source
1,Essence Mascara Lash Princess,Essence,9.99,beauty; mascara,15.14,13.08,22.99,5784719087687,https://dummyjson.com/products?limit=100

The SUMMARY record: per source rows read, duplicates, rows without required fields and the error if it failed; totals; the column list; and a direct link to each file.

How much does merging cost?

EventPriceExample
Row in the result$0.000110,000 unique rows = $1; 1,000 rows = $0.10
Actor start (per GB of run memory)$0.002default 1 GB run = $0.002
Duplicates removed, rows without required fields, already-seen rows (only-new and delta mode), failed sourcesfree

One price per row whether you pick one output format or all five. Platform usage is included. Set a maximum cost per run and the actor stops there, with every file containing exactly the rows you paid for.

Built not to fail

  • Streams instead of loading everything: datasets are read 5,000 items per request and files are parsed while they download, so memory holds only one 16-byte key per unique row (1 million rows ≈ 400 MB peak).
  • Retries and resume: 429/5xx answers and timeouts are retried with backoff; a download that breaks mid-file is re-opened and continues after the last row read.
  • One bad source does not sink the run: it is reported in SUMMARY and the status message, the other sources are merged. The run fails only when every source fails (and then nothing is charged).
  • Clear errors: "The URL returned a web page, not a data file", "No access to dataset X: select it in the Datasets picker", "Line 812 is not valid JSON".
  • Limited permissions: the actor can read only the datasets you pick and write only its own outputs.

FAQ

What counts as a duplicate in normalized mode?

Text is compared ignoring case, accents, punctuation and extra spaces (Café Müller, GmbH = cafe muller gmbh). URLs ignore http/https, www., a trailing slash, #fragments and tracking parameters (utm_*, gclid, fbclid). Emails are compared lowercased, phone numbers by their digits. Use exact for byte-for-byte matching.

Why did I get "No access to dataset"?

Datasets must be chosen in the Datasets picker: that grants this actor read access to exactly those datasets. A dataset ID pasted into File URLs has no grant. Alternatively paste the dataset's API items URL with your token.

How big can the merge be?

Millions of rows. Memory holds ~70 bytes per unique row (1 GB ≈ 3 million unique rows, 4 GB ≈ 15 million); files are written to disk first (disk = 2× run memory). Excel stops at 1,048,575 rows; CSV/JSON have no limit.

Can it remember rows between runs?

Yes: Only new items with a Memory name stores the identities of output rows in a named key-value store in your account (merge-dedupe-memory-<name>). Delete that store to start over.

How do I get only the rows that are new since the last run?

Two ways. Delta mode compares with datasets or files you name: put the previous run's dataset (or the Google Sheet you append to) in Compare with. Only new items keeps its own memory across scheduled runs, so you never pass the previous dataset. Both match rows by Deduplicate by fields: url or id for "new items", empty (whole row) for "new or changed". In n8n, call this actor between the scraper and the Append row step, e.g. {"datasetIds": ["{{ $json.defaultDatasetId }}"], "compareUrls": ["<your sheet link>"], "dedupeFields": ["url"]}.

Can I call it from code or an AI agent?

Yes: the Apify API (run-sync-get-dataset-items returns the merged rows), the JavaScript and Python clients, or the Apify MCP server. An agent can merge several runs' datasets and receive one deduplicated table.

Integrations and API

Attach it to any actor or task (Integrations → Connect Actor), schedule it, call it through the API, or connect the dataset to Google Sheets, Make, Zapier, n8n, Airbyte or webhooks.

Not affiliated with Google or Microsoft; Google Sheets and Excel are their trademarks.