# Merge two lead lists with different column names

**Use case:** 

Combine lead lists from different tools even when their columns are named differently, such as Company and business_name or Website and domain. Matching columns are joined, the rest are kept, and duplicates across the lists merge into one record with a source column.

## Input

```json
{
  "url": "https://api.apify.com/v2/key-value-stores/7MDnpHF243bNUL5C3/records/customers_messy.csv",
  "urls": [
    "https://api.apify.com/v2/key-value-stores/7MDnpHF243bNUL5C3/records/leads_list_a.csv",
    "https://api.apify.com/v2/key-value-stores/7MDnpHF243bNUL5C3/records/leads_list_b.csv"
  ],
  "collapseLists": true,
  "onlyNew": false,
  "onlyNewState": "default",
  "includeChanged": false,
  "phoneRegion": "US",
  "phoneFormat": "national",
  "fixEmailTypos": true,
  "applyClusters": "off",
  "checkEmailDomains": true,
  "minDuplicateConfidence": "0.5"
}
```

## Output

```json
{
  "title": {
    "label": "title"
  },
  "Company": {
    "label": "Company"
  },
  "placeId": {
    "label": "placeId"
  },
  "website": {
    "label": "website"
  },
  "Website": {
    "label": "Website"
  },
  "domain": {
    "label": "domain"
  },
  "url": {
    "label": "url"
  },
  "phone": {
    "label": "phone"
  },
  "Phone Number": {
    "label": "Phone Number"
  },
  "phones": {
    "label": "phones"
  },
  "emails": {
    "label": "emails"
  },
  "socials/url": {
    "label": "socials/url"
  },
  "address": {
    "label": "address"
  },
  "City": {
    "label": "City"
  },
  "category": {
    "label": "category"
  },
  "totalScore": {
    "label": "totalScore"
  },
  "reviewsCount": {
    "label": "reviewsCount"
  },
  "source": {
    "label": "source"
  },
  "_source_rows": {
    "label": "_source_rows"
  },
  "_flags": {
    "label": "_flags"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Merge & Deduplicate Datasets: CSV/Excel Cleaner, Only New Rows Actor is ready to run with the inputs already set for "Merge two lead lists with different column names". [Sign up or log in](https://console.apify.com/create-task-from-example/wPUDXQJpcA6oKHQ43) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Merge two lead lists with different column names" task

The Merge & Deduplicate Datasets: CSV/Excel Cleaner, Only New Rows Actor will start running based on the input automatically. You can also change all the input fields, like file url, more file urls to merge in, and more, to match your specific use case.

### 3. Receive the "Merge two lead lists with different column names" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as title, company, placeid, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Merge two lead lists with different column names" task via API](https://apify.com/patchwell/patchwell-clean-data.md).

## FAQ

### How does the merge task decide two columns mean the same thing?

The merge task matches names that differ only in case, spaces or punctuation, plus common synonyms such as phone and phone_number, and lists every match in the columns_matched record.

### How is the clean data task billed?

The clean data task charges per input row it reads, shown on the Pricing tab. Files it can't read cost nothing, and the change log and review list come with every run.

## About this Actor

This example demonstrates how to use [Merge & Deduplicate Datasets: CSV/Excel Cleaner, Only New Rows](https://apify.com/patchwell/patchwell-clean-data.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/patchwell/patchwell-clean-data.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/patchwell/patchwell-clean-data.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
