# AI Company Lead Enrichment & Sales Intelligence (`fabri-lab/leads-data-scraper-ai`) Actor

Find company websites, social profiles, contact pages, emails, recent news, lead scores, sales angles, and outreach templates from company names or domains.

- **URL**: https://apify.com/fabri-lab/leads-data-scraper-ai.md
- **Developed by:** [Yusuf Barış](https://apify.com/fabri-lab) (community)
- **Categories:** AI, Jobs, Lead generation
- **Stats:** 4 total users, 2 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.00 / 1,000 enriched leads

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

## AI Company Lead Enrichment & Sales Intelligence

Turn company names, websites, or CSV lists into sales-ready B2B lead profiles. This Actor finds company websites, social media profiles, contact pages, public emails, recent news, website signals, lead scores, sales angles, and outreach templates in structured JSON.

It is built for lead generation, CRM enrichment, outbound sales, agency prospecting, market research, and AI / MCP workflows.

### What does this Actor do?

This Actor researches each company input and returns one structured dataset item per company. The result is designed for Apify datasets, API usage, automations, and AI agents that need predictable field names, confidence scores, warnings, and source URLs.

You can use it with:

- Company names only
- Websites or domains
- Company name + website pairs
- Public CSV URLs

For best speed and accuracy, provide the company website when available.

### Features

- Find official company websites from names or domains
- Find public social profiles: LinkedIn, Instagram, Facebook, X, YouTube, TikTok
- Find contact pages, about pages, demo pages, sales pages, and contact paths
- Extract public business emails and phone-like contact signals
- Find recent company news and announcements
- Detect website signals: pricing, careers, blog, docs, demo CTA, contact form
- Detect basic website stack signals: Shopify, WordPress, HubSpot
- Calculate a rule-based lead score from `0` to `100`
- Generate pain points and sales angles from public company signals
- Generate cold email and LinkedIn outreach templates using your own offer details
- Support English and Turkish outreach templates
- Optionally rewrite outreach with your own OpenRouter API key and selected model
- Return confidence, completeness, warnings, sources, and charge metadata

### Use cases

- B2B lead enrichment
- Sales intelligence
- Cold email personalization
- CRM enrichment
- Agency prospecting
- Market research
- Competitor research
- Finding companies with weak website or contact signals
- Enriching CSV company lists
- AI agent and Apify MCP workflows

### Input

Use the Apify input form or JSON input. In the form, add companies under `Companies`, then fill optional enrichment and outreach settings.

At least one of `companies` or `csvUrl` should be provided.

| Field | Type | Required | Description |
|---|---|---:|---|
| `companies` | array | No | Company list to enrich. Each item can include `companyName`, `website`, and `country`. |
| `companies[].companyName` | string | No | Company name to research. Example: `Ahrefs`. |
| `companies[].website` | string | No | Company website or domain. Example: `https://ahrefs.com`. |
| `companies[].country` | string | No | Optional country or market context. Example: `United States`. |
| `csvUrl` | string | No | Public CSV URL with `companyName`, `website`, and `country` columns. |
| `maxCompanies` | integer | No | Maximum unique companies to process. Default: `100`. Hard cap: `5000`. |
| `findSocialProfiles` | boolean | No | Find public LinkedIn, Instagram, Facebook, X, YouTube, and TikTok profiles. Default: `true`. |
| `findContactPages` | boolean | No | Find contact, about, demo, sales, and similar pages. Default: `true`. |
| `findEmails` | boolean | No | Extract public emails from crawled website pages. Default: `true`. |
| `findRecentNews` | boolean | No | Search for recent company news and announcements. Default: `true`. |
| `generateOutreach` | boolean | No | Generate cold email and LinkedIn message templates. Default: `true`. |
| `senderName` | string | No | Sender name used in the email signature. If empty, `{{senderName}}` stays as a placeholder. |
| `senderCompany` | string | No | Your company or agency name used in outreach copy. |
| `offerDescription` | string | No | What you sell or offer. If empty, outreach keeps `{{yourOffer}}` as a placeholder. |
| `targetPainPoint` | string | No | The specific problem your offer solves. If empty, the Actor uses detected company signals only as context. |
| `callToAction` | string | No | Optional custom CTA. Example: `Would it make sense to send a quick example?` |
| `language` | string | No | Outreach language: `en` or `tr`. Default: `en`. |
| `maxPagesPerCompany` | integer | No | Max website pages to crawl per company. Default: `5`. Hard cap: `10`. |
| `maxNewsPerCompany` | integer | No | Max news results per company. Default: `3`. Hard cap: `10`. |
| `maxSerpQueriesPerCompany` | integer | No | Max search queries per company. Default: `2`. Hard cap: `5`. |
| `maxRunTimeMinutes` | integer | No | Soft run time safety limit inside the Actor. Default: `720`. Apify Run options timeout must also allow longer runs. |
| `maxConcurrency` | integer | No | Maximum companies enriched in parallel. Default: `5`. Hard cap: `10`. Higher values are faster but may use more platform resources. |
| `costSafetyMode` | boolean | No | Keeps strict search, crawl, and AI limits enabled. Default: `true`. |
| `skipIfNoWebsiteOrSocialFound` | boolean | No | Return an uncharged skipped item if no usable source is found. Default: `true`. |
| `generateAiOutreach` | boolean | No | Rewrite outreach using OpenRouter with your own key. Default: `false`. |
| `openRouterApiKey` | string | No | Optional secret OpenRouter API key for AI-written outreach. Leave empty for rule-based outreach. |
| `openRouterModel` | string | No | OpenRouter model ID used for AI outreach. Default: `openai/gpt-4o-mini`. |
| `proxyConfiguration` | object | No | Apify proxy settings. Used when needed for search providers or blocked websites. |

### Outreach profile

The Actor does not know what you sell unless you provide `offerDescription`.

For example, if you enter:

```json
{
  "senderName": "Yusuf Baris",
  "senderCompany": "Fabri-Lab",
  "offerDescription": "erp yazilimlari",
  "language": "en"
}
````

The English outreach copy normalizes common Turkish offer terms and uses:

```text
ERP software
```

If `offerDescription` is empty, outreach will contain `{{yourOffer}}` instead of inventing your business.

### Example input

```json
{
  "companies": [
    {
      "companyName": "Ahrefs",
      "website": "https://ahrefs.com",
      "country": "United States"
    },
    {
      "companyName": "Lemlist",
      "country": "France"
    },
    {
      "website": "https://www.apify.com"
    }
  ],
  "maxCompanies": 100,
  "findSocialProfiles": true,
  "findContactPages": true,
  "findEmails": true,
  "findRecentNews": true,
  "generateOutreach": true,
  "senderName": "Yusuf Baris",
  "senderCompany": "Fabri-Lab",
  "offerDescription": "erp yazilimlari",
  "targetPainPoint": "manual operations and disconnected business processes",
  "callToAction": "Would it make sense to send a quick example?",
  "language": "en",
  "maxPagesPerCompany": 5,
  "maxNewsPerCompany": 3,
  "maxSerpQueriesPerCompany": 2,
  "generateAiOutreach": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

### Output

Each company produces one dataset item.

Successful results include:

| Field | Type | Description |
|---|---|---|
| `input` | object | Original company input supplied by the user. |
| `company.name` | string | Normalized company name. |
| `company.website` | string | Official company website URL when found. |
| `company.domain` | string | Normalized domain. |
| `company.description` | string | Extractive description from public website content. |
| `company.industry` | string | Rule-based industry guess when enough signals are available. |
| `company.country` | string | Country from input, if provided. |
| `company.foundedYear` | integer | Founded year if detected from public text. |
| `company.employeeRange` | string | Employee range if available. |
| `socialProfiles.linkedin` | string | Public LinkedIn company profile URL. |
| `socialProfiles.instagram` | string | Public Instagram profile URL. |
| `socialProfiles.facebook` | string | Public Facebook profile URL. |
| `socialProfiles.x` | string | Public X / Twitter profile URL. |
| `socialProfiles.youtube` | string | Public YouTube profile URL. |
| `socialProfiles.tiktok` | string | Public TikTok profile URL. |
| `contact.contactPages` | array | Public contact, demo, sales, about, or related pages. |
| `contact.emails` | array | Public emails extracted from crawled pages. |
| `contact.phones` | array | Phone-like public contact signals. |
| `contact.address` | string | Address signal when detected. |
| `recentNews` | array | Recent news or announcement results useful as outreach triggers. |
| `websiteSignals` | object | Website signals such as pricing, careers, blog, docs, demo CTA, contact form, Shopify, WordPress, HubSpot. |
| `salesIntelligence.leadScore` | integer | Rule-based score from `0` to `100`. |
| `salesIntelligence.leadScoreLabel` | string | `low`, `medium`, or `high`. |
| `salesIntelligence.painPoints` | array | Sales-relevant signals inferred from public data. |
| `salesIntelligence.salesAngles` | array | Suggested outreach angles. |
| `salesIntelligence.personalizedIcebreaker` | string | Short personalization line. |
| `salesIntelligence.coldEmailSubject` | string | Suggested cold email subject. |
| `salesIntelligence.coldEmail` | string | Company-level cold email template. |
| `salesIntelligence.linkedinMessage` | string | Company-level LinkedIn message template. |
| `quality.confidence` | number | Confidence score from `0` to `1`. |
| `quality.dataCompleteness` | number | Completeness score from `0` to `1`. |
| `quality.sourcesFound` | integer | Number of source URLs found. |
| `quality.warnings` | array | Data gaps or extraction warnings. |
| `sources` | array | Source URLs and how they were found. |
| `metadata.scrapedAt` | string | ISO timestamp for the enrichment. |
| `metadata.charged` | boolean | Whether the result was charged. |
| `metadata.chargeEvent` | string | Charge event name when charged. |

Skipped results include:

| Field | Type | Description |
|---|---|---|
| `status` | string | `skipped`. |
| `reason` | string | Why the item was skipped. |
| `charged` | boolean | Always `false` for skipped items. |

### Example output

```json
{
  "input": {
    "companyName": "Ahrefs",
    "website": "https://ahrefs.com",
    "country": "United States"
  },
  "company": {
    "name": "Ahrefs",
    "website": "https://ahrefs.com",
    "domain": "ahrefs.com",
    "description": "Ahrefs provides SEO tools for marketers, agencies, and businesses.",
    "industry": "SEO Software",
    "country": "United States",
    "foundedYear": null,
    "employeeRange": null
  },
  "socialProfiles": {
    "linkedin": "https://www.linkedin.com/company/ahrefs",
    "instagram": null,
    "facebook": null,
    "x": "https://x.com/ahrefs",
    "youtube": "https://www.youtube.com/@AhrefsCom",
    "tiktok": null
  },
  "contact": {
    "contactPages": [
      "https://ahrefs.com/contact"
    ],
    "emails": [],
    "phones": [],
    "address": null
  },
  "recentNews": [
    {
      "title": "Ahrefs launches a new product update",
      "url": "https://example.com/news/ahrefs",
      "source": "example.com",
      "publishedAt": "2026-05-10",
      "snippet": "Ahrefs announced a new product update for marketers."
    }
  ],
  "websiteSignals": {
    "hasPricingPage": true,
    "hasCareersPage": true,
    "hasBlog": true,
    "hasDocs": true,
    "hasDemoCta": false,
    "hasContactForm": true,
    "usesShopify": false,
    "usesWordPress": false,
    "usesHubSpot": false
  },
  "salesIntelligence": {
    "leadScore": 86,
    "leadScoreLabel": "high",
    "painPoints": [
      "Active hiring suggests growth and operational scaling needs",
      "Recent news can be used as a timely outreach trigger"
    ],
    "salesAngles": [
      "Mention recent company news as an outreach trigger",
      "Hiring activity suggests growth. Offer tools that save time or support scaling"
    ],
    "personalizedIcebreaker": "Saw Ahrefs recently in the news: Ahrefs launches a new product update.",
    "coldEmailSubject": "Quick idea for Ahrefs",
    "coldEmail": "Hi {{firstName}},\n\nSaw Ahrefs recently in the news: Ahrefs launches a new product update.\n\nQuick context from Fabri-Lab: ERP software. Based on their hiring signal, this may be relevant for manual operations and disconnected business processes.\n\nWould it make sense to send a quick example?\n\nBest,\nYusuf Baris",
    "linkedinMessage": "Hi {{firstName}}, noticed Ahrefs and Ahrefs launches a new product update. I had a quick idea related to ERP software."
  },
  "quality": {
    "confidence": 0.91,
    "dataCompleteness": 0.82,
    "sourcesFound": 7,
    "warnings": []
  },
  "sources": [
    {
      "type": "website",
      "url": "https://ahrefs.com",
      "foundBy": "input",
      "confidence": 1
    }
  ],
  "metadata": {
    "scrapedAt": "2026-05-18T12:00:00.000Z",
    "charged": true,
    "chargeEvent": "enriched_company"
  }
}
```

Example skipped output:

```json
{
  "input": {
    "companyName": "Unknown XYZ"
  },
  "status": "skipped",
  "reason": "No official website, social profile, contact page, or usable source found.",
  "charged": false,
  "metadata": {
    "scrapedAt": "2026-05-18T12:00:00.000Z",
    "charged": false,
    "chargeEvent": null
  }
}
```

### How to use

1. Add companies in the input form, or provide a public CSV URL.
2. Keep website URLs when you have them. This improves accuracy and reduces search work.
3. Select which enrichment signals to find: social profiles, contact pages, emails, and recent news.
4. If you want outreach templates, fill the `Outreach profile` fields.
5. Keep cost safety limits enabled unless you need deeper research.
6. Run the Actor.
7. Export the dataset as JSON, CSV, Excel, XML, RSS, HTML, or use it through the Apify API.

### Pricing

Launch price: `$6 / 1,000 successfully enriched companies`.

You are charged only for successful enriched company profiles. Empty, invalid, duplicate, skipped, or limit-skipped companies are not charged. If one enrichment step times out but the Actor can still return a usable company profile, the result may be charged and the missing step is listed in `quality.warnings`.

If you set a maximum run cost in Apify Run options, the platform can stop the run once that budget is reached. For example, with `$0.006` per successful company, a `$0.45` max cost stops at about `75` charged results.

| Event | Price | Charged when |
|---|---:|---|
| `enriched_company` | `$0.006` | A usable enriched company profile is pushed to the dataset. |

### Cost safety

Default limits are intentionally conservative:

```json
{
  "maxSerpQueriesPerCompany": 2,
  "maxPagesPerCompany": 5,
  "maxNewsPerCompany": 3,
  "maxConcurrency": 5,
  "generateAiOutreach": false,
  "costSafetyMode": true
}
```

Hard caps:

- `maxSerpQueriesPerCompany`: `5`
- `maxPagesPerCompany`: `10`
- `maxNewsPerCompany`: `10`
- `maxCompanies`: `5000`
- `maxConcurrency`: `10`

### How lead score is calculated

The lead score is rule-based and capped from `0` to `100`.

Positive signals:

- Website found
- Contact page found
- Public email found
- LinkedIn company page found
- Other social profile found
- Recent news found
- Pricing, demo, or contact CTA found
- Careers or hiring signal found
- B2B keywords found
- Strong description or industry confidence

Negative signals:

- Website not found
- Only social media found
- Contact path missing
- Low confidence
- Duplicate-like result

Labels:

- `0-39`: `low`
- `40-69`: `medium`
- `70-100`: `high`

### MCP and AI agent usage

This Actor is designed for AI agents and MCP workflows. It returns structured JSON with field descriptions, confidence scores, warnings, and source URLs so agents can use the result in lead generation, research, CRM enrichment, sales automation, and outbound workflows.

High-value dataset fields:

- `company.name`
- `company.website`
- `company.description`
- `company.industry`
- `socialProfiles.linkedin`
- `contact.emails`
- `contact.contactPages`
- `salesIntelligence.leadScore`
- `salesIntelligence.leadScoreLabel`
- `salesIntelligence.salesAngles`
- `salesIntelligence.coldEmail`
- `quality.confidence`
- `sources`

### Configuration

Optional environment variables:

| Variable | Description |
|---|---|
| `SERP_ACTOR_ID` | Override the default SERP Actor. Default: `apify/google-search-scraper`. |

AI outreach uses OpenRouter only. Add `openRouterApiKey`, enable `generateAiOutreach`, and select `openRouterModel` in the Actor input. If no OpenRouter key is provided, the Actor uses rule-based outreach.

### Limitations

- This Actor only uses public web pages and public search results.
- It does not scrape private LinkedIn profiles.
- It does not log into LinkedIn, Instagram, Facebook, X, or private websites.
- It does not guarantee emails because many companies do not publish public email addresses.
- Some websites may block HTTP crawling or expose limited public content.
- Social profile matching can be less accurate for ambiguous company names.
- Results can vary by country, language, search provider, and public source availability.
- Outreach templates are company-level templates, not person-level emails.
- Replace `{{firstName}}`, `{{senderName}}`, and `{{yourOffer}}` in your CRM or outreach tool if you leave those fields empty.
- Optional AI outreach requires your own API key.

### FAQ

#### Can I use only company names?

Yes. Website is optional. For best speed and accuracy, provide the company website when available.

#### Can I upload a CSV?

Yes. Use `csvUrl` with a public CSV containing `companyName`, `website`, and `country` columns.

#### Does this Actor scrape private LinkedIn profiles?

No. It only uses public search results and public web pages.

#### Does it guarantee emails?

No. It extracts public emails when they are available on crawled pages.

#### Am I charged for failed results?

No. Empty, invalid, duplicate, skipped, and limit-skipped companies are not charged. Partial successful profiles can be charged when they include usable company data.

#### What does the cold email say?

The Actor uses company signals for personalization and combines them with your `offerDescription`. If `offerDescription` is empty, the email keeps `{{yourOffer}}` instead of inventing your business.

#### Can I export the data?

Yes. Apify datasets can be exported as JSON, CSV, Excel, XML, RSS, HTML, or consumed through the Apify API.

#### Can I use proxies?

Yes. `proxyConfiguration` is supported.

### Support

If you have questions, feature requests, or find a bug, use the Issues tab on the Apify Actor page.

# Actor input Schema

## `companies` (type: `array`):

Company names, websites, and optional countries to enrich. Website is optional.

## `csvUrl` (type: `string`):

Optional public CSV URL with companyName, website, and country columns.

## `maxCompanies` (type: `integer`):

Maximum number of unique companies to process in this run.

## `findSocialProfiles` (type: `boolean`):

Search for public LinkedIn, Instagram, Facebook, X, YouTube, and TikTok company profiles.

## `findContactPages` (type: `boolean`):

Find public contact, about, demo, and sales pages from the company website.

## `findEmails` (type: `boolean`):

Extract public business emails from crawled website pages.

## `findRecentNews` (type: `boolean`):

Search for recent company news and public announcements.

## `generateOutreach` (type: `boolean`):

Generate cold email and LinkedIn message templates. Add your offer details below to avoid generic placeholders.

## `senderName` (type: `string`):

Optional sender name used in the email signature. If empty, {{senderName}} is kept as a placeholder.

## `senderCompany` (type: `string`):

Optional company or agency name used in outreach copy.

## `offerDescription` (type: `string`):

Describe your actual offer. Example: build SEO-focused websites for local clinics, automate B2B lead research, or improve e-commerce catalog data.

## `targetPainPoint` (type: `string`):

Optional. The customer problem your offer solves. If empty, the Actor uses detected company signals.

## `callToAction` (type: `string`):

Optional custom CTA. Example: Would it make sense to send a quick example?

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

Language used for rule-based outreach templates. Select Turkish if your offer is written in Turkish.

## `maxPagesPerCompany` (type: `integer`):

Maximum website pages to crawl per company. Hard-capped at 10.

## `maxNewsPerCompany` (type: `integer`):

Maximum recent news results per company. Hard-capped at 10.

## `maxSerpQueriesPerCompany` (type: `integer`):

Maximum search queries per company. Hard-capped at 5.

## `maxRunTimeMinutes` (type: `integer`):

Soft safety limit inside the Actor. Apify Run options timeout must also allow long runs.

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

Maximum number of companies enriched in parallel. Higher values are faster but can use more platform resources. Hard-capped at 10.

## `costSafetyMode` (type: `boolean`):

Keep strict crawl, search, and AI limits enabled.

## `skipIfNoWebsiteOrSocialFound` (type: `boolean`):

Return an uncharged skipped item when no website, social profile, contact page, or news source is found.

## `generateAiOutreach` (type: `boolean`):

Use your own OpenRouter API key to rewrite outreach messages. Rule-based templates are used when disabled.

## `openRouterApiKey` (type: `string`):

Optional. Provide your own OpenRouter API key for AI-written outreach. Leave empty for rule-based outreach.

## `openRouterModel` (type: `string`):

OpenRouter model ID used when Generate AI outreach is enabled.

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

Apify proxy configuration. Used for SERP providers and blocked websites when available.

## Actor input object example

```json
{
  "companies": [
    {
      "companyName": "Ahrefs",
      "website": "https://ahrefs.com",
      "country": "United States"
    },
    {
      "companyName": "Lemlist",
      "country": "France"
    },
    {
      "website": "https://www.apify.com"
    }
  ],
  "maxCompanies": 100,
  "findSocialProfiles": true,
  "findContactPages": true,
  "findEmails": true,
  "findRecentNews": true,
  "generateOutreach": true,
  "language": "en",
  "maxPagesPerCompany": 5,
  "maxNewsPerCompany": 3,
  "maxSerpQueriesPerCompany": 2,
  "maxRunTimeMinutes": 720,
  "maxConcurrency": 5,
  "costSafetyMode": true,
  "skipIfNoWebsiteOrSocialFound": true,
  "generateAiOutreach": false,
  "openRouterModel": "openai/gpt-4o-mini",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Dataset items containing company profile, contact signals, social profiles, news, lead score, sales angles, outreach messages, confidence, and sources.

# 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 = {
    "companies": [
        {
            "companyName": "Ahrefs",
            "website": "https://ahrefs.com",
            "country": "United States"
        },
        {
            "companyName": "Lemlist",
            "country": "France"
        },
        {
            "website": "https://www.apify.com"
        }
    ],
    "csvUrl": "",
    "senderName": "",
    "senderCompany": "",
    "offerDescription": "",
    "targetPainPoint": "",
    "callToAction": "",
    "openRouterApiKey": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("fabri-lab/leads-data-scraper-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 = {
    "companies": [
        {
            "companyName": "Ahrefs",
            "website": "https://ahrefs.com",
            "country": "United States",
        },
        {
            "companyName": "Lemlist",
            "country": "France",
        },
        { "website": "https://www.apify.com" },
    ],
    "csvUrl": "",
    "senderName": "",
    "senderCompany": "",
    "offerDescription": "",
    "targetPainPoint": "",
    "callToAction": "",
    "openRouterApiKey": "",
}

# Run the Actor and wait for it to finish
run = client.actor("fabri-lab/leads-data-scraper-ai").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 '{
  "companies": [
    {
      "companyName": "Ahrefs",
      "website": "https://ahrefs.com",
      "country": "United States"
    },
    {
      "companyName": "Lemlist",
      "country": "France"
    },
    {
      "website": "https://www.apify.com"
    }
  ],
  "csvUrl": "",
  "senderName": "",
  "senderCompany": "",
  "offerDescription": "",
  "targetPainPoint": "",
  "callToAction": "",
  "openRouterApiKey": ""
}' |
apify call fabri-lab/leads-data-scraper-ai --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=fabri-lab/leads-data-scraper-ai",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "AI Company Lead Enrichment & Sales Intelligence",
        "description": "Find company websites, social profiles, contact pages, emails, recent news, lead scores, sales angles, and outreach templates from company names or domains.",
        "version": "0.0",
        "x-build-id": "egAJRzsAAftomx1Jd"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/fabri-lab~leads-data-scraper-ai/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-fabri-lab-leads-data-scraper-ai",
                "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/fabri-lab~leads-data-scraper-ai/runs": {
            "post": {
                "operationId": "runs-sync-fabri-lab-leads-data-scraper-ai",
                "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/fabri-lab~leads-data-scraper-ai/run-sync": {
            "post": {
                "operationId": "run-sync-fabri-lab-leads-data-scraper-ai",
                "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": {
                    "companies": {
                        "title": "Companies",
                        "minItems": 0,
                        "maxItems": 5000,
                        "type": "array",
                        "description": "Company names, websites, and optional countries to enrich. Website is optional.",
                        "items": {
                            "type": "object",
                            "properties": {
                                "companyName": {
                                    "title": "Company name",
                                    "description": "Company name to research. Example: Ahrefs",
                                    "type": "string",
                                    "editor": "textfield"
                                },
                                "website": {
                                    "title": "Website",
                                    "description": "Optional company website or domain. Example: https://ahrefs.com",
                                    "type": "string",
                                    "editor": "textfield"
                                },
                                "country": {
                                    "title": "Country",
                                    "description": "Optional country or market context. Example: United States",
                                    "type": "string",
                                    "editor": "textfield"
                                }
                            }
                        }
                    },
                    "csvUrl": {
                        "title": "CSV URL",
                        "type": "string",
                        "description": "Optional public CSV URL with companyName, website, and country columns."
                    },
                    "maxCompanies": {
                        "title": "Max companies",
                        "minimum": 1,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Maximum number of unique companies to process in this run.",
                        "default": 100
                    },
                    "findSocialProfiles": {
                        "title": "Find social profiles",
                        "type": "boolean",
                        "description": "Search for public LinkedIn, Instagram, Facebook, X, YouTube, and TikTok company profiles.",
                        "default": true
                    },
                    "findContactPages": {
                        "title": "Find contact pages",
                        "type": "boolean",
                        "description": "Find public contact, about, demo, and sales pages from the company website.",
                        "default": true
                    },
                    "findEmails": {
                        "title": "Find emails",
                        "type": "boolean",
                        "description": "Extract public business emails from crawled website pages.",
                        "default": true
                    },
                    "findRecentNews": {
                        "title": "Find recent news",
                        "type": "boolean",
                        "description": "Search for recent company news and public announcements.",
                        "default": true
                    },
                    "generateOutreach": {
                        "title": "Generate outreach",
                        "type": "boolean",
                        "description": "Generate cold email and LinkedIn message templates. Add your offer details below to avoid generic placeholders.",
                        "default": true
                    },
                    "senderName": {
                        "title": "Sender name",
                        "type": "string",
                        "description": "Optional sender name used in the email signature. If empty, {{senderName}} is kept as a placeholder."
                    },
                    "senderCompany": {
                        "title": "Your company",
                        "type": "string",
                        "description": "Optional company or agency name used in outreach copy."
                    },
                    "offerDescription": {
                        "title": "What do you sell or offer?",
                        "type": "string",
                        "description": "Describe your actual offer. Example: build SEO-focused websites for local clinics, automate B2B lead research, or improve e-commerce catalog data."
                    },
                    "targetPainPoint": {
                        "title": "Problem you solve",
                        "type": "string",
                        "description": "Optional. The customer problem your offer solves. If empty, the Actor uses detected company signals."
                    },
                    "callToAction": {
                        "title": "Call to action",
                        "type": "string",
                        "description": "Optional custom CTA. Example: Would it make sense to send a quick example?"
                    },
                    "language": {
                        "title": "Language",
                        "enum": [
                            "en",
                            "tr"
                        ],
                        "type": "string",
                        "description": "Language used for rule-based outreach templates. Select Turkish if your offer is written in Turkish.",
                        "default": "en"
                    },
                    "maxPagesPerCompany": {
                        "title": "Max website pages per company",
                        "minimum": 1,
                        "maximum": 10,
                        "type": "integer",
                        "description": "Maximum website pages to crawl per company. Hard-capped at 10.",
                        "default": 5
                    },
                    "maxNewsPerCompany": {
                        "title": "Max news per company",
                        "minimum": 0,
                        "maximum": 10,
                        "type": "integer",
                        "description": "Maximum recent news results per company. Hard-capped at 10.",
                        "default": 3
                    },
                    "maxSerpQueriesPerCompany": {
                        "title": "Max SERP queries per company",
                        "minimum": 0,
                        "maximum": 5,
                        "type": "integer",
                        "description": "Maximum search queries per company. Hard-capped at 5.",
                        "default": 2
                    },
                    "maxRunTimeMinutes": {
                        "title": "Max run time minutes",
                        "minimum": 1,
                        "maximum": 720,
                        "type": "integer",
                        "description": "Soft safety limit inside the Actor. Apify Run options timeout must also allow long runs.",
                        "default": 720
                    },
                    "maxConcurrency": {
                        "title": "Max concurrency",
                        "minimum": 1,
                        "maximum": 10,
                        "type": "integer",
                        "description": "Maximum number of companies enriched in parallel. Higher values are faster but can use more platform resources. Hard-capped at 10.",
                        "default": 5
                    },
                    "costSafetyMode": {
                        "title": "Cost safety mode",
                        "type": "boolean",
                        "description": "Keep strict crawl, search, and AI limits enabled.",
                        "default": true
                    },
                    "skipIfNoWebsiteOrSocialFound": {
                        "title": "Skip if no source found",
                        "type": "boolean",
                        "description": "Return an uncharged skipped item when no website, social profile, contact page, or news source is found.",
                        "default": true
                    },
                    "generateAiOutreach": {
                        "title": "Generate AI outreach",
                        "type": "boolean",
                        "description": "Use your own OpenRouter API key to rewrite outreach messages. Rule-based templates are used when disabled.",
                        "default": false
                    },
                    "openRouterApiKey": {
                        "title": "OpenRouter API key",
                        "type": "string",
                        "description": "Optional. Provide your own OpenRouter API key for AI-written outreach. Leave empty for rule-based outreach."
                    },
                    "openRouterModel": {
                        "title": "OpenRouter model",
                        "enum": [
                            "openai/gpt-4o-mini",
                            "openai/gpt-4.1-mini",
                            "anthropic/claude-3.5-haiku",
                            "google/gemini-2.0-flash-001",
                            "meta-llama/llama-3.3-70b-instruct",
                            "mistralai/mistral-small-3.1-24b-instruct"
                        ],
                        "type": "string",
                        "description": "OpenRouter model ID used when Generate AI outreach is enabled.",
                        "default": "openai/gpt-4o-mini"
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Apify proxy configuration. Used for SERP providers and blocked websites when available.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
