Dataset Merge & Dedupe: Combine Datasets, Remove Duplicates avatar

Dataset Merge & Dedupe: Combine Datasets, Remove Duplicates

Pricing

from $0.10 / 1,000 row writtens

Go to Apify Store
Dataset Merge & Dedupe: Combine Datasets, Remove Duplicates

Dataset Merge & Dedupe: Combine Datasets, Remove Duplicates

Merge Apify datasets into one and remove duplicate rows, by key fields such as url or id, or by whole row when you give none. Keep the first or the last of each, pick and rename fields, and save to a named dataset. Rows read and duplicates are free.

Pricing

from $0.10 / 1,000 row writtens

Rating

0.0

(0)

Developer

Public Data Tools

Public Data Tools

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

12 days ago

Last modified

Categories

Features

Limited permissions

Share

Merge the results of several Apify runs into one clean dataset without duplicate rows. Compare rows by the fields that identify them, such as url or id, or by the whole row when you give none. Keep the first or the last of each duplicate, pick and rename fields, and save to a named dataset if you like.

  • 🧩 Merge any number of datasets, plus rows you paste in as JSON, in the order you give them.
  • 🔑 Duplicates by key fields or by whole row: url, id, address.city, or several fields together. With no fields, identical rows are removed.
  • ⏮️ Keep the first or the last of each duplicate: the last one is the newest when your datasets are in date order.
  • ✂️ Pick, order and rename fields without code: address.city as city.
  • 🗂️ Save to a named dataset that keeps growing across runs, or to the run's own dataset.
  • 🛑 Clear errors: a wrong dataset ID stops the run with a message saying which one, before anything is output or charged.
  • 💸 $0.10 per 1,000 output rows. Rows read, duplicates and empty rows are free.

Try it: the input comes pre-filled with three rows, one of them a duplicate. Click Start and you get two rows back. Then pick your own datasets.

What you get

One row per unique row of your data, with your own fields, in the order they first appear (or where the kept row appears, with Keep: the last one).

DataWhat's in it
Your rowsevery field as it is, or only the fields you chose, in your order and with your names
Run summary (RUN_SUMMARY)rows read and output, duplicates skipped, empty rows skipped, rows kept because they had no key value, each dataset with how many rows were read from it, and whether a limit stopped the run

Hidden fields (names starting with #, such as Web Scraper's #debug) are left out, as in Apify's "clean" export, so they don't make identical rows look different.

Who it's for

  • Anyone who scrapes in batches: combine the results of many runs of the same scraper into one list without repeats.
  • Lead and job lists: merge searches that overlap (several keywords or cities) and keep one row per company, profile or job ID.
  • Price and listing monitors: keep only the newest row of each product with Keep: the last one.
  • Spreadsheet and CRM exports: trim a dataset to the columns you need and give them readable names before you download it.

How much does it cost?

You pay $0.10 per 1,000 rows output ($0.0001 each), plus Apify's standard run start fee.

ExampleRows outputCost
Two scraper runs of 5,000 rows each, 2,000 duplicates8,000$0.80
30 daily runs of 1,000 rows, 20,000 duplicates10,000$1.00
  • Free: rows read, duplicates, empty rows and the summary row.
  • Spending limit: if you set a maximum cost per run, the run stops cleanly when it is reached and keeps what it already output.
  • Max rows: caps the rows output.

How to use it

  1. Under Datasets, pick the results of earlier runs, or paste dataset IDs. A run ID is not a dataset ID: open the run, then Storage, to find its dataset.
  2. Under Compare by fields, enter the field(s) that identify a row, such as url. Leave it empty to remove only identical rows.
  3. Choose Keep: the first one or the last one.
  4. Optionally list Output fields to keep, and give a Named dataset to save to.
  5. Click Start, then download the results as JSON, CSV, Excel and more.

Example input

{
"datasetIds": ["aBcDeFgHiJkLmNoPq", "rStUvWxYz01234567"],
"keyFields": ["url"],
"keep": "last",
"fields": ["url", "title", "price", "seller.name as seller"],
"outputDataset": "products-latest"
}

Example output

With the pre-filled input:

[
{ "name": "Example Ltd", "url": "https://example.com", "city": "London" },
{ "name": "Sample Inc", "url": "https://example.org", "city": "Austin" }
]

The run summary for it:

{
"read": 3,
"output": 2,
"duplicatesSkipped": 1,
"emptySkipped": 0,
"keptWithoutKey": 0,
"keyFields": [],
"keep": "first",
"datasets": [],
"missingDatasets": [],
"inlineRows": 3,
"outputDataset": null,
"charged": 2,
"stoppedAtMaxRows": false,
"stoppedAtSpendingLimit": false,
"finishedAt": "2026-11-11T08:00:00.000Z"
}

How duplicates are found

  • Key fields: two rows are duplicates when all key fields have the same values.
    • Values compare as trimmed text, so 42 and "42" match.
    • Nested fields use dots (address.city). A whole object or list compares by its full content.
  • Whole rows: with no key fields, two rows are duplicates when every field matches, in any order. Nested objects count, so {"a": {"b": 1}} and {"a": {"b": 2}} differ.
  • Rows with no key value (every key field missing or empty) are all kept, not merged into one. The summary counts them.
  • Empty rows ({}) are skipped.

Keep the first or the last

  • Keep: the first one: reads each dataset once.
  • Keep: the last one: reads them twice. The first pass finds the last row of each key; the second outputs it.
    • Rows added to a dataset between the two passes (a scraper still running) are left out.
    • Merge finished runs for a complete result.

Integrations

  • API: call it from your code with dataset IDs, then read the run's dataset, or your named dataset, through the Apify API or client libraries.
  • Schedules: run it on a schedule with Keep: the last one and a Named dataset.
    • Each run adds rows to the named dataset; it does not remove duplicates already saved there.
    • To dedupe against earlier output, merge the named dataset itself into a new name.

FAQ

Yes. It reads only datasets in your own Apify account, or ones you have access to, and doesn't contact any website.

What happens with a wrong dataset ID?

The run stops before outputting anything, says which ID it couldn't read and why, and charges nothing for rows. It never creates an empty dataset in place of a missing one.

How big can the datasets be?

  • Memory: the Actor reads 1,000 rows at a time and remembers only a short fingerprint of each unique row, about 110 bytes. About 2 million unique rows fit in the default 512 MB. For more, raise the run's memory (up to 4 GB).
  • Time: large merges take longer, mostly writing the output. Raise the run's timeout if needed.

Does it change my datasets?

No. It only reads them. The output goes to the run's own dataset or to the named dataset you choose.

Can it write to a named dataset I made elsewhere?

  • Not under its default limited permissions. It writes to named datasets it created itself, and keeps access to them in later runs.
  • Workaround: pick a new name, or merge your existing dataset in as an input.