# Dataset Merge & Company Dedupe

Results from several runs and sources overlap: the same URL in three datasets, the same company in a map listing, a contact export and a job board. This actor reads the datasets, files or rows you give it and writes one dataset without duplicates. In company mode, rows that share a website domain, an email domain, a phone number or the same company name without its legal form at the same place become one row – and the row says why.

- Run on Apify: https://apify.com/perceptr0n/merge-dedupe-datasets-company-leads
- MCP tool (Apify MCP server): `perceptr0n--merge-dedupe-datasets-company-leads`
- Price: $0.0003 per row in merge or dedupe mode + $0.00005 per run

## What you get

- Sources: Apify datasets, CSV, JSON or JSON Lines files behind public addresses, records of a key-value store, rows in the input
- Remove duplicates by the fields you name or by whole rows; case, blanks, http or https, www., a trailing slash, tracking parameters and the spelling of phone numbers make no difference
- Choose which row stays – first, last or most complete – or merge them, so empty fields are filled from the other rows
- Company mode: one row per company, linked by website domain, email domain, phone number or company name with place
- Every merged row carries the reason, the shared values and the rows it was made from
- Two different websites are never put into one company; public mailboxes, social profiles, map links and marketplaces link nobody
- Runs with limited permissions: it reads only the datasets and stores you pass
- Checks cost limit, timeout and memory before it starts and refuses a run that would stop halfway – the message names the value that is needed

## Use cases

- Merge the datasets of several scheduled runs and keep each URL, product or job once
- Lead lists from map listings, contact exports and job boards: one row per company instead of one per spelling
- Before an outreach or enrichment run: pay for every company once
- Check the decisions first: write every row with its group number

## Run it from an AI agent or code

```json
{
  "items": [
    {
      "url": "https://example.com/a"
    },
    {
      "url": "http://www.example.com/a/?utm_source=newsletter"
    },
    {
      "url": "https://example.com/b"
    }
  ],
  "dedupeFields": [
    "url"
  ]
}
```

```sh
curl -X POST "https://api.apify.com/v2/acts/perceptr0n~merge-dedupe-datasets-company-leads/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" \
  -d '{"items": [{"url": "https://example.com/a"}, {"url": "http://www.example.com/a/?utm_source=newsletter"}, {"url": "https://example.com/b"}], "dedupeFields": ["url"]}'
```

## Weekly quality check

Last check on 22 Nov 2026: 5 of 5 cases passed. Checked weekly since 22 Nov 2026; each case and its result are listed on this page.

## FAQ

### Does it fetch or enrich data from the web?

No. A run reads the datasets, records and files you give it, nothing else.

### How does it decide that two rows are the same company?

By fixed rules on what is in your rows: the same website domain, email domain or phone number, or the same company name without its legal form at the same postal code or town. Two differently abbreviated names are not guessed to be the same company.

### Can I see what was removed?

Yes. The output can hold the removed rows with their group number, or every row; the unique rows plus the duplicates are always the whole input.

### How large can the input be?

Merging, and removing duplicates with the default keep: first, read the rows once: a million rows fit into the default 512 MB. Company mode reads twice and remembers more per row; from about 300,000 rows on it needs 1 GB or more. The run checks this before it starts and names the memory to set.

### What does company mode cost?

A row in company mode has its own price, higher than a row in merge or dedupe mode. The Apify page lists both; a start fee per run comes on top, and paid Apify plans pay less.

Updated: 2026-11-24
