# Google Maps Lead AI (`rodrigo_pacelli/google-maps-lead-ai`) Actor

Google Maps scraper with AI lead classification. Extract business name, phone, website, address, rating and reviews from Google Maps searches, then classify each place into your own custom labels using AI (Groq). Ideal for lead generation, prospecting and market research.

- **URL**: https://apify.com/rodrigo\_pacelli/google-maps-lead-ai.md
- **Developed by:** [Rodrigo Pacelli](https://apify.com/rodrigo_pacelli) (community)
- **Categories:** Lead generation, AI, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 results

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Google Maps Lead AI

**Turn any Google Maps search into a pre-qualified lead list — with real phone numbers and AI classification.**

Scrape businesses from Google Maps — name, **phone**, website, address, category, rating, review count, review excerpts and coordinates — then let AI sort every result into **your own labels and tags**. You don't just get a contact list; you get one that's already triaged by fit, specialty and reputation, ready for cold-calling, prospecting, CRM enrichment or market research.

***

### Why this scraper

- 📞 **Real phone numbers** — pulled from each place's detail panel, where Google actually exposes them. Many cheaper scrapers skip this; the phone is the whole point of a lead.
- 🧠 **AI lead classification, your way** — bring your own labels **and/or** describe in plain language how to classify. Get back structured, grouped tags for every lead.
- 🔁 **Incremental mode for scheduling** — on repeat runs, only **new** places are visited and charged. Perfect for a daily or weekly cron.
- 🌎 **Any niche, any country** — *"lawyer Belo Horizonte"*, *"dentist Austin"*, *"real estate agency Lisbon"*. You define the searches and the labels.
- ♻️ **Deduplicated & cached** — no duplicate places; AI classifications are cached for 7 days, so re-runs never re-pay for the same place.

***

### What you get — per place

```json
{
  "name": "Silva & Associados Advogados",
  "phone": "+553133334444",
  "website": "https://silvaassociados.com.br",
  "category": "Advogado",
  "address": "Av. Afonso Pena, 1000 - Centro, Belo Horizonte - MG",
  "rating": 4.8,
  "reviewsCount": 127,
  "reviewsSample": ["Excellent service, highly recommend..."],
  "lat": -19.9245,
  "lng": -43.9352,
  "labels": ["LAW_FIRM"],
  "tags": { "area": ["labor", "civil"], "reputation": ["good reviews"] },
  "confidence": 0.92
}
```

Every run streams clean, deduplicated JSON to the dataset — export to **JSON, CSV or Excel**, or pull it straight from the **API**.

***

### AI classification — two knobs, one cheap call

Classification is **optional** and uses Groq (bring your own API key from [console.groq.com](https://console.groq.com)). Use either knob, or both — everything runs in a **single AI call per place**, so extra characteristics cost almost nothing.

#### 1. Labels — a strict shortlist

Provide a closed list (e.g. `LAW_FIRM`, `SOLO_LAWYER`, `NOT_A_FIT`). The AI assigns the 1–3 that fit, returned in `labels`. Ideal for filtering out the noise Google mixes into a category — accountants, notaries and "consultancies" that aren't your target.

#### 2. Instruction — free text, grouped tags

Describe, in your own words, exactly how you want each place classified:

> *"Classify law firms by practice area (labor, civil, family, criminal) and by review reputation (good reviews / complaints), with separated tags."*

→

```json
"tags": { "area": ["labor", "family"], "reputation": ["good reviews"] }
```

The AI groups its findings by each characteristic you asked for, and returns a `confidence` score (0–1) with every result.

***

### Incremental runs — built for scheduling

Turn on **Only New Places** and the actor remembers every place it has collected. On the next run it reads the search results, **skips the expensive detail visit for places it already has**, and processes only the new ones.

A scheduled daily or weekly run then surfaces **only fresh leads** — instead of re-scraping, and re-paying for, the same city every time. Leave it off for a one-shot full pull.

***

### Input example

```json
{
  "searchTerms": ["advogado"],
  "locations": ["Belo Horizonte, MG"],
  "maxPlacesPerSearch": 100,
  "classifyWithAI": true,
  "groqApiKey": "gsk_...",
  "labels": ["ESCRITORIO_ADVOCACIA", "ADVOGADO_SOLO", "NAO_FIT"],
  "classificationInstruction": "Classify by practice area and review reputation, with separated tags.",
  "onlyNewPlaces": false
}
```

Only `searchTerms` and `locations` are required. Each search term is combined with each location.

***

### Great for

- **Lead generation & cold calling** — a phone list that's already qualified by fit, specialty and reputation.
- **Sales prospecting at scale** — schedule it and receive only new leads on every run.
- **Market research** — map who's in a category, where they are, and how they're rated.
- **CRM enrichment** — feed structured, tagged businesses straight into your pipeline.

***

### Good to know

- Phone numbers live on each place's detail panel, so the actor visits every place — accurate contact data, powered by a real browser and residential proxy.
- AI classification is optional (bring your own Groq API key). Leave it off for a pure scrape.
- Deduplication is automatic (by place and by name), so your dataset stays clean across searches and runs.

# Actor input Schema

## `searchTerms` (type: `array`):

Business categories or keywords to search for (e.g. 'lawyer', 'dentist', 'real estate agency').

## `locations` (type: `array`):

Cities or regions to search in. Each search term is combined with each location.

## `maxPlacesPerSearch` (type: `integer`):

Maximum number of places to collect per search (term x location combination).

## `language` (type: `string`):

Google Maps interface language (hl parameter), e.g. 'pt-BR', 'en', 'es'.

## `includeReviewsSample` (type: `boolean`):

Extract a sample of up to 5 review texts per place (improves AI classification quality).

## `useApifyProxy` (type: `boolean`):

Use Apify residential proxy. Strongly recommended — Google Maps blocks datacenter IPs at scale.

## `classifyWithAI` (type: `boolean`):

Classify each place into your custom labels using Groq AI (requires Groq API key).

## `groqApiKey` (type: `string`):

Your Groq API key for AI classification, from https://console.groq.com. Only needed if 'Enable AI Classification' is ON.

## `groqModel` (type: `string`):

The Groq model to use for AI classification.

## `labels` (type: `array`):

Optional closed list for a strict 'fit' classification (e.g. 'LAW\_FIRM', 'SOLO\_LAWYER', 'NOT\_A\_FIT'). The AI assigns 1-3 of these per place, returned in the 'labels' field. If both this and the instruction are empty, defaults to LEAD / NOT\_A\_FIT.

## `classificationInstruction` (type: `string`):

Describe in your own words how the AI should classify each place. It returns a 'tags' object grouping findings by characteristic. Example: 'Classify law firms by practice area (labor, civil, family, criminal) and by review reputation (good reviews / complaints), with separated tags.'

## `onlyNewPlaces` (type: `boolean`):

Remember places across runs and skip ones already collected before. Ideal for scheduled runs: only NEW places are visited, classified and charged — the expensive detail visits for known places are skipped. State is kept in a persistent store on the actor.

## `debug` (type: `boolean`):

Verbose logging.

## Actor input object example

```json
{
  "searchTerms": [
    "advogado"
  ],
  "locations": [
    "Belo Horizonte, MG"
  ],
  "maxPlacesPerSearch": 100,
  "language": "pt-BR",
  "includeReviewsSample": true,
  "useApifyProxy": true,
  "classifyWithAI": false,
  "groqModel": "llama-3.3-70b-versatile",
  "labels": [],
  "classificationInstruction": "",
  "onlyNewPlaces": false,
  "debug": false
}
```

# Actor output Schema

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

Dataset containing all scraped places with phone numbers, business data, and optional AI classification (labels, tags, confidence).

# 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 = {
    "searchTerms": [
        "advogado"
    ],
    "locations": [
        "Belo Horizonte, MG"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rodrigo_pacelli/google-maps-lead-ai").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 = {
    "searchTerms": ["advogado"],
    "locations": ["Belo Horizonte, MG"],
}

# Run the Actor and wait for it to finish
run = client.actor("rodrigo_pacelli/google-maps-lead-ai").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 '{
  "searchTerms": [
    "advogado"
  ],
  "locations": [
    "Belo Horizonte, MG"
  ]
}' |
apify call rodrigo_pacelli/google-maps-lead-ai --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rodrigo_pacelli/google-maps-lead-ai"
        }
    }
}

```

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/hn8cR7PDfWziLc5y1/builds/UyvQbHiQIUGBh48Oh/openapi.json
