# Lead Extractor-Google Map (`happitap/lead-extractor-google-map`) Actor

Lead Extractor is an automation tool that extracts business leads and contact details from Google Map. Instantly collect company names, phone numbers, and more for easy export and outreach. Perfect for sales, marketing, and lead generation.

- **URL**: https://apify.com/happitap/lead-extractor-google-map.md
- **Developed by:** [HappiTap](https://apify.com/happitap) (community)
- **Categories:** Lead generation, Developer tools, Integrations
- **Stats:** 65 total users, 5 monthly users, 98.4% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 lead generateds

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?

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

## Lead Extractor - Google Maps

Scrape business listings from **Google Maps** and extract structured lead data including names, addresses, contact info, categories, and more. Ideal for marketers, lead generators, and local business intelligence.

***

### 🧠 What it does

This actor searches and scrapes Google Maps listings for a given query (like "salon Mumbai") and extracts data from each business result page.

***

### ✅ Use cases

- Generate leads for local businesses
- Build prospect lists for outreach
- Market research and competitor discovery
- Analyze service coverage in specific areas

***

### 📥 Input

You can provide the following input fields:

````json
{
  "startUrls": [
    {
      "url": "https://www.google.com/maps/search/salon+Mumbai/"
    }
  ]
}
### 📤 Output

The actor saves structured data for each business listing into the default dataset.

#### Sample Output

```json
{
  "name": "Salon XYZ",
  "url": "https://www.google.com/maps/place/Salon+XYZ/",
  "address": "123 Main St, Mumbai",
  "phone": "+91 98765 43210",
  "website": "http://salonxyz.com/",
  "rating": 4.6,
  "reviewCount": 82,
  "category": "Beauty Salon",
  "hours": ["Mon: 10AM–8PM", "Tue: 10AM–8PM", "Wed: Closed", "..."],
  "plusCode": "4R9M+3W Mumbai",
  "location": {
    "lat": 19.076,
    "lng": 72.8777
  }
}
#### 📄 Output Fields Explained

| Field         | Type      | Description                                                              |
|---------------|-----------|--------------------------------------------------------------------------|
| `name`        | `string`  | Name of the business                                                     |
| `url`         | `string`  | Direct Google Maps URL to the business listing                          |
| `address`     | `string`  | Full address of the business                                             |
| `phone`       | `string`  | Contact phone number (if available)                                     |
| `website`     | `string`  | Official website link (if available)                                    |
| `rating`      | `number`  | Average user rating (out of 5)                                           |
| `reviewCount` | `number`  | Number of user reviews                                                   |
| `category`    | `string`  | Category or type of business (e.g., "Salon", "Restaurant")               |
| `hours`       | `array`   | Operating hours per day (if available)                                   |
| `plusCode`    | `string`  | Google Plus Code for geolocation                                        |
| `location`    | `object`  | Latitude and longitude coordinates `{ lat: number, lng: number }`        |
### 🔒 Proxy

This actor uses **Apify Proxy** by default to ensure stable and anonymous scraping.

- It helps avoid IP bans and captchas.
- It allows you to target geo-specific results by using location-based proxy groups.

No manual configuration is needed unless you want to use your own proxy settings. The proxy is automatically injected using:

```js
const proxyConfiguration = await Actor.createProxyConfiguration();



---

#### 🚀 How to Use

```markdown
### 🚀 How to Use

1. Go to [Apify Console](https://console.apify.com)
2. Click **"Try Actor"** or create a Task
3. Enter your input:
   - Example:  
     ```json
     {
       "startUrls": [
         {
           "url": "https://www.google.com/maps/search/salon+Mumbai/"
         }
       ]
     }
     ```
4. Run the Actor
5. Download your results in **JSON**, **CSV**, or **Excel** formats


### 🛠️ Tech Stack

- [Apify SDK](https://sdk.apify.com/) – Actor lifecycle management and data handling
- [Crawlee](https://crawlee.dev/) – Scalable web scraping framework
- [Puppeteer](https://pptr.dev/) – Headless Chrome browser automation
- Node.js – JavaScript runtime used for scripting

# Actor input Schema

## `startUrls` (type: `array`):

List of URLs to extract business leads from. Supports Google Maps search URLs (e.g., https://www.google.com/maps/search/salon+Mumbai/), Yellow Pages URLs (e.g., https://www.yellowpages.com/search?search_terms=restaurant&geo_location_terms=New+York), and JustDial URLs (e.g., https://www.justdial.com/Mumbai/Restaurants). Each URL should be a search results page for the type of businesses you want to extract. The Actor will automatically detect the source and use the appropriate extraction logic. Format: Array of objects with 'url' property. Required to specify where to scrape leads from.
## `maxLeads` (type: `integer`):

Maximum number of business leads to extract from each start URL. This limits how many results the Actor will scrape to control runtime and costs. For example, setting this to 50 will extract up to 50 businesses from each URL in the startUrls list. Default: 100. Format: Positive integer. Why needed: Prevents excessive scraping and helps manage Actor runtime costs.
## `concurrency` (type: `integer`):

Number of business detail pages to process in parallel. Higher values speed up extraction but use more resources and may trigger rate limiting or timeouts. Recommended: 3-5 for reliable extraction. Values above 10 are capped to 10 to prevent resource overload. Lower values (3-5) are safer and more reliable. Default: 5. Format: Positive integer between 1-10. Why needed: Controls extraction speed and resource usage to balance performance with reliability.
## `timeoutSecs` (type: `integer`):

Maximum time the Actor will run before gracefully stopping and returning partial results. Capped at 270s (4.5 minutes) to leave a 30s safety buffer before Apify's default 5-minute platform timeout. If you have increased your Actor's platform timeout in Apify settings, you can raise this value accordingly (it will still be capped at 270s internally). Default: 300. Format: Positive integer in seconds.
## `proxyConfiguration` (type: `object`):

Proxy settings to avoid IP blocking and rate limiting. Using proxies is essential for scraping Google Maps, Yellow Pages, and JustDial as these sites may block requests from the same IP. Recommended: Use Apify's residential proxies for best results. Format: Proxy configuration object with 'useApifyProxy' set to true. Why needed: Ensures reliable scraping without getting blocked by target websites.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.google.com/maps/search/salon+Mumbai/"
    }
  ],
  "maxLeads": 5,
  "concurrency": 5,
  "timeoutSecs": 300,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
````

# Actor output Schema

## `leads` (type: `string`):

All extracted business leads with contact details

## `outputFile` (type: `string`):

Full array of leads stored as OUTPUT record

# 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 = {
    "startUrls": [
        {
            "url": "https://www.google.com/maps/search/salon+Mumbai/"
        }
    ],
    "maxLeads": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("happitap/lead-extractor-google-map").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 = {
    "startUrls": [{ "url": "https://www.google.com/maps/search/salon+Mumbai/" }],
    "maxLeads": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("happitap/lead-extractor-google-map").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 '{
  "startUrls": [
    {
      "url": "https://www.google.com/maps/search/salon+Mumbai/"
    }
  ],
  "maxLeads": 5
}' |
apify call happitap/lead-extractor-google-map --silent --output-dataset

```

## MCP server setup

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

```

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/HGzysChLSoRUg4ywK/builds/2EZkmQAHcQNa1YI0Z/openapi.json
