# B2B Lead Enricher: Emails, Tech Stack & AI Outreach (`tefani/b2b-lead-enrichment-engine`) Actor

Discovers companies from search queries, URLs, and pasted lists; extracts website contacts and structured business data; checks MX, SPF, and DMARC; detects technology and growth opportunities; scores leads and creates multichannel outreach.

- **URL**: https://apify.com/tefani/b2b-lead-enrichment-engine.md
- **Developed by:** [Taha FIRAT](https://apify.com/tefani) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.80 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

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

## B2B Lead Intelligence: Discovery, Verified Contacts & Multichannel Outreach

Find companies from search queries, direct websites, or pasted lists, then enrich their public website data into a scored, CRM-ready lead record. This Apify Actor combines company discovery, Cloudflare email decoding, Schema.org decision-maker extraction, MX/SPF/DMARC checks, 35+ technology signals, and personalized email, LinkedIn, and WhatsApp copy.

### What it does

| Capability | Basic contact-info scraper | This Actor |
|---|---:|---:|
| Discover company sites from search queries | Usually no | Yes; uses asynchronous search-provider fallback |
| Extract public website emails | Yes | Yes, including Cloudflare and common obfuscation |
| Identify business details and decision makers | Limited | JSON-LD, team pages, and public contact clues |
| Verify mail-domain posture | Usually no | MX, SPF, DMARC, and common mail-provider classification |
| Detect technology and sales gaps | Usually no | 35+ CMS, analytics, CRM, chat, booking, and payment signals |
| Create outreach copy | Usually no | Zero-API-cost heuristics or optional OpenAI-compatible LLM |
| Export for sales engagement and CRM | Limited | Flat `crm_*` fields plus full research record |

This Actor can complement Google Maps Scraper and website-email workflows. It is not a substitute for validating lawful data use, consent, or the terms of external search providers.

### Inputs

Supply one or more sources. Direct URLs and pasted text are combined; optional search queries discover additional company websites.

```json
{
  "startUrls": [
    { "url": "https://example-business.com" }
  ],
  "searchQueries": ["dental clinics in Austin TX"],
  "maxSearchResultsPerQuery": 15,
  "rawTextOrCsvDomains": "contact@example-business.com, https://another-business.org",
  "defaultCountryCode": "US",
  "maxContactPagesPerDomain": 4,
  "maxConcurrency": 10,
  "verifyEmailMxAndDns": true,
  "onlyReturnWithEmails": false,
  "minimumLeadScore": 0,
  "targetAgencyService": "Full-Stack Growth & AI Automation",
  "enableAiEnrichment": true,
  "outreachLanguage": "English"
}
```

`searchQueries` accepts business intent and location terms such as `"dental clinics in Austin TX"` or `"software companies Istanbul"`. `rawTextOrCsvDomains` accepts URLs, bare domains, and email addresses; common directory and social-network domains are excluded. `defaultCountryCode` helps format local phone numbers as E.164.

### Enrichment and pricing

- **Heuristic enrichment has no LLM API charge.** Leave `llmApiKey` blank to generate deterministic summaries and outreach copy locally.
- **Optional LLM:** Configure `llmApiKey`, `llmProviderBaseUrl`, and `llmModel` to use an OpenAI-compatible model. Only compact company, technology, and page-context signals are sent.
- **Email DNS:** MX, SPF, and DMARC are checked asynchronously and cached per domain. DNS records indicate domain configuration, not that an individual mailbox will accept mail.
- **Zero-Waste filter:** `onlyReturnWithEmails` skips records without a deliverable email, so those records are not pushed to the dataset and do not trigger per-item events. Actor compute or other platform costs may still apply.
- **Pay-Per-Event:** Any event price is configured by the Actor publisher in Apify Console. The Actor observes the event charge limit and stops starting new processing when it is reached. See the run's actual configured price before execution.

### Outputs

The `instantly_smartlead_ready` dataset view presents flat `crm_*` fields for campaign tools. The `overview` view retains source, decision-maker, DNS, technology, opportunity, and scoring details.

```json
{
  "crm_email": "jane.doe@example-business.com",
  "crm_first_name": "Jane",
  "crm_last_name": "Doe",
  "crm_job_title": "Founder",
  "crm_company": "Example Business",
  "crm_website": "https://example-business.com/",
  "crm_phone_e164": "+14155550123",
  "crm_whatsapp_url": "https://wa.me/14155550123",
  "crm_location": "Austin, TX, US",
  "crm_lead_score": 90,
  "crm_lead_grade": "A+",
  "crm_subject_line": "quick question about Example Business's growth",
  "crm_icebreaker": "Hi Jane — I noticed the opportunity to improve your store's retargeting. We help teams scale qualified pipeline through automation and paid acquisition. Would it be useful to compare notes?",
  "crm_pain_point": "The store is missing a retargeting opportunity.",
  "crm_linkedin_dm": "I came across Example Business's Shopify presence. Retargeting could be an opportunity. Open to connecting?",
  "crm_whatsapp_opener": "Hi, I noticed an opportunity around retargeting for Example Business. Open to a quick idea?",
  "domain": "example-business.com",
  "discovery_source": "search_query",
  "search_query_used": "online stores Austin TX",
  "primary_email": "jane.doe@example-business.com",
  "primary_email_deliverability": "deliverable",
  "email_host_provider": "Google Workspace",
  "email_security_spf_dmarc": "strong (SPF + DMARC)",
  "decision_makers": [
    {
      "full_name": "Jane Doe",
      "first_name": "Jane",
      "last_name": "Doe",
      "job_title": "Founder",
      "inferred_email": "jane.doe@example-business.com",
      "linkedin_url": null,
      "source": "json_ld"
    }
  ],
  "phone_numbers_e164": ["+14155550123"],
  "tech_stack": {
    "cms_or_ecommerce": ["Shopify"],
    "analytics_and_pixels": ["Google Tag Manager"],
    "crm_and_marketing_tools": [],
    "chat_and_booking_widgets": [],
    "payment_gateways": ["Stripe"],
    "missing_pixel_or_tool_gaps": ["Missing Meta Pixel or TikTok Pixel for e-commerce retargeting"],
    "agency_opportunities": ["Paid Ads Pitch: E-commerce store running without Meta/TikTok retargeting pixels"],
    "primary_agency_pitch_angle": "Paid Ads Pitch: E-commerce store running without Meta/TikTok retargeting pixels"
  },
  "qualification": {
    "score": 90,
    "grade": "A+",
    "buying_signals": ["Deliverable corporate email found", "Decision maker or personal email identified"],
    "score_breakdown": {
      "deliverable_email": 30,
      "direct_phone_or_whatsapp": 15,
      "decision_maker_identified": 15,
      "tech_and_social_footprint": 20,
      "monetizable_agency_gaps": 10
    },
    "qualification_reason": "Public company and technology signals indicate an actionable opportunity."
  },
  "ai_business_category": "OnlineStore",
  "ai_company_summary": "An online store serving customers in Austin.",
  "ai_decision_maker_pain_point": "The store may be missing opportunities to retarget visitors.",
  "ai_cold_email_subject": "quick question about Example Business's growth",
  "ai_cold_email_icebreaker": "Hi Jane — I noticed the opportunity to improve your store's retargeting. We help teams scale qualified pipeline through automation and paid acquisition. Would it be useful to compare notes?",
  "ai_cold_email_ps_hook": "P.S. I can share a short audit focused on Shopify.",
  "ai_linkedin_connection_note": "I came across Example Business's Shopify presence. Retargeting could be an opportunity. Open to connecting?",
  "ai_whatsapp_opener": "Hi, I noticed an opportunity around retargeting for Example Business. Open to a quick idea?",
  "scraped_pages_count": 3,
  "scraped_urls": ["https://example-business.com/", "https://example-business.com/about"],
  "scrape_status": "success"
}
```

Output fields depend on public page content and DNS responses. `score_breakdown` shows the contribution of each score category. Search results and inferred decision-maker details should be reviewed before outreach.

### Suggested workflow

1. Provide seed URLs, pasted company lists, or search queries.
2. Run the Actor and review the `overview` and `instantly_smartlead_ready` dataset views.
3. Export accepted leads to Instantly, Smartlead, Clay, a CRM, Make, or n8n.
4. Review contact details and comply with applicable privacy, platform, and anti-spam requirements.

### Local development

Python 3.11+ is recommended.

```bash
pip install -r requirements.txt
python -m src
pytest -q
```

Publish with `apify login` and `apify push` after reviewing the Actor input, output schema, and Pay-Per-Event configuration in Apify Console.

# Actor input Schema

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

Optional direct company website URLs or domains.

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

Find company websites by search, for example dental clinics in Austin TX.

## `maxSearchResultsPerQuery` (type: `integer`):

Maximum number of company results discovered for each search query.

## `rawTextOrCsvDomains` (type: `string`):

Paste mixed text, CSV rows, websites, or email addresses; website domains will be extracted.

## `defaultCountryCode` (type: `string`):

Country used to normalize local phone numbers to E.164.

## `maxContactPagesPerDomain` (type: `integer`):

Maximum internal contact, about, team, pricing, careers, and sitemap links to inspect.

## `maxConcurrency` (type: `integer`):

Number of domains processed concurrently.

## `requestTimeoutSecs` (type: `integer`):

Timeout applied to each website request.

## `verifyEmailMxAndDns` (type: `boolean`):

Check email-domain MX, SPF, and DMARC DNS records asynchronously.

## `onlyReturnWithEmails` (type: `boolean`):

Skip dataset writes for companies without a deliverable business email.

## `minimumLeadScore` (type: `integer`):

Skip records with a lower deterministic lead score.

## `targetAgencyService` (type: `string`):

Service focus used to prioritize detected opportunities.

## `enableAiEnrichment` (type: `boolean`):

Use the configured optional LLM; otherwise deterministic zero-API-cost generation is used.

## `outreachLanguage` (type: `string`):

Language for generated summaries and outreach messages.

## `senderValueProposition` (type: `string`):

Your offer to connect detected company opportunities to relevant outreach.

## `llmApiKey` (type: `string`):

Leave blank for the zero-cost heuristic engine.

## `llmProviderBaseUrl` (type: `string`):

Base URL for OpenAI-compatible LLM providers.

## `llmModel` (type: `string`):

Model identifier for the configured provider.

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

Optional Apify proxy configuration.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://apify.com"
    }
  ],
  "maxSearchResultsPerQuery": 15,
  "rawTextOrCsvDomains": "",
  "defaultCountryCode": "US",
  "maxContactPagesPerDomain": 4,
  "maxConcurrency": 10,
  "requestTimeoutSecs": 20,
  "verifyEmailMxAndDns": true,
  "onlyReturnWithEmails": false,
  "minimumLeadScore": 0,
  "targetAgencyService": "Full-Stack Growth & AI Automation",
  "enableAiEnrichment": true,
  "outreachLanguage": "English",
  "senderValueProposition": "We help B2B and e-commerce brands scale qualified pipeline and conversion rates through AI automation and paid acquisition.",
  "llmProviderBaseUrl": "https://api.openai.com/v1",
  "llmModel": "gpt-4o-mini"
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset items with verified emails, tech stack, and CRM outreach fields.

## `runSummary` (type: `string`):

Markdown summary report of the run.

# 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://apify.com"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("tefani/b2b-lead-enrichment-engine").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://apify.com" }] }

# Run the Actor and wait for it to finish
run = client.actor("tefani/b2b-lead-enrichment-engine").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://apify.com"
    }
  ]
}' |
apify call tefani/b2b-lead-enrichment-engine --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,tefani/b2b-lead-enrichment-engine"
        }
    }
}
```

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/FYBMX3IT4EXCeelIJ/builds/bKDjaFENBkNjAU0ov/openapi.json
