# B2B-lead-generator (`kid1141/lead-gen-api`) Actor

🔍 Local Business Lead Generator
Extract verified business leads — emails, phones, and addresses — from any niche and location. Combines DuckDuckGo search with intelligent website crawling, contact page detection, and directory site extraction to deliver clean, scored leads ready for outreach.

- **URL**: https://apify.com/kid1141/lead-gen-api.md
- **Developed by:** [Asad Wani](https://apify.com/kid1141) (community)
- **Categories:** Lead generation, Automation, E-commerce
- **Stats:** 6 total users, 3 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.0001 / result

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Verified Lead Generation API for Apify Store

This project is a starting point for an **Apify Store actor** that finds business leads from public web search results and keeps only leads with visible verification signals.

### What it does

- Searches public web results for business-intent queries like `dentist in chicago`
- Visits each discovered website
- Extracts public contact signals such as email, phone, and contact form presence
- Optionally checks a likely contact or about page for stronger evidence
- Outputs leads with:
  - source URLs
  - verification flags
  - confidence score
  - extracted public contact details

### Why this can sell

Most lead tools overpromise and deliver low-trust junk. This actor is positioned around:

- **verification-first output**
- **transparent sourcing**
- **confidence scoring**
- **public-web compliance mindset**

That makes it more credible for agencies, sales teams, freelancers, and local SEO operators who care about quality over raw volume.

### Honest positioning

Do not market this as "100% genuine" or "guaranteed accurate". That claim will not hold up in the real world.

A much stronger Store angle is:

- "Public-web business leads with verification flags"
- "Lead generation API with source URLs and confidence score"
- "Local business lead finder with website-level contact verification"

### Suggested niche focus

You will likely make more money if you launch with a narrow promise first. Good starting niches:

- local service businesses
- medical and dental clinics
- agencies and consultants
- home services
- legal practices

You can later add vertical-specific enrichments once the base actor works.

### Input example

```json
{
  "queries": [
    "dentist in chicago",
    "roofing company in dallas"
  ],
  "maxResultsPerQuery": 10,
  "crawlContactPages": true,
  "requireWebsite": true,
  "requireEmailOrPhone": true,
  "minimumConfidenceScore": 55,
  "includeSocialLinks": true
}
````

### Output shape

Each dataset item includes fields like:

- `leadName`
- `website`
- `emails`
- `phones`
- `addressHints`
- `socialLinks`
- `sourceUrls`
- `verificationFlags`
- `confidenceScore`

### Recommended next upgrades

1. Add business deduplication by root domain and business name.
2. Add optional country and language targeting.
3. Add support for search-source adapters.
4. Add enrichment for structured contact pages, schema.org data, and business directories.
5. Add vertical templates for users who want ready-made queries.
6. Add rate limiting, retries, and more robust anti-block handling.

### Local run

```bash
npm install
npm start
```

### Apify Store launch advice

- Price on verified output quality, not unlimited scraping.
- Show sample results with source URLs.
- Be explicit that contacts are extracted from public pages.
- Offer filtering by confidence score.
- Start with one narrow use case in the Store title and description.

# Actor input Schema

## `queries` (type: `array`):

Business queries to search, for example 'dentist in chicago' or 'roofing company in dallas'.

## `maxResultsPerQuery` (type: `integer`):

Maximum number of search results to inspect for each query.

## `crawlContactPages` (type: `boolean`):

When enabled, the actor also checks likely contact/about pages for stronger verification.

## `requireWebsite` (type: `boolean`):

Only keep leads that resolve to a public website.

## `requireEmailOrPhone` (type: `boolean`):

Only keep leads that expose at least one direct contact signal.

## `minimumConfidenceScore` (type: `integer`):

Filter out weak matches below this threshold.

## `includeSocialLinks` (type: `boolean`):

Extract public social profile links from business websites.

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

Select proxies to be used by the Actor.

## Actor input object example

```json
{
  "queries": [
    "dentist in chicago",
    "roofing company in dallas"
  ],
  "maxResultsPerQuery": 20,
  "crawlContactPages": true,
  "requireWebsite": true,
  "requireEmailOrPhone": true,
  "minimumConfidenceScore": 60,
  "includeSocialLinks": 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 = {
    "queries": [
        "dentist in chicago",
        "roofing company in dallas"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kid1141/lead-gen-api").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 = { "queries": [
        "dentist in chicago",
        "roofing company in dallas",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("kid1141/lead-gen-api").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 '{
  "queries": [
    "dentist in chicago",
    "roofing company in dallas"
  ]
}' |
apify call kid1141/lead-gen-api --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "B2B-lead-generator",
        "description": "🔍 Local Business Lead Generator\nExtract verified business leads — emails, phones, and addresses — from any niche and location. Combines DuckDuckGo search with intelligent website crawling, contact page detection, and directory site extraction to deliver clean, scored leads ready for outreach.",
        "version": "0.0",
        "x-build-id": "zQcos5WLHIUMlgs0a"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/kid1141~lead-gen-api/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-kid1141-lead-gen-api",
                "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/kid1141~lead-gen-api/runs": {
            "post": {
                "operationId": "runs-sync-kid1141-lead-gen-api",
                "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/kid1141~lead-gen-api/run-sync": {
            "post": {
                "operationId": "run-sync-kid1141-lead-gen-api",
                "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",
                "required": [
                    "queries"
                ],
                "properties": {
                    "queries": {
                        "title": "Lead Search Queries",
                        "type": "array",
                        "description": "Business queries to search, for example 'dentist in chicago' or 'roofing company in dallas'.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxResultsPerQuery": {
                        "title": "Max Results Per Query",
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer",
                        "description": "Maximum number of search results to inspect for each query.",
                        "default": 20
                    },
                    "crawlContactPages": {
                        "title": "Crawl Contact/About Pages",
                        "type": "boolean",
                        "description": "When enabled, the actor also checks likely contact/about pages for stronger verification.",
                        "default": true
                    },
                    "requireWebsite": {
                        "title": "Require Website",
                        "type": "boolean",
                        "description": "Only keep leads that resolve to a public website.",
                        "default": true
                    },
                    "requireEmailOrPhone": {
                        "title": "Require Email Or Phone",
                        "type": "boolean",
                        "description": "Only keep leads that expose at least one direct contact signal.",
                        "default": true
                    },
                    "minimumConfidenceScore": {
                        "title": "Minimum Confidence Score",
                        "minimum": 0,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Filter out weak matches below this threshold.",
                        "default": 60
                    },
                    "includeSocialLinks": {
                        "title": "Include Social Links",
                        "type": "boolean",
                        "description": "Extract public social profile links from business websites.",
                        "default": true
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Select proxies to be used by the Actor."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
