# Dataset Contact Enricher — Add Emails to Any Scraper Output (`noniner/dataset-contact-enricher`) Actor

Webhook add-on for any scraper. Give it a datasetId from a finished run (Google Maps, Trustpilot, B2B scraper), it extracts domains and enriches every company with decision-maker names, job titles and inferred work emails.

- **URL**: https://apify.com/noniner/dataset-contact-enricher.md
- **Developed by:** [Fredrik Hansson](https://apify.com/noniner) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $100.00 / 1,000 company enricheds

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

## Dataset Contact Enricher — Webhook Add-on for Any Scraper

Automatically enrich any existing Apify dataset with decision-maker contacts. Connect it as a webhook to any scraper — when the scraper finishes, this actor picks up its dataset and adds names, titles and inferred emails from each company's contact pages.

### How it works

1. A scraper (Google Maps, Trustpilot, LinkedIn, etc.) finishes its run
2. The webhook fires with `resource.defaultDatasetId`
3. This actor loads the dataset, auto-detects the domain/website field, and calls `noniner/contact-page-extractor` for each unique domain
4. The enriched result — original row + `contacts` array — is pushed to a new dataset

### Webhook setup

In Apify Console → any actor → **Integrations tab**:

| Setting | Value |
|---|---|
| Trigger | `ACTOR.RUN.SUCCEEDED` |
| Actor | `noniner/dataset-contact-enricher` |
| Input | `{ "datasetId": "{{resource.defaultDatasetId}}" }` |

That's it. Every future run of that scraper will produce an enriched dataset automatically.

### Input

```json
{
  "datasetId": "abc123",
  "domainField": "website",
  "maxContactsPerCompany": 3,
  "inferEmails": true,
  "outputMode": "merged"
}
```

| Field | Type | Default | Description |
|---|---|---|---|
| `datasetId` | string | required | Source dataset ID |
| `domainField` | string | auto-detect | Field name containing domain/URL |
| `maxContactsPerCompany` | number | 3 | Max contacts per company |
| `inferEmails` | boolean | true | Add inferred email patterns |
| `outputMode` | `merged` / `contacts_only` | `merged` | Output format |

Auto-detected domain field names: `domain`, `website`, `url`, `web`, `homepage`, `companyWebsite`, `site`.

### Output (merged mode)

Each row from the source dataset, plus a `contacts` array:

```json
{
  "name": "Acme Corp",
  "website": "acme.com",
  "_enrichedDomain": "acme.com",
  "contacts": [
    {
      "name": "Jane Smith",
      "title": "Head of Sales",
      "email": "jane.smith@acme.com",
      "inferredEmail": "j.smith@acme.com"
    }
  ]
}
```

### Pricing

Pay-per-event: **$0.10 per company enriched** (regardless of how many contacts are found).

# Actor input Schema

## `datasetId` (type: `string`):

The Apify dataset ID from a finished scraper run (e.g. value of resource.defaultDatasetId in the webhook payload).

## `domainField` (type: `string`):

Name of the field in the dataset that contains the company domain or website URL. Auto-detected if left empty (tries: domain, website, url, web, homepage).

## `maxContactsPerCompany` (type: `integer`):

Maximum number of decision-maker contacts to find per company. Default: 3.

## `inferEmails` (type: `boolean`):

Generate the most likely work email for each contact based on the company's email pattern.

## `outputMode` (type: `string`):

merged = original row + contacts array appended. contacts_only = flat list of contact records.

## Actor input object example

```json
{
  "datasetId": "",
  "domainField": "",
  "maxContactsPerCompany": 3,
  "inferEmails": true,
  "outputMode": "merged"
}
```

# Actor output Schema

## `enriched` (type: `string`):

Original rows with contacts array appended.

# 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 = {
    "datasetId": "",
    "domainField": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("noniner/dataset-contact-enricher").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 = {
    "datasetId": "",
    "domainField": "",
}

# Run the Actor and wait for it to finish
run = client.actor("noniner/dataset-contact-enricher").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 '{
  "datasetId": "",
  "domainField": ""
}' |
apify call noniner/dataset-contact-enricher --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,noniner/dataset-contact-enricher"
        }
    }
}
```

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/B61ebHfcZCAFoGneO/builds/KJZjCYhNmxWuqP73X/openapi.json
