# Maps2leads (`angga0x/maps2leads`) Actor

Turn Google Maps into a daily source of fresh B2B leads.
Maps2Leads is an Apify Actor that automatically collects publicly available business data from Google Maps and enriches it with contact information from each company’s website using AI.

- **URL**: https://apify.com/angga0x/maps2leads.md
- **Developed by:** [Angga](https://apify.com/angga0x) (community)
- **Categories:** Automation, Lead generation, AI
- **Features:** Limited permissions
- **Stats:** 8 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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

## Maps2Leads – Google Maps Business Lead Generator with AI Enrichment

**Maps2Leads** is a powerful Apify Actor that scrapes business listings from Google Maps and optionally enriches them by visiting the business websites to extract contact information (Emails, Social Media) using AI or Regex.

### Features

- 📍 **Scrape Google Maps**: Extracts Name, Category, Rating, Reviews, Phone, Address, and Website.
- 🤖 **AI Enrichment**: Uses OpenAI (optional) to intelligent extract emails and social links from business websites.
- ⚡ **Regex Fallback**: Robust fallback to pattern matching if no API key is provided.
- 🛡️ **Production Ready**: Built with Playwright and Apify SDK, handling retries, dynamic scrolling, and cookie consents.

### Prerequisites

- Apify Account
- (Optional) OpenAI API Key for better enrichment accuracy.

### Input Parameters

| Field | Type | Description | Default |
|-------|------|-------------|---------|
| `keyword` | String | Search term (e.g. "Pizza", "Plumber") | Required |
| `location` | String | Location (e.g. "New York", "London") | Required |
| `maxResults` | Number | Max listings to scrape | 10 |
| `language` | String | Language code | "en" |
| `enableEnrichment` | Boolean | Visit websites for contact info? | false |
| `openaiApiKey` | String | Your OpenAI API Key | Optional |

### Output Format

The actor stores results in the default Apify Dataset in JSON format:

```json
{
  "business_name": "Joe's Pizza",
  "category": "Pizza Restaurant",
  "rating": 4.5,
  "reviews": 1200,
  "phone": "+1 212-555-0199",
  "website": "https://joespizza.com",
  "email": "contact@joespizza.com",
  "instagram": "https://instagram.com/joespizza",
  "facebook": "https://facebook.com/joespizza",
  "city": "New York",
  "maps_url": "https://www.google.com/maps/place/...",
  "source": "google_maps"
}
```

### Legal & Safety Disclaimer

This tool is for educational and legitimate business research purposes only.

- **Public Data Only**: This actor only collects publicly available data.
- **Respect Rules**: We respect `robots.txt` policies on target websites where standard crawlability rules apply.
- **GDPR/CCPA**: Ensure you comply with local privacy laws when handling personal contact information (emails/phones).
- **Google Maps**: Scraping Google Maps may violate their Terms of Service. Use at your own risk.

### Troubleshooting

- **No results?** Try increasing `maxResults` or changing the usage hours.
- **Enrichment failing?** Ensure the target websites are accessible and not blocking bot traffic.

### Support

For issues or feature requests, please open an issue in the repository.

# Actor input Schema

## `keyword` (type: `string`):

Business type to search for (e.g., 'Dentist', 'Coffee Shop')

## `location` (type: `string`):

City or area to search in (e.g., 'New York', 'London')

## `maxResults` (type: `integer`):

Maximum number of places to scrape

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

Language for Google Maps results (e.g., 'en')

## `enableEnrichment` (type: `boolean`):

Visit business websites to extract emails and social links

## `openaiApiKey` (type: `string`):

Optional: Key for AI-powered contact extraction. If empty, uses Regex fallback.

## Actor input object example

```json
{
  "maxResults": 10,
  "language": "en",
  "enableEnrichment": false
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("angga0x/maps2leads").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("angga0x/maps2leads").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 '{}' |
apify call angga0x/maps2leads --silent --output-dataset

```

## MCP server setup

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

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/Fgt2v94itKiOYJh4Q/builds/65QPgXlnf34ap6TfN/openapi.json
