# Remove Duplicate Leads - Google Maps & Apollo-style Lists (`that_red_bird/lead-list-deduplicator`) Actor

Your Google Maps and Apollo exports are full of duplicates. Fuzzy-match name, phone, domain, address and map location, merge each group into one richest record and see exactly why. Also normalizes addresses and links records across sources. No login, no API key.

- **URL**: https://apify.com/that_red_bird/lead-list-deduplicator.md
- **Developed by:** [mohamed alaya](https://apify.com/that_red_bird) (community)
- **Categories:** Lead generation, Business, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 dedup runs

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

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 examples already wired to this Actor's own input schema, see the [API](#api) section below.

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`).

# README

## Remove Duplicate Leads - Google Maps & Apollo-style Lists

Your Google Maps scrape, Apollo export or CRM CSV has the same business or person three times, spelled three
ways. This Actor finds them with **fuzzy name, phone, e-mail, website domain, address and map-location matching**,
merges each group into **one record that keeps the richest data**, and tells you **exactly why** rows were merged.
No login, no API key, no browser.

Use it right after a **Google Maps scraper** run (point it at the run's dataset), after a **lead-finder / Apollo-style
export**, or on any CSV. It also has two extra modes that replace separate tools: entity resolution (link rows across
sources without deleting anything) and address / phone / e-mail normalization.

### What it does

| Mode | Result |
|---|---|
| `dedupe` (default) | One clean row per real business or person. Duplicates merged, gaps filled from the other copies, nothing silently lost. |
| `resolve` | Every row kept, each tagged with a shared `_entityId` so you can join several sources (Maps + Apollo + your CRM). Golden records saved to `GOLDEN_RECORDS`. |
| `normalize` | Standardised address parts (street, number, unit, city, region, postcode, country for US / UK / DE / FR), digits-only phone, canonical e-mail, website domain. No merging. |

#### How two rows are compared

Rows are first grouped by cheap keys (phone, domain, e-mail, Google place id, LinkedIn URL, normalised name + city,
address, ~200 m map cell) so a 100k-row list never needs a slow all-pairs comparison. Inside a group each pair is
scored 0-100 from the fields **both** rows have:

- name: business names ignore "LLC / Inc / The", "&" vs "and", accents, word order and "Roasters"-style add-ons;
  person names understand nicknames (Jen = Jennifer, Bill = William), initials ("J. Adams") and swapped order
- phone (last 10 digits, so `+1 512-555-0134` = `(512) 555-0134`), e-mail (plus-tags and Gmail dots ignored),
  website domain (tracking parameters, `www.` and paths ignored; Facebook / Linktree / Wix subdomains never count as
  identity), street address (`Street` = `St`, unit numbers, postcode), map distance (within ~40 m)
- a shared Google `placeId`, the same LinkedIn profile or the same personal e-mail merges immediately
- a pair with only one comparable field can never auto-merge, a different name is not rescued by a shared phone alone,
  and two branches of a chain at different addresses stay separate

Pairs that land between the review and merge thresholds are **not merged**: they are listed in `REVIEW_PAIRS` with
the evidence so you decide. A cap on group size stops one weak link from chaining thousands of rows together.

### Input

| Field | Default | What it does |
|---|---|---|
| `records` / `datasetIds` / `sourceUrl` / `csvText` | built-in Google Maps sample | Where the leads come from. Combine freely. Pick a dataset or pass its ID (any Actor run works). |
| `mode` | `dedupe` | `dedupe`, `resolve` or `normalize`. |
| `schema` | `auto` | Google Maps (businesses), lead finder (people) or generic CRM. Auto-detect reads the column names. |
| `fieldMap` | `{}` | Override columns, e.g. `{"name":"Company Name","phone":"Tel"}`. |
| `matchThreshold` / `reviewThreshold` | 85 / 70 | Merge at or above, list for review in between. |
| `mergePolicy` | `richest` | Which value wins on conflict: richest record, longest, most common, first. Empty fields are always filled from the copies. |
| `outputMode` | `clean` | `clean` list only, `clusters` (merge report) or `all`. |
| `addDedupeFields` | `true` | Adds `_dedupeClusterId`, `_dedupeSize`, `_dedupeConfidence`, `_dedupeSourceRows`, `_dedupeMatchedOn`. |
| `maxClusterSize`, `maxBlockSize`, `maxRecords` | 25, 500, 200000 | Safety limits. |

Started with an empty input the Actor runs on a 14-row Google Maps sample (5 duplicates) so you can see the output.

### Output

Dataset (default `clean`): one row per real entity, original columns untouched plus the optional `_dedupe*` columns.

```json
{
  "title": "Blue Door Dental Care",
  "categoryName": "Dentist",
  "address": "120 Main St, Austin, TX 78701",
  "phone": "(512) 555-0134",
  "website": "https://www.bluedoordental.com/",
  "totalScore": 4.8,
  "reviewsCount": 212,
  "placeId": "ChIJ_bluedoor_A",
  "_dedupeClusterId": "C00001",
  "_dedupeSize": 2,
  "_dedupeConfidence": 98,
  "_dedupeSourceRows": "1,2",
  "_dedupeMatchedOn": "name, phone, address, domain"
}
```

With `outputMode: all` or `clusters` you also get a report row per merged group:

```json
{ "recordType": "cluster", "clusterId": "C00001", "size": 2, "confidence": 98,
  "whyMerged": ["row 1 ↔ row 2: score 98 (name ✓ 95%, phone ✓ 100%, address ✓ 100%, domain ✓ 100%)"],
  "conflicts": [{ "field": "website", "values": ["https://www.bluedoordental.com/", "http://bluedoordental.com/?utm_source=google"], "kept": "https://www.bluedoordental.com/", "rule": "richest" }],
  "members": [ ... the original rows ... ] }
```

Key-value store: `CLEAN.csv` (one-click re-import file), `REVIEW_PAIRS`, `CLUSTERS`, `SUMMARY` (rows in / out,
duplicates merged, conflicts by field, thresholds used). Resolve mode also saves `GOLDEN_RECORDS` and `GOLDEN_RECORDS.csv`.

### Tested on

- the sample above (14 Google-Maps-shaped rows, 5 true duplicates, including two Hill Country Coffee branches that
  correctly stay separate): 9 clean rows, 0 wrong merges
- synthetic Google-Maps-shaped lists with known ground truth (reformatted phones, `St`/`Street`, reworded names,
  missing fields, moved coordinates): 5,000 rows and 200,000 rows both reached 99.99%+ pair precision and 100% recall
- synthetic people lists (nicknames, initials, changed job titles, missing e-mail / phone): 5,000 rows, 99.9% precision,
  100% recall. Two different people who share the same name, employer and e-mail pattern are genuinely ambiguous; they are
  merged only when nothing contradicts it, so check `REVIEW_PAIRS` on such lists
- speed: 200,000 Google-Maps rows are matched in about 45 seconds on a laptop-class CPU (8 million pair comparisons)

These are synthetic benchmarks, not a promise for your data. Start with the default thresholds and read `REVIEW_PAIRS`.

### Use after the Google Maps scraper

1. Run a Google Maps scraper for several overlapping searches ("dentist Austin", "dental clinic Austin", ...).
2. Start this Actor with the scraper's `datasetId` (or several, one per search).
3. Download `CLEAN.csv` or connect the dataset to your CRM, then score the clean list with
   [Google Maps Lead Scorer](https://apify.com/that_red_bird/maps-lead-scorer).

Works with Make, Zapier and n8n through the Apify integrations: trigger on "Actor run succeeded" and read the default
dataset. From code:

```bash
curl -X POST "https://api.apify.com/v2/acts/that_red_bird~lead-list-deduplicator/runs?token=$APIFY_TOKEN" \
  -H 'content-type: application/json' \
  -d '{"datasetIds":["YOUR_MAPS_DATASET_ID"],"mode":"dedupe","matchThreshold":85}'
```

AI agents can call it as an Apify Actor tool (MCP) with the same JSON input.

### Pricing

Pay per event: **$0.002 per run + $0.002 per clean row exported** (report rows are free). 10,000 leads that shrink to
7,000 cost about $14. Rows that fail to parse are never charged, and the run stops cleanly if you set a maximum cost.

### FAQ

**Will it delete good data?** No. Duplicates are merged into the richest record, empty fields are filled from the others,
and every conflicting value is kept in the cluster report. Turn `outputMode` to `all` to see everything.

**Two branches of the same chain?** Different addresses or coordinates keep them apart. Same name with the same address,
phone or map pin merges them.

**A column it does not understand?** Set `fieldMap`. Nested fields (`location.lat`, `address.city`) are read automatically.

**Other countries?** Matching on name, phone, domain, e-mail and map position works anywhere. Structured address parsing
covers US, UK, Germany and France; elsewhere the street text and postcode are compared as text.

**Does it look anything up online?** No. Nothing leaves the run; there is no geocoding, no e-mail verification and no
website fetching.

### Support

Found a wrong merge or a missed duplicate? Open an issue on the Actor page with two example rows and we will tune the
matcher. If it saved you time, a short review helps other people find it.

# Actor input Schema

## `mode` (type: `string`):

dedupe = merge duplicate leads into one clean row each (default). resolve = keep every row but tag rows that are the same business/person with a shared entity id (link several sources). normalize = standardise addresses, phones, e-mails and websites without merging anything.

## `records` (type: `array`):

Your leads as an array of row objects: paste Google Maps scraper items, an Apollo-style export, a LinkedIn / Sales Navigator export or any CRM rows. Nested objects such as location.lat are understood. The default is a small Google Maps sample so an empty run shows real output.

## `datasetIds` (type: `array`):

Optional. Datasets (pick from your storage or pass dataset IDs) to pull rows from, for example the dataset of a Google Maps scraper run. Rows from every dataset are combined with the rows above. Several datasets let you de-duplicate across runs and sources. Use the picker rather than typing an ID: it gives this Actor permission to read your dataset.

## `sourceUrl` (type: `string`):

Optional. A public URL to a CSV, JSON or NDJSON file (Google Sheets "publish to web" CSV, S3 link, Apify dataset items URL). Leave empty to skip.

## `csvText` (type: `string`):

Optional. Paste CSV text with a header row (comma, semicolon or tab separated). Leave empty to skip.

## `schema` (type: `string`):

How to read your columns. Auto-detect works for most lists. Pick Google Maps if "title" is the business name; pick Lead finder if "title" is a job title.

## `fieldMap` (type: `object`):

Optional. Tell the Actor which column holds what when auto-detection guesses wrong, e.g. {"name":"Company Name","phone":"Tel","website":"Site","address":"Street","city":"Town","postcode":"ZIP","email":"Contact Email"}. Supported keys: name, firstName, lastName, company, jobTitle, email, phone, website, linkedin, address, city, region, postcode, country, placeId, lat, lng.

## `matchThreshold` (type: `integer`):

Pairs scoring at or above this are merged automatically. Higher is safer (fewer wrong merges) but misses more duplicates. 85 is a good start; shared Google place IDs, LinkedIn URLs and personal e-mails always merge.

## `reviewThreshold` (type: `integer`):

Pairs scoring between this and the merge threshold are NOT merged but listed in the REVIEW_PAIRS record so you can decide. Must be at or below the merge threshold.

## `mergePolicy` (type: `string`):

When duplicates disagree on a field (two different websites, say), this picks the value kept. Empty fields are always filled from the other duplicates, and every conflict is listed in the cluster report.

## `outputMode` (type: `string`):

clean = only the de-duplicated leads (ready to re-import). clusters = only the merge report, one row per merged group with the reasons. all = clean leads plus the report rows. Review pairs and a CLEAN.csv file are always saved to the key-value store.

## `addDedupeFields` (type: `boolean`):

Add \_dedupeClusterId, \_dedupeSize, \_dedupeConfidence, \_dedupeSourceRows and \_dedupeMatchedOn to each clean row so you can trace it back to the original rows. Turn off for a pristine re-import file.

## `defaultCountry` (type: `string`):

Used by address parsing when the country cannot be told from the text. Parsing supports US, UK, German and French formats; other countries still match on city, postcode and street text.

## `maxClusterSize` (type: `integer`):

Safety brake against chain reactions: a merge that would build a group larger than this is held back and listed for review instead.

## `maxBlockSize` (type: `integer`):

Records are first grouped by cheap keys (phone, domain, name + city, map cell) and only compared inside a group. Groups larger than this (for example 900 records sharing one common name) are skipped for speed.

## `maxRecords` (type: `integer`):

Upper limit of rows read from all sources. Extra rows are ignored and noted in the run summary.

## Actor input object example

```json
{
  "mode": "dedupe",
  "records": [
    {
      "title": "Blue Door Dental Care",
      "categoryName": "Dentist",
      "address": "120 Main St, Austin, TX 78701",
      "street": "120 Main St",
      "city": "Austin",
      "state": "Texas",
      "postalCode": "78701",
      "countryCode": "US",
      "phone": "(512) 555-0134",
      "website": "https://www.bluedoordental.com/",
      "totalScore": 4.8,
      "reviewsCount": 212,
      "location": {
        "lat": 30.26721,
        "lng": -97.74312
      },
      "placeId": "ChIJ_bluedoor_A"
    },
    {
      "title": "Blue Door Dental",
      "categoryName": "Dental clinic",
      "address": "120 Main Street, Austin, TX 78701",
      "city": "Austin",
      "state": "TX",
      "postalCode": "78701",
      "countryCode": "US",
      "phone": "+1 512-555-0134",
      "website": "http://bluedoordental.com/?utm_source=google",
      "reviewsCount": 0,
      "placeId": "ChIJ_bluedoor_B"
    },
    {
      "title": "Lakeside Pizza & Pasta",
      "categoryName": "Pizza restaurant",
      "address": "45 Lake Ave, Austin, TX 78702",
      "street": "45 Lake Ave",
      "city": "Austin",
      "state": "TX",
      "postalCode": "78702",
      "countryCode": "US",
      "phone": "(512) 555-0178",
      "totalScore": 4.4,
      "reviewsCount": 891,
      "location": {
        "lat": 30.2601,
        "lng": -97.7102
      },
      "placeId": "ChIJ_lakeside_1"
    },
    {
      "title": "Lakeside Pizza and Pasta LLC",
      "categoryName": "Restaurant",
      "address": "45 Lake Avenue, Austin, TX 78702",
      "city": "Austin",
      "state": "TX",
      "postalCode": "78702",
      "countryCode": "US",
      "phone": "512.555.0178",
      "website": "https://lakesidepizzaatx.com",
      "totalScore": 4.4,
      "reviewsCount": 893,
      "location": {
        "lat": 30.26012,
        "lng": -97.71021
      },
      "placeId": "ChIJ_lakeside_1"
    },
    {
      "title": "Hill Country Coffee",
      "categoryName": "Coffee shop",
      "address": "900 Congress Ave, Austin, TX 78701",
      "street": "900 Congress Ave",
      "city": "Austin",
      "state": "TX",
      "postalCode": "78701",
      "countryCode": "US",
      "phone": "(512) 555-0102",
      "website": "https://hillcountrycoffee.com",
      "totalScore": 4.6,
      "reviewsCount": 540,
      "location": {
        "lat": 30.2712,
        "lng": -97.7431
      },
      "placeId": "ChIJ_hcc_congress"
    },
    {
      "title": "Hill Country Coffee",
      "categoryName": "Coffee shop",
      "address": "2100 S Lamar Blvd, Austin, TX 78704",
      "street": "2100 S Lamar Blvd",
      "city": "Austin",
      "state": "TX",
      "postalCode": "78704",
      "countryCode": "US",
      "phone": "(512) 555-0166",
      "website": "https://hillcountrycoffee.com",
      "totalScore": 4.5,
      "reviewsCount": 377,
      "location": {
        "lat": 30.2453,
        "lng": -97.769
      },
      "placeId": "ChIJ_hcc_lamar"
    },
    {
      "title": "Hill Country Coffee Roasters",
      "categoryName": "Coffee roaster",
      "address": "900 Congress Avenue, Austin, TX 78701",
      "city": "Austin",
      "state": "TX",
      "postalCode": "78701",
      "countryCode": "US",
      "phone": "512.555.0102",
      "totalScore": 4.1,
      "reviewsCount": 12,
      "placeId": "ChIJ_hcc_roasters_old"
    },
    {
      "title": "Greenleaf Plumbing Co.",
      "categoryName": "Plumber",
      "address": "77 Industrial Blvd, Round Rock, TX 78664",
      "street": "77 Industrial Blvd",
      "city": "Round Rock",
      "state": "TX",
      "postalCode": "78664",
      "countryCode": "US",
      "phone": "(512) 555-0190",
      "totalScore": 4.9,
      "reviewsCount": 64,
      "placeId": "ChIJ_greenleaf_1"
    },
    {
      "title": "Green Leaf Plumbing",
      "categoryName": "Plumbing service",
      "address": "77 Industrial Boulevard, Round Rock, TX 78664",
      "city": "Round Rock",
      "state": "TX",
      "postalCode": "78664",
      "countryCode": "US",
      "website": "https://greenleafplumbing.net",
      "totalScore": 4.9,
      "reviewsCount": 61,
      "placeId": "ChIJ_greenleaf_2"
    },
    {
      "title": "Austin Bike Works",
      "categoryName": "Bicycle shop",
      "address": "301 E 6th St, Austin, TX 78701",
      "street": "301 E 6th St",
      "city": "Austin",
      "state": "TX",
      "postalCode": "78701",
      "countryCode": "US",
      "phone": "(512) 555-0155",
      "website": "https://austinbikeworks.com",
      "totalScore": 4.7,
      "reviewsCount": 158,
      "placeId": "ChIJ_bike_1"
    },
    {
      "title": "Austin Bike Workshop",
      "categoryName": "Bicycle repair shop",
      "address": "1802 Barton Springs Rd, Austin, TX 78704",
      "street": "1802 Barton Springs Rd",
      "city": "Austin",
      "state": "TX",
      "postalCode": "78704",
      "countryCode": "US",
      "phone": "(512) 555-0121",
      "website": "https://austinbikeworkshop.org",
      "totalScore": 4.3,
      "reviewsCount": 90,
      "placeId": "ChIJ_bike_2"
    },
    {
      "title": "Maria's Taqueria",
      "categoryName": "Mexican restaurant",
      "address": "15 Cesar Chavez St, Austin, TX 78701",
      "street": "15 Cesar Chavez St",
      "city": "Austin",
      "state": "TX",
      "postalCode": "78701",
      "countryCode": "US",
      "phone": "(512) 555-0143",
      "totalScore": 4.5,
      "reviewsCount": 1210,
      "placeId": "ChIJ_maria_1"
    },
    {
      "title": "Marias Taqueria",
      "categoryName": "Taco restaurant",
      "address": "15 Cesar Chavez Street, Austin, TX 78701",
      "city": "Austin",
      "state": "TX",
      "postalCode": "78701",
      "countryCode": "US",
      "phone": "+15125550143",
      "website": "https://mariastaqueriaatx.com",
      "totalScore": 4.5,
      "reviewsCount": 1208,
      "placeId": "ChIJ_maria_2"
    },
    {
      "title": "Oak Street Veterinary Clinic",
      "categoryName": "Veterinarian",
      "address": "8 Oak St, Cedar Park, TX 78613",
      "street": "8 Oak St",
      "city": "Cedar Park",
      "state": "TX",
      "postalCode": "78613",
      "countryCode": "US",
      "phone": "(512) 555-0111",
      "website": "https://oakstreetvet.com",
      "totalScore": 4.8,
      "reviewsCount": 300,
      "placeId": "ChIJ_oak_1"
    }
  ],
  "sourceUrl": "",
  "csvText": "",
  "schema": "auto",
  "fieldMap": {},
  "matchThreshold": 85,
  "reviewThreshold": 70,
  "mergePolicy": "richest",
  "outputMode": "clean",
  "addDedupeFields": true,
  "defaultCountry": "auto",
  "maxClusterSize": 25,
  "maxBlockSize": 500,
  "maxRecords": 200000
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `downloadCsv` (type: `string`):

No description

## `cleanCsv` (type: `string`):

No description

## `reviewPairs` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "mode": "dedupe",
    "records": [
        {
            "title": "Blue Door Dental Care",
            "categoryName": "Dentist",
            "address": "120 Main St, Austin, TX 78701",
            "street": "120 Main St",
            "city": "Austin",
            "state": "Texas",
            "postalCode": "78701",
            "countryCode": "US",
            "phone": "(512) 555-0134",
            "website": "https://www.bluedoordental.com/",
            "totalScore": 4.8,
            "reviewsCount": 212,
            "location": {
                "lat": 30.26721,
                "lng": -97.74312
            },
            "placeId": "ChIJ_bluedoor_A"
        },
        {
            "title": "Blue Door Dental",
            "categoryName": "Dental clinic",
            "address": "120 Main Street, Austin, TX 78701",
            "city": "Austin",
            "state": "TX",
            "postalCode": "78701",
            "countryCode": "US",
            "phone": "+1 512-555-0134",
            "website": "http://bluedoordental.com/?utm_source=google",
            "reviewsCount": 0,
            "placeId": "ChIJ_bluedoor_B"
        },
        {
            "title": "Lakeside Pizza & Pasta",
            "categoryName": "Pizza restaurant",
            "address": "45 Lake Ave, Austin, TX 78702",
            "street": "45 Lake Ave",
            "city": "Austin",
            "state": "TX",
            "postalCode": "78702",
            "countryCode": "US",
            "phone": "(512) 555-0178",
            "totalScore": 4.4,
            "reviewsCount": 891,
            "location": {
                "lat": 30.2601,
                "lng": -97.7102
            },
            "placeId": "ChIJ_lakeside_1"
        },
        {
            "title": "Lakeside Pizza and Pasta LLC",
            "categoryName": "Restaurant",
            "address": "45 Lake Avenue, Austin, TX 78702",
            "city": "Austin",
            "state": "TX",
            "postalCode": "78702",
            "countryCode": "US",
            "phone": "512.555.0178",
            "website": "https://lakesidepizzaatx.com",
            "totalScore": 4.4,
            "reviewsCount": 893,
            "location": {
                "lat": 30.26012,
                "lng": -97.71021
            },
            "placeId": "ChIJ_lakeside_1"
        },
        {
            "title": "Hill Country Coffee",
            "categoryName": "Coffee shop",
            "address": "900 Congress Ave, Austin, TX 78701",
            "street": "900 Congress Ave",
            "city": "Austin",
            "state": "TX",
            "postalCode": "78701",
            "countryCode": "US",
            "phone": "(512) 555-0102",
            "website": "https://hillcountrycoffee.com",
            "totalScore": 4.6,
            "reviewsCount": 540,
            "location": {
                "lat": 30.2712,
                "lng": -97.7431
            },
            "placeId": "ChIJ_hcc_congress"
        },
        {
            "title": "Hill Country Coffee",
            "categoryName": "Coffee shop",
            "address": "2100 S Lamar Blvd, Austin, TX 78704",
            "street": "2100 S Lamar Blvd",
            "city": "Austin",
            "state": "TX",
            "postalCode": "78704",
            "countryCode": "US",
            "phone": "(512) 555-0166",
            "website": "https://hillcountrycoffee.com",
            "totalScore": 4.5,
            "reviewsCount": 377,
            "location": {
                "lat": 30.2453,
                "lng": -97.769
            },
            "placeId": "ChIJ_hcc_lamar"
        },
        {
            "title": "Hill Country Coffee Roasters",
            "categoryName": "Coffee roaster",
            "address": "900 Congress Avenue, Austin, TX 78701",
            "city": "Austin",
            "state": "TX",
            "postalCode": "78701",
            "countryCode": "US",
            "phone": "512.555.0102",
            "totalScore": 4.1,
            "reviewsCount": 12,
            "placeId": "ChIJ_hcc_roasters_old"
        },
        {
            "title": "Greenleaf Plumbing Co.",
            "categoryName": "Plumber",
            "address": "77 Industrial Blvd, Round Rock, TX 78664",
            "street": "77 Industrial Blvd",
            "city": "Round Rock",
            "state": "TX",
            "postalCode": "78664",
            "countryCode": "US",
            "phone": "(512) 555-0190",
            "totalScore": 4.9,
            "reviewsCount": 64,
            "placeId": "ChIJ_greenleaf_1"
        },
        {
            "title": "Green Leaf Plumbing",
            "categoryName": "Plumbing service",
            "address": "77 Industrial Boulevard, Round Rock, TX 78664",
            "city": "Round Rock",
            "state": "TX",
            "postalCode": "78664",
            "countryCode": "US",
            "website": "https://greenleafplumbing.net",
            "totalScore": 4.9,
            "reviewsCount": 61,
            "placeId": "ChIJ_greenleaf_2"
        },
        {
            "title": "Austin Bike Works",
            "categoryName": "Bicycle shop",
            "address": "301 E 6th St, Austin, TX 78701",
            "street": "301 E 6th St",
            "city": "Austin",
            "state": "TX",
            "postalCode": "78701",
            "countryCode": "US",
            "phone": "(512) 555-0155",
            "website": "https://austinbikeworks.com",
            "totalScore": 4.7,
            "reviewsCount": 158,
            "placeId": "ChIJ_bike_1"
        },
        {
            "title": "Austin Bike Workshop",
            "categoryName": "Bicycle repair shop",
            "address": "1802 Barton Springs Rd, Austin, TX 78704",
            "street": "1802 Barton Springs Rd",
            "city": "Austin",
            "state": "TX",
            "postalCode": "78704",
            "countryCode": "US",
            "phone": "(512) 555-0121",
            "website": "https://austinbikeworkshop.org",
            "totalScore": 4.3,
            "reviewsCount": 90,
            "placeId": "ChIJ_bike_2"
        },
        {
            "title": "Maria's Taqueria",
            "categoryName": "Mexican restaurant",
            "address": "15 Cesar Chavez St, Austin, TX 78701",
            "street": "15 Cesar Chavez St",
            "city": "Austin",
            "state": "TX",
            "postalCode": "78701",
            "countryCode": "US",
            "phone": "(512) 555-0143",
            "totalScore": 4.5,
            "reviewsCount": 1210,
            "placeId": "ChIJ_maria_1"
        },
        {
            "title": "Marias Taqueria",
            "categoryName": "Taco restaurant",
            "address": "15 Cesar Chavez Street, Austin, TX 78701",
            "city": "Austin",
            "state": "TX",
            "postalCode": "78701",
            "countryCode": "US",
            "phone": "+15125550143",
            "website": "https://mariastaqueriaatx.com",
            "totalScore": 4.5,
            "reviewsCount": 1208,
            "placeId": "ChIJ_maria_2"
        },
        {
            "title": "Oak Street Veterinary Clinic",
            "categoryName": "Veterinarian",
            "address": "8 Oak St, Cedar Park, TX 78613",
            "street": "8 Oak St",
            "city": "Cedar Park",
            "state": "TX",
            "postalCode": "78613",
            "countryCode": "US",
            "phone": "(512) 555-0111",
            "website": "https://oakstreetvet.com",
            "totalScore": 4.8,
            "reviewsCount": 300,
            "placeId": "ChIJ_oak_1"
        }
    ],
    "sourceUrl": "",
    "csvText": "",
    "schema": "auto",
    "fieldMap": {},
    "matchThreshold": 85,
    "reviewThreshold": 70,
    "mergePolicy": "richest",
    "outputMode": "clean",
    "addDedupeFields": true,
    "defaultCountry": "auto",
    "maxClusterSize": 25,
    "maxBlockSize": 500,
    "maxRecords": 200000
};

// Run the Actor and wait for it to finish
const run = await client.actor("that_red_bird/lead-list-deduplicator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "mode": "dedupe",
    "records": [
        {
            "title": "Blue Door Dental Care",
            "categoryName": "Dentist",
            "address": "120 Main St, Austin, TX 78701",
            "street": "120 Main St",
            "city": "Austin",
            "state": "Texas",
            "postalCode": "78701",
            "countryCode": "US",
            "phone": "(512) 555-0134",
            "website": "https://www.bluedoordental.com/",
            "totalScore": 4.8,
            "reviewsCount": 212,
            "location": {
                "lat": 30.26721,
                "lng": -97.74312,
            },
            "placeId": "ChIJ_bluedoor_A",
        },
        {
            "title": "Blue Door Dental",
            "categoryName": "Dental clinic",
            "address": "120 Main Street, Austin, TX 78701",
            "city": "Austin",
            "state": "TX",
            "postalCode": "78701",
            "countryCode": "US",
            "phone": "+1 512-555-0134",
            "website": "http://bluedoordental.com/?utm_source=google",
            "reviewsCount": 0,
            "placeId": "ChIJ_bluedoor_B",
        },
        {
            "title": "Lakeside Pizza & Pasta",
            "categoryName": "Pizza restaurant",
            "address": "45 Lake Ave, Austin, TX 78702",
            "street": "45 Lake Ave",
            "city": "Austin",
            "state": "TX",
            "postalCode": "78702",
            "countryCode": "US",
            "phone": "(512) 555-0178",
            "totalScore": 4.4,
            "reviewsCount": 891,
            "location": {
                "lat": 30.2601,
                "lng": -97.7102,
            },
            "placeId": "ChIJ_lakeside_1",
        },
        {
            "title": "Lakeside Pizza and Pasta LLC",
            "categoryName": "Restaurant",
            "address": "45 Lake Avenue, Austin, TX 78702",
            "city": "Austin",
            "state": "TX",
            "postalCode": "78702",
            "countryCode": "US",
            "phone": "512.555.0178",
            "website": "https://lakesidepizzaatx.com",
            "totalScore": 4.4,
            "reviewsCount": 893,
            "location": {
                "lat": 30.26012,
                "lng": -97.71021,
            },
            "placeId": "ChIJ_lakeside_1",
        },
        {
            "title": "Hill Country Coffee",
            "categoryName": "Coffee shop",
            "address": "900 Congress Ave, Austin, TX 78701",
            "street": "900 Congress Ave",
            "city": "Austin",
            "state": "TX",
            "postalCode": "78701",
            "countryCode": "US",
            "phone": "(512) 555-0102",
            "website": "https://hillcountrycoffee.com",
            "totalScore": 4.6,
            "reviewsCount": 540,
            "location": {
                "lat": 30.2712,
                "lng": -97.7431,
            },
            "placeId": "ChIJ_hcc_congress",
        },
        {
            "title": "Hill Country Coffee",
            "categoryName": "Coffee shop",
            "address": "2100 S Lamar Blvd, Austin, TX 78704",
            "street": "2100 S Lamar Blvd",
            "city": "Austin",
            "state": "TX",
            "postalCode": "78704",
            "countryCode": "US",
            "phone": "(512) 555-0166",
            "website": "https://hillcountrycoffee.com",
            "totalScore": 4.5,
            "reviewsCount": 377,
            "location": {
                "lat": 30.2453,
                "lng": -97.769,
            },
            "placeId": "ChIJ_hcc_lamar",
        },
        {
            "title": "Hill Country Coffee Roasters",
            "categoryName": "Coffee roaster",
            "address": "900 Congress Avenue, Austin, TX 78701",
            "city": "Austin",
            "state": "TX",
            "postalCode": "78701",
            "countryCode": "US",
            "phone": "512.555.0102",
            "totalScore": 4.1,
            "reviewsCount": 12,
            "placeId": "ChIJ_hcc_roasters_old",
        },
        {
            "title": "Greenleaf Plumbing Co.",
            "categoryName": "Plumber",
            "address": "77 Industrial Blvd, Round Rock, TX 78664",
            "street": "77 Industrial Blvd",
            "city": "Round Rock",
            "state": "TX",
            "postalCode": "78664",
            "countryCode": "US",
            "phone": "(512) 555-0190",
            "totalScore": 4.9,
            "reviewsCount": 64,
            "placeId": "ChIJ_greenleaf_1",
        },
        {
            "title": "Green Leaf Plumbing",
            "categoryName": "Plumbing service",
            "address": "77 Industrial Boulevard, Round Rock, TX 78664",
            "city": "Round Rock",
            "state": "TX",
            "postalCode": "78664",
            "countryCode": "US",
            "website": "https://greenleafplumbing.net",
            "totalScore": 4.9,
            "reviewsCount": 61,
            "placeId": "ChIJ_greenleaf_2",
        },
        {
            "title": "Austin Bike Works",
            "categoryName": "Bicycle shop",
            "address": "301 E 6th St, Austin, TX 78701",
            "street": "301 E 6th St",
            "city": "Austin",
            "state": "TX",
            "postalCode": "78701",
            "countryCode": "US",
            "phone": "(512) 555-0155",
            "website": "https://austinbikeworks.com",
            "totalScore": 4.7,
            "reviewsCount": 158,
            "placeId": "ChIJ_bike_1",
        },
        {
            "title": "Austin Bike Workshop",
            "categoryName": "Bicycle repair shop",
            "address": "1802 Barton Springs Rd, Austin, TX 78704",
            "street": "1802 Barton Springs Rd",
            "city": "Austin",
            "state": "TX",
            "postalCode": "78704",
            "countryCode": "US",
            "phone": "(512) 555-0121",
            "website": "https://austinbikeworkshop.org",
            "totalScore": 4.3,
            "reviewsCount": 90,
            "placeId": "ChIJ_bike_2",
        },
        {
            "title": "Maria's Taqueria",
            "categoryName": "Mexican restaurant",
            "address": "15 Cesar Chavez St, Austin, TX 78701",
            "street": "15 Cesar Chavez St",
            "city": "Austin",
            "state": "TX",
            "postalCode": "78701",
            "countryCode": "US",
            "phone": "(512) 555-0143",
            "totalScore": 4.5,
            "reviewsCount": 1210,
            "placeId": "ChIJ_maria_1",
        },
        {
            "title": "Marias Taqueria",
            "categoryName": "Taco restaurant",
            "address": "15 Cesar Chavez Street, Austin, TX 78701",
            "city": "Austin",
            "state": "TX",
            "postalCode": "78701",
            "countryCode": "US",
            "phone": "+15125550143",
            "website": "https://mariastaqueriaatx.com",
            "totalScore": 4.5,
            "reviewsCount": 1208,
            "placeId": "ChIJ_maria_2",
        },
        {
            "title": "Oak Street Veterinary Clinic",
            "categoryName": "Veterinarian",
            "address": "8 Oak St, Cedar Park, TX 78613",
            "street": "8 Oak St",
            "city": "Cedar Park",
            "state": "TX",
            "postalCode": "78613",
            "countryCode": "US",
            "phone": "(512) 555-0111",
            "website": "https://oakstreetvet.com",
            "totalScore": 4.8,
            "reviewsCount": 300,
            "placeId": "ChIJ_oak_1",
        },
    ],
    "sourceUrl": "",
    "csvText": "",
    "schema": "auto",
    "fieldMap": {},
    "matchThreshold": 85,
    "reviewThreshold": 70,
    "mergePolicy": "richest",
    "outputMode": "clean",
    "addDedupeFields": True,
    "defaultCountry": "auto",
    "maxClusterSize": 25,
    "maxBlockSize": 500,
    "maxRecords": 200000,
}

# Run the Actor and wait for it to finish
run = client.actor("that_red_bird/lead-list-deduplicator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mode": "dedupe",
  "records": [
    {
      "title": "Blue Door Dental Care",
      "categoryName": "Dentist",
      "address": "120 Main St, Austin, TX 78701",
      "street": "120 Main St",
      "city": "Austin",
      "state": "Texas",
      "postalCode": "78701",
      "countryCode": "US",
      "phone": "(512) 555-0134",
      "website": "https://www.bluedoordental.com/",
      "totalScore": 4.8,
      "reviewsCount": 212,
      "location": {
        "lat": 30.26721,
        "lng": -97.74312
      },
      "placeId": "ChIJ_bluedoor_A"
    },
    {
      "title": "Blue Door Dental",
      "categoryName": "Dental clinic",
      "address": "120 Main Street, Austin, TX 78701",
      "city": "Austin",
      "state": "TX",
      "postalCode": "78701",
      "countryCode": "US",
      "phone": "+1 512-555-0134",
      "website": "http://bluedoordental.com/?utm_source=google",
      "reviewsCount": 0,
      "placeId": "ChIJ_bluedoor_B"
    },
    {
      "title": "Lakeside Pizza & Pasta",
      "categoryName": "Pizza restaurant",
      "address": "45 Lake Ave, Austin, TX 78702",
      "street": "45 Lake Ave",
      "city": "Austin",
      "state": "TX",
      "postalCode": "78702",
      "countryCode": "US",
      "phone": "(512) 555-0178",
      "totalScore": 4.4,
      "reviewsCount": 891,
      "location": {
        "lat": 30.2601,
        "lng": -97.7102
      },
      "placeId": "ChIJ_lakeside_1"
    },
    {
      "title": "Lakeside Pizza and Pasta LLC",
      "categoryName": "Restaurant",
      "address": "45 Lake Avenue, Austin, TX 78702",
      "city": "Austin",
      "state": "TX",
      "postalCode": "78702",
      "countryCode": "US",
      "phone": "512.555.0178",
      "website": "https://lakesidepizzaatx.com",
      "totalScore": 4.4,
      "reviewsCount": 893,
      "location": {
        "lat": 30.26012,
        "lng": -97.71021
      },
      "placeId": "ChIJ_lakeside_1"
    },
    {
      "title": "Hill Country Coffee",
      "categoryName": "Coffee shop",
      "address": "900 Congress Ave, Austin, TX 78701",
      "street": "900 Congress Ave",
      "city": "Austin",
      "state": "TX",
      "postalCode": "78701",
      "countryCode": "US",
      "phone": "(512) 555-0102",
      "website": "https://hillcountrycoffee.com",
      "totalScore": 4.6,
      "reviewsCount": 540,
      "location": {
        "lat": 30.2712,
        "lng": -97.7431
      },
      "placeId": "ChIJ_hcc_congress"
    },
    {
      "title": "Hill Country Coffee",
      "categoryName": "Coffee shop",
      "address": "2100 S Lamar Blvd, Austin, TX 78704",
      "street": "2100 S Lamar Blvd",
      "city": "Austin",
      "state": "TX",
      "postalCode": "78704",
      "countryCode": "US",
      "phone": "(512) 555-0166",
      "website": "https://hillcountrycoffee.com",
      "totalScore": 4.5,
      "reviewsCount": 377,
      "location": {
        "lat": 30.2453,
        "lng": -97.769
      },
      "placeId": "ChIJ_hcc_lamar"
    },
    {
      "title": "Hill Country Coffee Roasters",
      "categoryName": "Coffee roaster",
      "address": "900 Congress Avenue, Austin, TX 78701",
      "city": "Austin",
      "state": "TX",
      "postalCode": "78701",
      "countryCode": "US",
      "phone": "512.555.0102",
      "totalScore": 4.1,
      "reviewsCount": 12,
      "placeId": "ChIJ_hcc_roasters_old"
    },
    {
      "title": "Greenleaf Plumbing Co.",
      "categoryName": "Plumber",
      "address": "77 Industrial Blvd, Round Rock, TX 78664",
      "street": "77 Industrial Blvd",
      "city": "Round Rock",
      "state": "TX",
      "postalCode": "78664",
      "countryCode": "US",
      "phone": "(512) 555-0190",
      "totalScore": 4.9,
      "reviewsCount": 64,
      "placeId": "ChIJ_greenleaf_1"
    },
    {
      "title": "Green Leaf Plumbing",
      "categoryName": "Plumbing service",
      "address": "77 Industrial Boulevard, Round Rock, TX 78664",
      "city": "Round Rock",
      "state": "TX",
      "postalCode": "78664",
      "countryCode": "US",
      "website": "https://greenleafplumbing.net",
      "totalScore": 4.9,
      "reviewsCount": 61,
      "placeId": "ChIJ_greenleaf_2"
    },
    {
      "title": "Austin Bike Works",
      "categoryName": "Bicycle shop",
      "address": "301 E 6th St, Austin, TX 78701",
      "street": "301 E 6th St",
      "city": "Austin",
      "state": "TX",
      "postalCode": "78701",
      "countryCode": "US",
      "phone": "(512) 555-0155",
      "website": "https://austinbikeworks.com",
      "totalScore": 4.7,
      "reviewsCount": 158,
      "placeId": "ChIJ_bike_1"
    },
    {
      "title": "Austin Bike Workshop",
      "categoryName": "Bicycle repair shop",
      "address": "1802 Barton Springs Rd, Austin, TX 78704",
      "street": "1802 Barton Springs Rd",
      "city": "Austin",
      "state": "TX",
      "postalCode": "78704",
      "countryCode": "US",
      "phone": "(512) 555-0121",
      "website": "https://austinbikeworkshop.org",
      "totalScore": 4.3,
      "reviewsCount": 90,
      "placeId": "ChIJ_bike_2"
    },
    {
      "title": "Maria'\''s Taqueria",
      "categoryName": "Mexican restaurant",
      "address": "15 Cesar Chavez St, Austin, TX 78701",
      "street": "15 Cesar Chavez St",
      "city": "Austin",
      "state": "TX",
      "postalCode": "78701",
      "countryCode": "US",
      "phone": "(512) 555-0143",
      "totalScore": 4.5,
      "reviewsCount": 1210,
      "placeId": "ChIJ_maria_1"
    },
    {
      "title": "Marias Taqueria",
      "categoryName": "Taco restaurant",
      "address": "15 Cesar Chavez Street, Austin, TX 78701",
      "city": "Austin",
      "state": "TX",
      "postalCode": "78701",
      "countryCode": "US",
      "phone": "+15125550143",
      "website": "https://mariastaqueriaatx.com",
      "totalScore": 4.5,
      "reviewsCount": 1208,
      "placeId": "ChIJ_maria_2"
    },
    {
      "title": "Oak Street Veterinary Clinic",
      "categoryName": "Veterinarian",
      "address": "8 Oak St, Cedar Park, TX 78613",
      "street": "8 Oak St",
      "city": "Cedar Park",
      "state": "TX",
      "postalCode": "78613",
      "countryCode": "US",
      "phone": "(512) 555-0111",
      "website": "https://oakstreetvet.com",
      "totalScore": 4.8,
      "reviewsCount": 300,
      "placeId": "ChIJ_oak_1"
    }
  ],
  "sourceUrl": "",
  "csvText": "",
  "schema": "auto",
  "fieldMap": {},
  "matchThreshold": 85,
  "reviewThreshold": 70,
  "mergePolicy": "richest",
  "outputMode": "clean",
  "addDedupeFields": true,
  "defaultCountry": "auto",
  "maxClusterSize": 25,
  "maxBlockSize": 500,
  "maxRecords": 200000
}' |
apify call that_red_bird/lead-list-deduplicator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,that_red_bird/lead-list-deduplicator"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/it8iJ9bFJU8Ic42Ne/builds/LQycYr3EWL1WmVuTy/openapi.json
