Dataset Deduplicator & Merger: Merge, Dedupe CSV/JSON avatar

Dataset Deduplicator & Merger: Merge, Dedupe CSV/JSON

Pricing

$0.20 / 1,000 1,000 input items processeds

Go to Apify Store
Dataset Deduplicator & Merger: Merge, Dedupe CSV/JSON

Dataset Deduplicator & Merger: Merge, Dedupe CSV/JSON

Merge several Apify datasets and CSV/JSON files into one, remove duplicate items on the fields you choose, with trim, lowercase and URL/email normalization. Streams in pages, so 1M+ items work. $0.0002 per 1,000 input items.

Pricing

$0.20 / 1,000 1,000 input items processeds

Rating

0.0

(0)

Developer

Data Gleaner

Data Gleaner

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

8 days ago

Last modified

Features

Limited permissions

Share

Dataset Deduplicator & Merger: merge Apify datasets and CSV/JSON files, remove duplicates

Merge several Apify datasets, CSV files and JSON files into one dataset and drop duplicate items on the fields you choose. Compare values after normalization (trim, lowercase, strip https://www. and trailing slashes, lowercase emails), keep the first or the last copy, and tag every item with the source it came from. It reads in pages and keeps only a small fingerprint per distinct item, so inputs of a million items and more run in 512 MB instead of running out of memory.

It only processes data you point it at: your own datasets (or ones shared with your account) and file URLs you give it. It does not scrape any website.

What it is for

  • Combine the output of repeated scraper runs (daily Google Maps, jobs or product runs) into one list without the same business or listing twice.
  • Merge lead lists from several Actors or CSV exports and keep one row per email, domain or phone number.
  • Clean a CSV or JSON export before importing it into a CRM or database: Ada@Example.com and ada@example.com become one contact.
  • Build a master dataset from many runs, with a _sourceDataset field that tells you where each kept item first appeared.

How it works

  1. You give it dataset IDs and/or file URLs (any mix, any number). Sources are read one after another in the order given.
  2. For each item it builds a key from the dedupeFields you choose (or the whole item when the list is empty) after the normalization you select.
  3. The first copy of each key is kept (or the last, with keep: last); later copies are dropped. Items with no value in the dedupe fields cannot be judged duplicates and are kept unless you turn dropItemsWithoutKey on.
  4. Kept items are written unchanged to this run's default dataset, in batches. Normalization is used for comparing only; your values are never rewritten.

Memory use is about 100 bytes per distinct item, not per item size, which is why large inputs work. keep: last reads your sources twice, but you are billed for one read.

Input example

{
"datasetIds": ["WkzbQMuFYuamGv3YF", "x9F3tDgR2uKq1mLpA"],
"urls": ["https://example.com/export/contacts.csv"],
"dedupeFields": ["email"],
"normalize": ["trim", "emailLowercase"],
"keep": "first",
"includeSourceDataset": true
}

Leave every source empty to run a built-in 8-contact example (dedupes on email, 5 items come out). Fields:

FieldWhat it does
datasetId / datasetIdsDatasets to read (IDs or username~name). Must be on your account or shared with it.
urlshttp(s) links to CSV, JSON (array of objects) or JSON Lines files. Up to 500 MB (JSON arrays up to 150 MB; use JSON Lines for bigger).
dedupeFieldsFields that define a duplicate; dotted paths like contact.email work. Empty means the whole item.
normalizetrim, collapseWhitespace, emailLowercase, stripUrl, lowercase.
keepfirst (default) or last.
dropItemsWithoutKeyDrop items whose dedupe fields are all empty (default: keep them).
includeSourceDatasetAdd _sourceDataset to each item (default on).
maxItemsStop after this many input items (default 5,000,000).

CSV files are read with the delimiter found in the header (comma, semicolon, tab or pipe); every CSV value is a string, so 1 and 01 differ unless you compare on a text field.

Output example

{
"name": "Ada Lovelace",
"email": "ada@example.com",
"website": "https://www.example.com/",
"_sourceDataset": "WkzbQMuFYuamGv3YF"
}

The run's status message summarizes the result, for example: Read 120,000 items from 3 source(s), kept 97,412, removed 22,588 duplicates (keep first). Billed 120 x 1,000-item event(s). When nothing can be output (bad dataset ID, unreadable URL), one free notice row says why and the run still ends successfully.

Pricing

$0.0002 per 1,000 input items read (pay per event), counted on items read from your sources, whether they are kept or removed as duplicates, rounded up per run. Output rows are not charged. Unreadable sources and notice rows are free. Examples: 10,000 items cost $0.002; 1,000,000 items cost $0.20. Platform usage for the run is included in this price. Set a maximum charge on the run and the Actor stops reading at it, ending successfully with the items processed so far.

Why runs finish

Merge and dedupe jobs fail when they load everything into memory, when one unreadable source stops the whole run, or when the account cannot read the dataset. This Actor is built around those three:

  • Paged reads and fingerprints, not whole datasets in memory, so size is limited by the number of distinct items, not their size.
  • A source it cannot read does not fail the run. It is skipped, named in the status message, and the other sources are still merged.
  • Clear permission handling. The dataset picker declares read access to the dataset you choose. If a dataset ID cannot be read, the status message says it was not found or is not shared with this run.
  • Time limits end the run with output, not a timeout. It stops reading about 30 seconds before the run's time limit, writes what it has and says so.
  • Restart safe. If Apify moves the run to another machine, it does not write or bill the same items twice.

Limits

  • Items are compared exactly after normalization; there is no fuzzy matching, so Acme Inc and Acme Incorporated stay separate unless you compare on another field such as the domain.
  • keep: last and keep: first follow the order of the sources and the order of items inside each. Dataset order is the order they were pushed.
  • Memory: about 100 bytes per distinct item, so 512 MB covers a few million distinct items; raise the run memory above that.
  • Non-object JSON values (numbers, strings) are wrapped as {"value": ...}.
  • URLs on localhost or private networks are refused.

FAQ

Does it change my original datasets? No. It reads them and writes a new dataset in this run.

Can I dedupe one dataset against another without merging? Give both IDs and the same dedupe fields; the first dataset's items win, the second dataset's duplicates are dropped.

Which URL forms work? Any public http(s) link to a CSV, JSON or JSON Lines file, such as a file in a key-value store or cloud bucket, or a link from a data export. Only fetch files you have the right to process.

What does an empty input do? It runs the built-in example, says so in the status message, and succeeds with 5 items.

Responsible use

This Actor processes only the datasets and files you give it. If they contain personal data, such as names or emails, your own obligations under data-protection law (a lawful basis, retention, and honouring opt-outs) apply to what you do with the merged output; the Actor stores nothing beyond the run's output dataset, which you control. Only merge data you are allowed to use.