# Lead Generator — B2B Email Finder & Contact Prospecting (`oneary/lead-generator`) Actor

Find B2B leads from any website: extract emails, phone numbers, and social profiles. Supports domain lists, Google search integration, and CSV export. Built for sales teams and lead enrichment.

- **URL**: https://apify.com/oneary/lead-generator.md
- **Developed by:** [Luan M.](https://apify.com/oneary) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$30.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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 Generator & Email Finder

**Extract emails, phone numbers, social media profiles, and business information from any website or search results.** Perfect for sales prospecting, lead enrichment, and market research.

---

### 🚀 Quick Start

1. **Install dependencies**

```bash
npm install
````

2. **Run locally**

```bash
## Via script (uses input from Apify storage or defaults)
npm start

## Or directly with custom input
node src/main.js
```

3. **Run on Apify Platform**

- Deploy this actor to [Apify Console](https://console.apify.com)
- Or run via CLI: `apify run`

***

### 📋 Input Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `startUrls` | `array` | `[]` | List of website URLs to scrape for leads |
| `searchQuery` | `string` | `""` | Google search query to find businesses (e.g. "plumbers in Austin") |
| `keywords` | `string` | `""` | Comma-separated keywords (alternative to searchQuery) |
| `maxLeads` | `integer` | `50` | Maximum number of lead records to collect (max: 10,000) |
| `maxPages` | `integer` | `10` | Max pages to crawl per domain when deep extraction is enabled |
| `extractDeep` | `boolean` | `false` | Crawl deeper into each domain to find more contact pages |
| `includePhones` | `boolean` | `true` | Extract phone numbers alongside emails |
| `includeSocial` | `boolean` | `true` | Extract LinkedIn, Twitter, Facebook, Instagram, and other social links |
| `proxyConfiguration` | `object` | Apify Proxy | Proxy config to avoid IP blocking (recommended: RESIDENTIAL proxies) |

#### Input examples

**Option 1: Direct URLs**

```json
{
  "startUrls": [
    { "url": "https://example-company.com" },
    { "url": "https://another-business.com/contact" }
  ],
  "maxLeads": 100,
  "includePhones": true
}
```

**Option 2: Search Query (find leads from Google)**

```json
{
  "searchQuery": "real estate agents in San Francisco",
  "maxLeads": 200,
  "extractDeep": true,
  "includeSocial": true
}
```

**Option 3: Bulk keywords**

```json
{
  "keywords": "dentist, dental clinic, orthodontist",
  "maxLeads": 500,
  "extractDeep": true
}
```

***

### 📤 Output Fields

Each lead record contains:

| Field | Type | Description |
|-------|------|-------------|
| `url` | `string` | Source URL where lead was found |
| `companyName` | `string` | Company or business name (from meta tags / title) |
| `description` | `string` | Meta description or business description |
| `emails` | `string[]` | All discovered email addresses |
| `phones` | `string[]` | All discovered phone numbers (if enabled) |
| `socialLinks` | `object[]` | Social media URLs with platform name |
| `address` | `string` | Physical address (if found in structured data) |
| `crawledAt` | `string` | ISO timestamp of extraction |

#### Sample output

```json
[
  {
    "url": "https://example-company.com/contact",
    "companyName": "Example Company Inc.",
    "description": "Leading provider of widgets and gadgets since 1999.",
    "emails": ["info@example-company.com", "support@example-company.com"],
    "phones": ["+15551234567"],
    "socialLinks": [
      { "platform": "LinkedIn", "url": "https://linkedin.com/company/example" },
      { "platform": "Twitter/X", "url": "https://twitter.com/example" }
    ],
    "address": "123 Main St, San Francisco, CA 94102",
    "crawledAt": "2026-05-30T12:00:00.000Z"
  }
]
```

***

### 💰 Pricing

| Plan | Credits per run | What you get |
|------|----------------|-------------|
| **Starter** | **$20** | Up to 100 leads, basic extraction |
| **Professional** | **$35** | Up to 500 leads, deep extraction, social + phones |
| **Enterprise** | **$50** | Up to 10,000 leads, full deep crawl, priority support |

Pricing is per run. Runs are charged based on compute units consumed. Most runs complete within 2–10 minutes depending on `maxLeads` and `extractDeep` settings.

***

### 🎯 Common Use Cases

1. **Sales Prospecting** — Build targeted lead lists from competitor websites or industry directories
2. **Recruitment** — Find contact info for companies in specific locations or sectors
3. **Market Research** — Gather competitive intelligence and business data
4. **Partnership Outreach** — Discover partnership opportunities with relevant businesses
5. **Email Marketing** — Build permission-based email lists from public websites

***

### 🔧 How It Works

1. **Accepts** your target URLs or search queries
2. **Navigates** each page using a real browser (Playwright) — renders JavaScript, handles SPAs
3. **Extracts** emails via regex patterns, phone numbers, social links, and business metadata
4. **Optionally deep-crawls** the domain to find contact/about pages
5. **Deduplicates** and delivers clean, structured lead data to your dataset

***

### ⚠️ Best Practices

- **Use proxy rotation** — Enable Apify residential proxies for SERP scraping
- **Set realistic maxLeads** — Start with 50–100 to test, then scale up
- **Deep extraction** works best on well-structured business websites
- **Combine with searchQuery** for the most powerful lead generation — Google finds businesses, we extract their contacts

***

### 📄 License

MIT

# Actor input Schema

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

List of website URLs to scrape for lead data (emails, phones, social links).

## `searchQuery` (type: `string`):

A Google search query to find leads. If provided, the actor will perform a search and extract leads from results.

## `keywords` (type: `string`):

Comma-separated keywords to filter or search for leads (alternative to searchQuery).

## `maxLeads` (type: `integer`):

Maximum number of lead records to collect.

## `maxPages` (type: `integer`):

Maximum pages to crawl per domain when deep-extracting emails.

## `extractDeep` (type: `boolean`):

If enabled, crawl multiple pages on each domain to find more leads (slower but more thorough).

## `includePhones` (type: `boolean`):

Extract phone numbers alongside emails.

## `includeSocial` (type: `boolean`):

Extract social media profile links (LinkedIn, Twitter, Facebook, Instagram, etc.).

## `proxyConfiguration` (type: `object`):

Apify proxy configuration to avoid IP blocking.

## Actor input object example

```json
{
  "startUrls": [],
  "maxLeads": 50,
  "maxPages": 10,
  "extractDeep": false,
  "includePhones": true,
  "includeSocial": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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": [],
    "searchQuery": "",
    "keywords": "",
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("oneary/lead-generator").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": [],
    "searchQuery": "",
    "keywords": "",
    "proxyConfiguration": { "useApifyProxy": True },
}

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

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": [],
  "searchQuery": "",
  "keywords": "",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call oneary/lead-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=oneary/lead-generator",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Lead Generator — B2B Email Finder & Contact Prospecting",
        "description": "Find B2B leads from any website: extract emails, phone numbers, and social profiles. Supports domain lists, Google search integration, and CSV export. Built for sales teams and lead enrichment.",
        "version": "1.0",
        "x-build-id": "lezlQ4wyMSpKDfJKn"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/oneary~lead-generator/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-oneary-lead-generator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/oneary~lead-generator/runs": {
            "post": {
                "operationId": "runs-sync-oneary-lead-generator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/oneary~lead-generator/run-sync": {
            "post": {
                "operationId": "run-sync-oneary-lead-generator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "startUrls": {
                        "title": "Start URLs",
                        "type": "array",
                        "description": "List of website URLs to scrape for lead data (emails, phones, social links).",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "searchQuery": {
                        "title": "Search Query",
                        "type": "string",
                        "description": "A Google search query to find leads. If provided, the actor will perform a search and extract leads from results."
                    },
                    "keywords": {
                        "title": "Keywords",
                        "type": "string",
                        "description": "Comma-separated keywords to filter or search for leads (alternative to searchQuery)."
                    },
                    "maxLeads": {
                        "title": "Max Leads",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of lead records to collect.",
                        "default": 50
                    },
                    "maxPages": {
                        "title": "Max Pages Per Domain",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum pages to crawl per domain when deep-extracting emails.",
                        "default": 10
                    },
                    "extractDeep": {
                        "title": "Deep Extraction",
                        "type": "boolean",
                        "description": "If enabled, crawl multiple pages on each domain to find more leads (slower but more thorough).",
                        "default": false
                    },
                    "includePhones": {
                        "title": "Include Phone Numbers",
                        "type": "boolean",
                        "description": "Extract phone numbers alongside emails.",
                        "default": true
                    },
                    "includeSocial": {
                        "title": "Include Social Media Links",
                        "type": "boolean",
                        "description": "Extract social media profile links (LinkedIn, Twitter, Facebook, Instagram, etc.).",
                        "default": true
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Apify proxy configuration to avoid IP blocking.",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ]
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
