Merge & Deduplicate Datasets avatar

Merge & Deduplicate Datasets

Pricing

from $0.20 / 1,000 output rows

Go to Apify Store
Merge & Deduplicate Datasets

Merge & Deduplicate Datasets

Merge several Apify datasets into one and remove duplicate rows by the fields you choose (or whole rows), with optional filters and field selection. Runs with limited permissions: pick datasets in the input, API IDs work too.

Pricing

from $0.20 / 1,000 output rows

Rating

0.0

(0)

Developer

Dongjin Kim

Dongjin Kim

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

4 days ago

Last modified

Features

Limited permissions

Share

Merge & Deduplicate Datasets combines several of your Apify datasets into one and removes duplicate rows — by the fields you choose (for example url, or name + city) or by the whole row. You can also filter rows with simple conditions and keep only the fields you need. The result lands in the run's dataset, ready to export as JSON, CSV or Excel.

It runs with limited permissions: it can read only the datasets you give it in the Datasets field, and nothing else in your account. The picker in Console and dataset IDs (or username~name) passed through the API or a saved task fill the same field, and the platform grants read access to exactly those datasets. We tested the API and saved-task paths with limited permissions in the cloud.

How to use

  1. In Datasets, pick the datasets to merge (for example the results of several scraper runs). Their order matters: rows of the first dataset come first.
  2. In Deduplicate by fields, list the field(s) that identify a row — url is prefilled. Leave it empty to compare whole rows.
  3. Optional: turn on Ignore letter case or Ignore trailing slash in URLs, choose whether to keep the first or last duplicate, add a Filter, or list Output fields.
  4. Click Start. The summary (rows read, duplicates removed, rows out — per dataset) is in the OUTPUT record.

Just trying it? Leave Datasets empty and click Start: the prefilled Or: rows as JSON field holds two tiny sample groups (4 rows, one duplicate url), and you get 3 rows back. As soon as you pick a dataset, the sample rows are ignored.

Over the API, pass dataset IDs (or username~dataset-name) as strings:

{
"datasetIds": ["aBcD1234eFgH5678i", "jKlM9012nOpQ3456r"],
"dedupFields": ["url"],
"ignoreTrailingSlash": true,
"keep": "first"
}

Calling it from another Actor or an Apify integration works the same way: put the IDs in datasetIds.

What you get

The rows themselves, unchanged (the normalization options only affect how rows are compared). With Add source dataset ID each row also gets _sourceDataset. With Output fields each row has exactly those fields, in that order (null when a row lacks one; dots reach nested values, e.g. address.city).

The OUTPUT record (key-value store) — from a real test run (15,020 rows out of 19,020), abridged:

{
"rowsOut": 15020, "rowsRead": 19020, "duplicatesRemoved": 4000, "filteredOut": 0, "rowsWithoutKey": 20,
"datasets": [
{"dataset": "<id A>", "status": "ok", "rowsRead": 10000, "rowsOut": 10000, "duplicatesRemoved": 0},
{"dataset": "<id B>", "status": "ok", "rowsRead": 6000, "rowsOut": 3000, "duplicatesRemoved": 3000},
{"dataset": "dojito~<name C>", "status": "ok", "rowsRead": 3020, "rowsOut": 2020, "duplicatesRemoved": 1000},
{"dataset": "ZzZzZzZzZzZzZzZzZ", "status": "skipped", "error": "Cannot read dataset 'ZzZzZzZzZzZzZzZzZ' (404). Select it in the 'Datasets' picker, or pass its exact ID ..."}
],
"stoppedEarly": null
}

Input

FieldWhat it does
datasetIdsDatasets to merge, in order (up to 100). Console: the dataset picker. API: dataset IDs or username~dataset-name. When given, items is ignored (OUTPUT says itemsIgnored: true).
itemsInstead of datasets: up to 10,000 rows pasted as JSON — an array of row objects, or an array of row arrays (each inner array is merged like one dataset; _sourceDataset is then items-1, items-2, …, or items for a flat list). Prefilled with a small sample so a plain Start works; used only when datasetIds is empty.
dedupFieldsField(s) that identify a duplicate. Several fields = all must match. Nested: address.city, images.0. Empty = whole row. Rows that have none of these fields (or only empty values) are always kept and counted as rowsWithoutKey.
keepfirst (default) keeps the earliest row; last keeps the latest (the datasets are then read twice — the first pass reads only the key fields when they are top-level). Output order is always dataset order, then row order.
normalizeWhitespaceDefault on: " Acme Inc " = "Acme Inc" when comparing.
ignoreCase"ACME" = "acme" when comparing.
ignoreTrailingSlashhttps://a.com/x/ = https://a.com/x when comparing (only text containing ://).
ignoreFieldsWhole-row mode only: fields to leave out of the comparison, such as scrapedAt. Fields starting with # (Apify's hidden fields) are always left out.
dedupTurn off to only merge and filter.
fieldsKeep only these fields in the output.
filterConditions that all must match, applied before duplicates are removed: [{"field": "price", "op": "gt", "value": 10}, {"field": "country", "op": "in", "value": ["US", "CA"]}]. Ops: equals, notEquals, contains, notContains, startsWith, endsWith, in, gt, gte, lt, lte, exists, notExists, isEmpty, isNotEmpty. Text is compared case-insensitively; contains on a list checks its items; gt/lt compare numbers ("1,299.50" counts as a number; commas are read as thousands separators, so write decimals with a dot) or else text, which works for ISO dates like 2026-11-15.
addSourceDatasetAdds _sourceDataset to each row: the dataset ID or username~name exactly as given in Datasets.
maxItemsMaximum output rows per run (default 100,000, up to 10 million).

Numbers that are equal compare equal (1 = 1.0), but the number 1 and the text "1" are different keys.

Use cases

  • Combine runs of the same scraper (several cities, keywords or days) into one clean list without repeated listings, products or URLs.
  • Keep the latest version of each item across daily runs: keep: "last", deduplicate by id or url.
  • Clean before export: drop rows with an empty price, keep only the columns your spreadsheet needs.
  • In a pipeline: call it from an integration or another Actor after scrapers finish, with the dataset IDs they produced.

Pricing

$0.30 per 1,000 output rows on the Free plan, $0.25 on Bronze and $0.20 on Silver and above (pay per event: one apify-default-dataset-item event per row in the result, plus Apify's standard actor-start event: $0.00005 per run up to 1 GB of memory, one more for each extra GB). Duplicates, filtered-out rows and datasets that could not be read are not charged — only rows in the result. Platform usage (compute, storage) is included in the price. Set Max results or a maximum cost per run to cap a run; it stops cleanly and keeps every row already saved.

When a dataset can't be read

A dataset the actor may not read (not picked, a typo in the ID, someone else's private dataset, a URL instead of an ID) is skipped, not fatal: the other datasets are still merged, the run status says how many were skipped, and OUTPUT has the reason. If no dataset can be read, the run ends FAILED with the reason (nothing is charged). The fix is almost always to pick the dataset in the Datasets field or pass its exact ID — under limited permissions the platform grants access only to storages listed in that field.

Limits — be aware

  • Memory: only a 16-byte hash of each distinct key is kept, about 110 bytes per distinct key (190 with keep: "last"). With the default 1 GB that is roughly 4 million distinct keys (2.5 million with last); runs with more stop cleanly (stoppedEarly: "memoryLimit") — give the run more memory. Very large rows (whole HTML pages) are read in smaller pages automatically.
  • Hash collisions: two different keys could in theory get the same 128-bit hash and one row be dropped as a duplicate. The odds are negligible (far below one in a trillion even for billions of rows).
  • Datasets still being written: rows added after a dataset was read are not included. With keep: "last" the second pass reads exactly the rows the first pass saw.
  • Per run: default Max results is 100,000 rows — raise it for bigger merges. Up to 100 datasets, 10 million output rows, and 5 million rows fetched (with keep: "last" every row is fetched twice, so about 2.5 million rows). A row larger than 9 MB (Apify's limit) is skipped and counted as rowsTooLarge.
  • Timeouts: the run stops taking new rows 60 seconds before its timeout, so the summary is always saved (stoppedEarly: "timeLimit").
  • No custom JavaScript transforms — filters and field selection cover the common cases without running user code.

FAQ

Can it read datasets from another account? Only datasets your own account can read; pass the ID and it should work — if the platform refuses access, the dataset is skipped with the reason (tested with datasets in our own account).

Does it change my original datasets? No. It only reads them (READ permission) and writes the result to its own run dataset.

Why is my row count lower than the sum of the datasets? See OUTPUT: duplicatesRemoved and filteredOut per dataset.

How do I dedupe on two columns? "dedupFields": ["name", "city"] — rows are duplicates when both match.

More tools from this developer

Other public actors by dojito:

  • Product Price & Stock Checker for US Online Stores — price, currency, in-stock status, SKU/GTIN and brand from public product pages that publish schema.org Product data (Shopify, WooCommerce, BigCommerce, Magento and others).
  • ATS Job Board Feed — every open job from Greenhouse, Lever, Ashby, Recruitee, Personio and Teamtailor boards in one schema, from their documented public APIs and feeds.
  • Sitemap URL Extractor — every URL in a website's sitemaps with lastmod, changefreq, priority and hreflang alternates. Never downloads the pages themselves.
  • Wayback Machine Snapshot History — every Internet Archive capture of a URL, folder or whole domain from the official CDX API, or one summary row per URL.
  • Domain RDAP & DNS Lookup — registered or available, registrar, created and expiry dates, nameservers and DNSSEC from the registry's RDAP server, plus DNS records. One row per domain.
  • Website Screenshot & PDF (Full Page, Mobile, Bulk URLs) — full-page PNG / JPEG screenshots or A4 / Letter PDFs from a list of URLs, desktop to mobile sizes. One row per URL with file link, size, final URL and HTTP status.
  • Website Tech Stack Detector — the CMS, ecommerce platform, analytics, tag manager, payment processor, CDN, framework and web server behind a website, from one home-page request per domain.
  • Bulk HTTP Request Runner (API Caller) — send a list of HTTP requests to the APIs you choose and get one row per request: status, time, final URL and the response body (JSON parsed).

Using them together:

  • Checking a domain before you buy or link to it: run Domain RDAP & DNS Lookup for registration status, expiry date and DNS, then Wayback Machine Snapshot History with Match = "Domain + subdomains" and Output = "Summary" to see when the site was first and last archived and how often its content changed.
  • Site migration or content audit: list a site's URLs with Sitemap URL Extractor, then paste the pages you care about into Wayback Machine Snapshot History (Output = "Summary") to get each page's first and last capture.

Not affiliated with Apify beyond being published in its Store.