# Deduplicate Maps leads and exclude existing contacts

**Use case:** 

Run four clearly synthetic rows to see territory filtering, duplicate removal and existing-Place-ID suppression. One synthetic lead should remain. Replace the rows with real Compass-format data. No upstream search or real lead discovery occurs in this example.

## Input

```json
{
  "bounds": [
    -112.085,
    33.44,
    -112.06,
    33.465
  ],
  "maxCandidates": 50,
  "places": [
    {
      "placeId": "demo-new",
      "title": "Synthetic new lead",
      "location": {
        "lat": 33.45,
        "lng": -112.07
      }
    },
    {
      "placeId": "demo-new",
      "title": "Synthetic duplicate",
      "location": {
        "lat": 33.45,
        "lng": -112.07
      }
    },
    {
      "placeId": "demo-existing",
      "title": "Synthetic existing lead",
      "location": {
        "lat": 33.45,
        "lng": -112.07
      }
    },
    {
      "placeId": "demo-outside",
      "title": "Synthetic outside territory",
      "location": {
        "lat": 34,
        "lng": -112.07
      }
    }
  ],
  "excludePlaceIds": [
    "demo-existing"
  ],
  "excludeClosed": true,
  "maxItems": 10
}
```

## Output

```json
{
  "title": {
    "label": "title"
  },
  "address": {
    "label": "address"
  },
  "latitude": {
    "label": "latitude"
  },
  "longitude": {
    "label": "longitude"
  },
  "website": {
    "label": "website"
  },
  "phone": {
    "label": "phone"
  }
}
```

## About this Actor

This example demonstrates how to use [Google Maps Leads: Territory Filter & Deduplication](https://apify.com/lifelong_starfruit/pilot-maps-territory-leads.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/lifelong_starfruit/pilot-maps-territory-leads.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/lifelong_starfruit/pilot-maps-territory-leads.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`).
