Dataset Merge, Dedupe & Transform - Apify Datasets avatar

Dataset Merge, Dedupe & Transform - Apify Datasets

Pricing

from $0.35 / 1,000 records

Go to Apify Store
Dataset Merge, Dedupe & Transform - Apify Datasets

Dataset Merge, Dedupe & Transform - Apify Datasets

Merge Apify datasets into one: remove duplicates by any fields, filter records, sort, pick, rename or flatten fields. Keeps the first or the last duplicate. Streams large datasets. Export to Excel, CSV or API.

Pricing

from $0.35 / 1,000 records

Rating

0.0

(0)

Developer

Shivam Prajapati

Shivam Prajapati

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

a day ago

Last modified

Features

Limited permissions

Share

Merge Apify datasets into one clean dataset: remove duplicates by any fields, filter records, sort, pick, rename or flatten fields. Give the ids of your datasets (for example the results of several runs of a scraper), say which fields identify a record, and get one deduplicated dataset you can export to Excel, CSV, JSON or the API. No code.

Actively maintained. Last update: 2026-11-21. Every release passes 100+ automated tests, including merges of 25,000 records.

What can you use it for?

  • Join the results of many runs. A scraper run every day or by city: one dataset of all of them.
  • Remove duplicates. The same product, lead or listing found by several searches: keep one, by URL, email, ID or any set of fields.
  • Keep the newest record. List the oldest dataset first, choose to keep the last duplicate, and the newest version of each record wins.
  • Clean a dataset for a CRM or a sheet. Keep only the fields you need, rename them, drop test records with a filter.
  • Sort and cut. The 100 cheapest items of 20 runs, or the leads of one country.
  • Combine different scrapers' output. Rename their fields to the same names and flatten the nested ones.

How does it work?

The Actor reads your datasets in the order you give, one record at a time, and applies the options in this order:

  1. Flatten nested objects (optional).
  2. Filters: records that fail a condition are left out.
  3. Duplicates: records with the same values in the fields you chose (or identical records) are removed, keeping the first or the last.
  4. Sort (optional).
  5. Fields: keep, drop, rename.
  6. Return the records.

Without sorting and without 'keep the last', records are returned as they are read, so the datasets can be much bigger than the memory of the run.

Example result

Run with no input to see it: it merges three small example datasets of customers and removes the duplicates by email (the same person with different capital letters and spaces). The first two records:

[
{
"id": 1,
"name": "Ada Lovelace",
"email": "ada@example.com",
"country": "UK",
"orders": 12,
"address": {
"city": "London"
}
},
{
"id": 2,
"name": "Grace Hopper",
"email": "GRACE@example.com",
"country": "US",
"orders": 7,
"address": {
"city": "New York"
}
}
]

Fields

The records have the fields of your datasets. The Actor adds only these, and only if you turn on addSourceFields:

Source

FieldWhat it is
_sourceDatasetIdOnly with 'Add source fields': the id of the dataset the record came from.
_sourceIndexOnly with 'Add source fields': the position of that dataset in your list, starting at 0.

Input

InputWhat it does
datasetIdsThe datasets to merge, in order
dedupeBy, dedupeIdentical, keep, ignoreCaseWhich fields make a record unique, which duplicate to keep, whether case matters
filtersConditions a record must pass: ==, !=, >, >=, <, <=, contains, startsWith, in, exists, matches ...
includeFields, excludeFields, renameFields, flattenObjectsPick, drop, rename and flatten fields
sortBy, sortOrderSort the result
addSourceFieldsAdd where each record came from
maxItemsPerDataset, maxItemsLimits
onlyNewSkip records that earlier runs of the same input returned

How much does it cost?

You pay per record returned. Records that you remove (duplicates, filtered, left out) are not returned and not charged. There is no start fee.

PlanPrice per 1,000 records
Free$0.50
Bronze$0.45
Silver$0.40
Gold$0.35
  • Merging 100,000 records into 60,000 costs about $30 on the Free plan.
  • Use maxItems to cap the cost of a run.

Use it via API, on a schedule, or with your tools

from apify_client import ApifyClient
client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("pshivam/dataset-merge-dedupe").call(run_input={
"datasetIds": ["Hq4ZuqOHRPlCXXjla", "pshivam~my-other-data"],
"dedupeBy": ["url"],
"keep": "last",
"filters": [{"field": "price", "op": ">", "value": 0}],
"sortBy": "price",
})
for record in client.dataset(run["defaultDatasetId"]).iterate_items():
print(record)

Use it in Clay, n8n, Make or Zapier

Use the Actor ID pshivam/dataset-merge-dedupe and an input like this, for example after each scraper run:

{"datasetIds": ["<DATASET_ID_OF_THE_RUN>"], "dedupeBy": ["email"], "includeFields": ["name", "email", "company"]}

Good to know

  • Full permissions. To read any dataset you list, the Actor runs with the full permissions of your account: it needs them to open datasets by id. It only reads the datasets you name and writes its own result. A dataset of another account must be shared with you. If a dataset cannot be read the run's status message says so and the other datasets are still merged. The example run without datasets needs no access.
  • Order matters. Datasets are read in the order of the list, so the first duplicate is the one from the first dataset. List the oldest dataset first and choose keep last to keep the newest.
  • Records without the key are kept. A record that lacks a field of dedupeBy, or has it empty, is never a duplicate.
  • Memory. Streaming merges use little memory. Sorting, or keeping the last duplicate, holds the records in memory: 1 million small records need about 2 GB, so raise the memory of the run for big sorts.
  • Records are returned as they are. Numbers stay numbers, nested objects stay nested (unless you flatten), nothing is converted.
  • Speed. The merge itself runs at about 20,000 records a second. 100,000 records take under 30 seconds with most of the time spent reading the datasets from Apify.
  • Independent tool. Not affiliated with Apify. It works on the datasets you give it and does not change them.

FAQ

How do I merge two Apify datasets?

Put both dataset ids in datasetIds and run. The new dataset has the records of the first, then the second.

How do I remove duplicates?

Put the fields that identify a record in dedupeBy (url, email, id). Two records with the same values there are duplicates. Use dedupeIdentical when you have no such field.

How do I keep the newest record of each duplicate group?

List the oldest dataset first and set keep to last. The last record of each group wins.

Can I filter or sort the records?

Yes. filters keeps the records that pass every condition, and sortBy sorts them. Numbers inside text, like "49.50", are compared as numbers.

Does it change my original datasets?

No. It reads them and writes a new dataset.

Can it merge datasets of different scrapers?

Yes. Rename the fields to the same names with renameFields and flatten nested objects with flattenObjects.