# B2B Lead Finder & Client Opportunity Matcher (Laya & JEV AI) (`eternallabs/b2b-lead-finder-client-opportunity-matcher-laya-jev-ai`) Actor

Find local and online businesses that need your services. Scan websites for tech gaps, extract verified emails and phone numbers, and score sales readiness.

- **URL**: https://apify.com/eternallabs/b2b-lead-finder-client-opportunity-matcher-laya-jev-ai.md
- **Developed by:** [Jona](https://apify.com/eternallabs) (community)
- **Stats:** 2 total users, 1 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

## Business Opportunity Finder — AI Lead Generation

> **Find businesses that are likely to need your service, understand why they need it, and get the exact information to contact them.**

**Business Opportunity Finder** is a production-ready Apify Actor that transforms generic business searches into qualified, pitch-ready B2B sales leads.

Instead of outputting raw, unstructured directories, it autonomously discovers local businesses, inspects their websites, analyzes their digital tech stacks, extracts verified public contact details, calculates explainable opportunity and data quality scores, and synthesizes tailored sales pitches with AI.

***

### 🌟 Why This Actor Is Different

Most business scrapers merely dump raw phone numbers and addresses into a spreadsheet. Sales teams and agency owners are still forced to manually click through each website, spot broken designs or missing features, and write pitches by hand.

This Actor automates the complete qualification pipeline:

```
BUSINESS SEARCH
      ↓
BUSINESS METADATA (Name, Location, Phone, Reviews)
      ↓
WEBSITE DISCOVERY & HTTP INSPECTION
      ↓
TECH STACK DETECTION (CMS, Ecommerce, Booking, Analytics, Live Chat)
      ↓
OPPORTUNITY SIGNAL DETECTION (No SSL, Archaic Code, Broken Mobile, Missing Booking/Ordering)
      ↓
PUBLIC CONTACT ENRICHMENT (Emails, Direct Phones, Contact Form, Social Media Profiles)
      ↓
DATA QUALITY & OPPORTUNITY SCORING (Distinct 0–100 Scores)
      ↓
AI SALES QUALIFICATION & CUSTOM OUTREACH PITCH
      ↓
READY-TO-USE SALES LEAD DATA (JSON / CSV / CRM Ready)
```

***

### 👥 Who Should Use It?

1. **Web Development Agencies & Freelancers**: Target businesses with outdated websites, no SSL, non-responsive mobile designs, or no online presence at all.
2. **SEO Specialists & Marketers**: Find local businesses with missing title tags, absent meta descriptions, no H1 structure, or weak organic presence.
3. **AI Automation Agencies (AAA)**: Identify companies lacking 24/7 customer chat, automated booking systems, or automated inquiry workflows.
4. **B2B Appointment & Booking Integrators**: Discover restaurants lacking online reservations or clinics without digital scheduling.
5. **E-Commerce & Digital Ordering Consultants**: Pitch turnkey Shopify, WooCommerce, or pickup/delivery ordering systems to retail shops and restaurants.
6. **Lead Generation & Cold Outreach Teams**: Feed rich, personalized lead intelligence into cold email sequences and CRM pipelines (HubSpot, Close, Instantly, Smartlead).

***

### 🚀 Example Use Cases

- **"Restaurants in London needing Web Development & Online Booking"**
  - Searches for restaurants in London, checks whether they have modern responsive websites, flags outdated copyright dates (e.g., 2018), detects lack of OpenTable/Resy/SevenRooms, extracts contact email (`bookings@...`), and drafts a tailored pitch.
- **"Dentists & Clinics in Manchester needing AI Chat & Automated Scheduling"**
  - Identifies clinics without Calendly/Acuity or live chat assistants, providing direct cold outreach copy offering an automated front-desk assistant.
- **"Retail Boutiques in Berlin needing E-Commerce Storefronts"**
  - Flags brick-and-mortar merchants with no shopping cart or checkout integration.

***

### ⚙️ Input Parameters

The Actor is configured through an intuitive UI in the Apify Console.

| Field | Type | Default | Description |
|---|---|---|---|
| `searchQueries` | Array of strings | `["restaurants"]` | Business categories or keywords (e.g. `restaurants`, `dentists`, `lawyers`). |
| `locations` | Array of strings | `["London, UK"]` | Geographic targets (e.g. `London, UK`, `Manchester, UK`, `Berlin, Germany`). |
| `country` | String | `United Kingdom` | Country filter to focus geographic discovery. |
| `serviceToSell` | Select / String | `web development` | The service you are pitching: `web development`, `SEO`, `AI automation`, `digital marketing`, `mobile app development`, `online booking integration`, `ecommerce solutions`, `reputation management`. |
| `maxResults` | Integer | `50` | Maximum number of qualified leads to produce (1 to 500). |
| `analyzeWebsite` | Boolean | `true` | When true, fetches and parses the business website. |
| `findContacts` | Boolean | `true` | Extracts public emails, direct telephone numbers, and contact page links. |
| `aiQualification` | Boolean | `true` | Uses AI to synthesize findings and generate tailored cold outreach pitches. |
| `includeSocialProfiles` | Boolean | `true` | Discovers LinkedIn, Instagram, Facebook, and X/Twitter profiles. |
| `minimumRating` | Number | `0.0` | Minimum customer review rating filter (0.0 to 5.0). |
| `minimumReviews` | Integer | `0` | Minimum number of customer reviews. |
| `crawlDepth` | Integer | `2` | `1` inspects the homepage; `2` also crawls the `/contact` or `/about` page to uncover hidden emails. |
| `concurrency` | Integer | `5` | Concurrent website analysis workers (1 to 20). |
| `language` | String | `"en"` | Language code for search results and pitches. |
| `discoverySource` | Select | `"osm"` | Discovery engine: `osm` (OpenStreetMap Overpass - built-in, free, zero keys needed), `apify_google_places` (delegates to an Apify Google Maps Actor), or `direct_seeds`. |
| `aiApiKey` | Secret String | `null` | API key for AI qualification (supports OpenAI, Gemini, Groq, Anthropic, OpenRouter, DeepSeek). Can also be set via `AI_API_KEY` env var. |
| `aiProvider` | Select | `"openai"` | AI provider (`openai`, `gemini`, `anthropic`, `groq`, `openrouter`, `deepseek`). |
| `aiModel` | String | `"gpt-4o-mini"` | Model identifier (e.g., `gpt-4o-mini`, `gemini-2.0-flash`, `claude-3-5-haiku-20241022`). |

***

### 📊 Output Schema

Each item pushed to the Apify dataset contains:

#### 1. Business Information

- `business_name`: Commercial name.
- `category`: Business niche or category.
- `address`: Physical street address.
- `city`, `country`, `postal_code`: Location details.
- `phone`: Primary telephone number.
- `website`: Resolved website URL.
- `business_rating`: Average customer review rating.
- `review_count`: Total customer reviews.
- `source_url`: Discovery source profile URL.

#### 2. Website Information

- `website_found`: Boolean indicating website existence.
- `website_url`: Final redirected homepage URL.
- `website_status`: HTTP response status code (e.g. `200`, `404`).
- `ssl_enabled`: HTTPS security certificate status.
- `mobile_friendly`: Mobile viewport tag validation.
- `website_title`: HTML `<title>` tag.
- `website_description`: Meta description content.
- `technology_stack`: Array of all detected tools and libraries.
- `cms`: Detected CMS (e.g. `WordPress`, `Shopify`, `Wix`, `Squarespace`, `Webflow`).
- `ecommerce_platform`: Platform detected (e.g. `Shopify`, `WooCommerce`, `Magento`).
- `analytics`: Array of analytics suites (`Google Analytics 4`, `Meta Pixel`, `Hotjar`, etc.).
- `booking_system`: Detected booking tool (`Calendly`, `OpenTable`, `Resy`, `Fresha`, etc.).
- `payment_system`: Payment gateways (`Stripe`, `PayPal`, `Square`, `Klarna`, etc.).
- `social_links`: Key-value map of LinkedIn, Instagram, Facebook, and Twitter/X profiles.

#### 3. Contact Details

- `email`: Primary verified business contact email.
- `contact_page`: URL of the contact or inquiry form.
- `linkedin`, `instagram`, `facebook`, `twitter_x`: Direct social profile links.
- `other_public_contact_information`: Complete list of secondary emails and alternate numbers.

#### 4. Opportunity & AI Analysis

- `opportunity_score`: Normalized score (0 to 100) reflecting urgency of service need.
- `opportunity_level`: Categorical rating (`low`, `medium`, `high`).
- `data_quality_score`: Record completeness score (0 to 100).
- `data_quality`: Completeness category (`low`, `medium`, `high`).
- `why_this_is_a_lead`: Factual explanation of why this business represents an immediate opportunity.
- `detected_problems`: Concrete observed issues (e.g. `["Missing HTTPS / SSL", "Outdated website (copyright 2019)", "No online reservation system"]`).
- `recommended_service`: Tailored service offering to pitch.
- `recommended_pitch`: Ready-to-send personalized outreach opening.
- `confidence`: Confidence score (0.0 to 1.0).
- `ai_summary`: Optional executive summary.
- `signals`: Detailed breakdown of individual weighted signals.

#### 5. Metadata

- `source`: Discovery source engine (`osm`, `apify_google_places`, `direct_seeds`).
- `scraped_at`: ISO 8601 UTC timestamp.
- `errors`: Non-fatal warning messages encountered during enrichment.

***

### 🎯 How Scoring Works

#### A. Business Opportunity Score (0–100)

The opportunity score measures **need and sales urgency**:

- **No Website**: +35 points (Prime candidate for a ground-up build)
- **No SSL / Insecure HTTP**: +25 points (Urgent security risk)
- **Not Mobile-Friendly**: +25 points (Fails Google mobile index)
- **Outdated Codebase (Copyright ≤ 2021 / Archaic tags)**: +20 points
- **No Online Booking (Appointment businesses)**: +25 points
- **No Table Booking or Online Ordering (Restaurants)**: +25 points
- **No E-Commerce Storefront (Retail merchants)**: +20 points
- **Missing AI / Live Chat (When pitching AI automation)**: +20 points
- **Weak SEO (Missing title/description/H1)**: +20 points
- **Slow Response Latency (> 2.5s)**: +15 points
- **Missing Social Presence**: +15 points
- **Sub-optimal Customer Rating (< 3.8/5.0)**: +20 points

#### B. Data Quality Score (0–100)

Calculated completely independently from Opportunity:

- Business Name present: +20 pts
- Street Address / City present: +15 pts
- Direct Phone Number verified: +20 pts
- Working Website (HTTP 200): +15 pts
- Business Email verified: +20 pts
- Social Media profile verified: +10 pts

> **Example**: A business with an address, verified phone, and verified email has a **Data Quality Score of 95**, but if their website is modern and fast, their **Opportunity Score might be 20**. You get clean data without false positives!

***

### 🤖 AI Qualification & Strict Factual Grounding

When `aiQualification: true` is enabled and an API key is provided, the Actor invokes an LLM to evaluate the evidence:

- **Strict Factual Guardrails**: The prompt explicitly enforces:
  - *Never invent or hallucinate facts.*
  - *Only use verified evidence supplied in the scrape.*
  - *Distinguish observed facts from recommendations.*
  - *If evidence is insufficient, explicitly state so.*
- **Multi-Provider Support**: Supports OpenAI (`gpt-4o-mini`), Google Gemini (`gemini-2.0-flash`), Anthropic Claude (`claude-3-5-haiku-20241022`), Groq, OpenRouter, and DeepSeek.
- **Fail-Safe Fallback**: If an AI request times out or is rate limited, the Actor automatically falls back to deterministic rule scoring without interrupting the run.

***

### 💰 Cost Considerations & Monetization

#### Compute Cost

- Efficient async HTTP crawling (using `httpx` + `BeautifulSoup`) consumes minimal memory (~256 MB to 512 MB).
- No heavy headless browsers are spun up for standard HTTP inspection.
- Total compute cost per 1,000 leads: **~$0.10 - $0.25**.

#### AI Cost

- Optimized prompts utilizing ultra-efficient models like `gpt-4o-mini` or `gemini-2.0-flash` cost approximately **$0.0003 per lead** (~$0.30 per 1,000 leads).

#### Apify Pay-Per-Event (PPE) Readiness

- The Actor is instrumented with `Actor.charge(event_name="qualified-lead", count=1)`.
- You only charge users for **successfully produced qualified leads**.
- Suggested pricing model on Apify Store: **$0.03 – $0.08 per qualified lead**.

***

### 🔒 Responsible Scraping & Security

- **Zero Hard-coded Secrets**: All API keys and tokens are loaded strictly from environment variables or encrypted Actor secrets.
- **Public Data Only**: Only publicly displayed business information, canonical websites, and public contact pages are crawled.
- **Rate-Limiting & Backoff**: Requests employ randomized delays, exponential backoff, and respectful user agents.

***

### 🛠️ Local Development & Testing

#### 1. Setup Virtual Environment

```bash
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install pytest pytest-asyncio
```

#### 2. Run Test Suite

```bash
pytest tests -v
```

#### 3. Run Actor Locally

```bash
apify run
```

***

### 📄 License

Apache-2.0 License.

# Changelog

This Actor's version history is a separate document: https://apify.com/eternallabs/b2b-lead-finder-client-opportunity-matcher-laya-jev-ai/changelog.md

# Actor input Schema

## `searchQueries` (type: `array`):

Categories or keywords of businesses to target (e.g., 'restaurants', 'dentists', 'real estate agencies', 'lawyers').

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

Locations, cities, or regions to search within (e.g., 'London, UK', 'Manchester, UK', 'New York, USA').

## `country` (type: `string`):

Optional country filter to focus geographic search.

## `serviceToSell` (type: `string`):

What your business offers (e.g. 'web site, tech', 'web development', 'online booking integration', 'SEO', 'e-commerce'). The Actor matches prospect vulnerabilities to your offering and calculates their conversion probability.

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

Maximum number of qualified business leads to collect and analyze.

## `analyzeWebsite` (type: `boolean`):

Fetch and analyze the business website, detecting CMS, ecommerce, booking, SSL, mobile-friendliness, and performance.

## `findContacts` (type: `boolean`):

Extract publicly visible emails, telephone numbers, and contact forms from websites and business profiles.

## `aiQualification` (type: `boolean`):

Use AI to evaluate signals, synthesize problem points, and generate tailored sales pitches based strictly on verified facts.

## `includeSocialProfiles` (type: `boolean`):

Identify LinkedIn, Instagram, Facebook, and X/Twitter profiles associated with the business.

## `minimumRating` (type: `number`):

Filter businesses by minimum review rating (0.0 to 5.0).

## `minimumReviews` (type: `integer`):

Filter businesses by minimum number of customer reviews.

## `crawlDepth` (type: `integer`):

Depth of website crawling. Depth 1 inspects the homepage; Depth 2 also discovers and inspects contact/about pages.

## `concurrency` (type: `integer`):

Number of concurrent website analysis workers.

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

Language code for search results and output pitches.

## `discoverySource` (type: `string`):

Source for local business discovery. 'osm' uses OpenStreetMap Overpass (built-in, free, no key needed). 'apify\_google\_places' delegates to an Apify Google Maps actor. 'direct\_seeds' processes direct seed lists.

## `apifyGooglePlacesActorId` (type: `string`):

Apify Actor ID used if discoverySource is 'apify\_google\_places'.

## `seedBusinesses` (type: `array`):

Direct list of business objects with name, website, and city to analyze directly.

## `aiApiKey` (type: `string`):

API key for AI qualification (OpenAI, Gemini, Groq, OpenRouter, Anthropic, or DeepSeek). Can also be provided via the AI\_API\_KEY environment variable.

## `aiProvider` (type: `string`):

Provider for AI qualification and pitch generation.

## `aiModel` (type: `string`):

Model ID to use for lead qualification (e.g., 'gpt-4o-mini', 'gemini-2.0-flash', 'claude-3-5-haiku-20241022', 'llama-3.3-70b-versatile').

## `aiBaseUrl` (type: `string`):

Optional custom endpoint for OpenAI-compatible proxies or local models (e.g. Ollama, vLLM).

## Actor input object example

```json
{
  "searchQueries": [
    "restaurants"
  ],
  "locations": [
    "London, UK"
  ],
  "country": "United Kingdom",
  "serviceToSell": "web site, tech",
  "maxResults": 50,
  "analyzeWebsite": true,
  "findContacts": true,
  "aiQualification": true,
  "includeSocialProfiles": true,
  "minimumRating": 0,
  "minimumReviews": 0,
  "crawlDepth": 2,
  "concurrency": 5,
  "language": "en",
  "discoverySource": "osm",
  "apifyGooglePlacesActorId": "compass/crawler-google-places",
  "seedBusinesses": [],
  "aiProvider": "openai",
  "aiModel": "gpt-4o-mini"
}
```

# Actor output Schema

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

Complete dataset of qualified business leads with contacts, technology stack, and opportunity scores.

## `csv` (type: `string`):

Downloadable CSV spreadsheet containing all qualified prospects.

## `summary` (type: `string`):

Run metrics detailing total discovered businesses, high/medium potential breakdown, and list conversion rate.

# 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 = {
    "searchQueries": [
        "restaurants"
    ],
    "locations": [
        "London, UK"
    ],
    "serviceToSell": "web site, tech"
};

// Run the Actor and wait for it to finish
const run = await client.actor("eternallabs/b2b-lead-finder-client-opportunity-matcher-laya-jev-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 = {
    "searchQueries": ["restaurants"],
    "locations": ["London, UK"],
    "serviceToSell": "web site, tech",
}

# Run the Actor and wait for it to finish
run = client.actor("eternallabs/b2b-lead-finder-client-opportunity-matcher-laya-jev-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 '{
  "searchQueries": [
    "restaurants"
  ],
  "locations": [
    "London, UK"
  ],
  "serviceToSell": "web site, tech"
}' |
apify call eternallabs/b2b-lead-finder-client-opportunity-matcher-laya-jev-ai --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,eternallabs/b2b-lead-finder-client-opportunity-matcher-laya-jev-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/c9MN1QJHN06T8qb68/builds/lpEG69SY8PKpgw5rB/openapi.json
