Merge Datasets: Deduplicate, Filter & Transform Apify Data
Pricing
$0.50 / 1,000 record writtens
Merge Datasets: Deduplicate, Filter & Transform Apify Data
Merge several Apify datasets into one, remove duplicates by any fields, filter rows, and rename or drop columns. Streams the data, so large datasets do not crash it.
Pricing
$0.50 / 1,000 record writtens
Rating
0.0
(0)
Developer
Registry Data
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
a day ago
Last modified
Categories
Features
Share
Dataset Merger: Merge, Deduplicate & Filter Apify Datasets
Combine the results of several Apify Actor runs into one clean dataset. Pick your datasets, say which fields make two records "the same", and get one deduplicated dataset back, optionally filtered and with columns renamed or removed. It streams records instead of loading everything into memory, reports exactly what it did, and never fails a whole run because one record is odd.
Price: $0.50 per 1,000 records written. Set a maximum cost per run and the run stops there. Details under Pricing.
Typical use: you run the same scraper daily, or several scrapers for the same niche, and you want one list without repeats.
What it does
| Step | What happens |
|---|---|
| 1. Read | Reads every record of every dataset you pick, page by page, until the end. |
| 2. Filter (optional) | Keeps only records that match your rules (for example price greater than 50). |
| 3. Deduplicate | Removes repeats by the fields you choose, or by whole-record equality if you choose none. Keeps the first or the last occurrence. |
| 4. Reshape (optional) | Keeps only some fields, removes others, renames columns, and can add a source_dataset column. |
| 5. Write | Writes the result to this run's dataset and saves a SUMMARY record with counts per source. |
Order matters and is fixed: filters run first, deduplication second, reshaping last. Duplicates are therefore found on your original field names, not on renamed ones.
Try it with no setup: run it with the default (empty) input and it merges two small built-in sample datasets, so you can see the output format before pointing it at your own data.
Use cases
- Lead generation and sales: merge daily scraper runs and keep one row per company URL or phone number.
- Price and product monitoring: union several marketplaces, then keep the latest record per product URL (
keep: last). - Data teams: clean a dataset before exporting it to a spreadsheet, a warehouse or a vector database.
- Agencies: deliver one deduplicated file per client from many runs.
Input
Pick the datasets from your account with the dataset picker. Records from earlier datasets win ties when keep is first.
{"datasets": ["<dataset picked from your account>", "<another dataset>"],"dedupeFields": ["url"],"keep": "first","ignoreCase": true,"filters": [{"field": "price", "operator": "greaterThan", "value": 50}],"omitFields": ["rawHtml"],"renameFields": {"fullName": "name"},"addSourceField": true,"maxItems": 0}
| Field | Meaning |
|---|---|
datasets | Datasets to merge, chosen in the picker. The Actor can only read datasets you choose here. Leave empty (and leave extraDatasetIds empty) to run the built-in demo. |
extraDatasetIds | Optional extra dataset IDs, names or Console URLs (for example from an integration or API call). Must be readable with this run's permissions. |
dedupeFields | Fields that identify a duplicate. Dotted paths such as address.city reach nested values. Empty means "every field identical". |
keep | first (default) or last. last reads the data twice. |
ignoreCase, trimWhitespace | Make comparison forgiving (HTTPS://X.com/a equals https://x.com/a). Whitespace trimming is on by default; case folding is off. |
keepItemsWithMissingKey | On (default): records lacking a key field are kept as unique. Off: a missing field counts as null. |
filters, filterMode | List of {field, operator, value}. Operators: equals, notEquals, contains, notContains, startsWith, endsWith, greaterThan, greaterThanOrEqual, lessThan, lessThanOrEqual, matchesRegex, exists, notExists, isEmpty, isNotEmpty. filterMode is all or any. |
pickFields, omitFields, renameFields | Keep only these fields, drop these fields, rename fields. |
addSourceField, sourceFieldName | Add a column naming the dataset each record came from. |
maxItems | Stop after this many output records; 0 means unlimited. Also caps your spend. |
Numbers in text form compare as numbers ("7" is less than 50), ISO 8601 dates compare correctly as text, and booleans match true and false.
Output
Example output record (real output from a test run with the filter above):
{"url": "https://shop.example.com/products/0","name": "Product 0","price": 71.51,"city": "Austin","source_dataset": "demo-a"}
Output records have the same fields as your inputs (after your reshaping). The SUMMARY record in the key-value store lists records read, filtered out, duplicates removed, unusable records skipped, and records written, per source dataset.
Pricing
Pay per event: $0.50 per 1,000 records written (each record in the output dataset is one billed result; Apify may also show a small per-run start event on the pricing tab). You are charged only for records that reach the output, not for records that were read and discarded as duplicates or filtered out.
Example: merge 5 datasets holding 60,000 records that contain 20,000 duplicates. 40,000 records are written, so the run costs 40 x $0.50 = $20.00. Merging 1,000 unique records costs $0.50. Set maxItems to cap a run.
Limits and honest notes
- Access: limited-permission Actors can only read datasets you select in the picker. That is an Apify security rule, and it is why you must choose datasets there (or use
extraDatasetIdsfor datasets this run's token can read). - Memory: duplicate detection keeps one 16-byte fingerprint per unique record in memory. In our synthetic benchmark, 1,000,000 records with 750,000 unique used about 130 MB (
keep: first) or 150 MB (keep: last) of peak memory in the pipeline itself. Choose at least 512 MB for datasets above a few hundred thousand records, and 1 GB or more above a few million. - Records that are not JSON objects (a bare string or number in a dataset) are skipped and counted in the summary.
- Fingerprints are 128-bit hashes, so an accidental false duplicate is astronomically unlikely (below 1 in 10^20 for 10 million records).
- Unreadable or missing datasets fail the run with a message naming the dataset, instead of producing an empty result.
- Source datasets are never modified.
FAQ
Is this legal to use? Yes. It only processes datasets from your own Apify account. It does not access any website.
Can I schedule it? Yes. Use Apify Schedules, or run it automatically when another Actor finishes with an integration or webhook (pass the finished run's default dataset ID in extraDatasetIds).
Can I call it from the API or an AI agent? Yes, like any Actor: start it with the Apify API, client libraries or MCP, then read the result from the run's default dataset.
What happens when the run is stopped or my spending limit is reached? Records already written stay in the dataset. When your spending limit is reached, the run stops cleanly and the status message says so.
Why did my duplicates not disappear? Check for different spelling or case (turn on ignoreCase), differing key fields, or missing key fields (see keepItemsWithMissingKey). The summary shows how many records were unusable.