# B2B Domain, Tech Stack & Contact Enricher (`minnnnn/b2b-domain-enricher`) Actor

Extract B2B contact emails, social links, 12 tech stack signals, and pricing/careers pages from company domains with built-in SSRF protection.

- **URL**: https://apify.com/minnnnn/b2b-domain-enricher.md
- **Developed by:** [Jaemin Chun](https://apify.com/minnnnn) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 enriched domains

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

## B2B Domain, Tech Stack & Contact Enricher

Fast, **zero-LLM-cost** B2B domain enricher built for **Apify Pay-Per-Event** and **MCP (Model Context Protocol)** workflows. Given a list of company URLs or domains, it asynchronously extracts contact emails, social media profiles, web technologies, and buying/growth signals (`/pricing`, `/careers`) with built-in SSRF security filtering.

***

### Key Features

- **Zero LLM Token Cost**: Runs on pure asynchronous `httpx` + `BeautifulSoup` parsing—fast, predictable, and economical for bulk B2B enrichment.
- **2-Stage Email Discovery**: Extracts emails from `mailto:` links, Cloudflare `data-cfemail` obfuscation, and page text/HTML. If zero emails are found on the homepage, automatically follows at most one internal `/contact` or `/about` page to recover contact details.
- **Tech Stack Detection (12 Signals)**: Detects `Shopify`, `WordPress`, `Webflow`, `Next.js`, `React`, `Stripe`, `HubSpot`, `Intercom`, `GA`, `Meta Pixel`, `Tailwind`, and `Cloudflare` from HTTP response headers, scripts, meta tags, and markup.
- **Social Profile Extraction**: Captures official links for `Instagram`, `X/Twitter`, `LinkedIn`, `YouTube`, `TikTok`, and `GitHub` while ignoring share/intent widgets.
- **B2B Buying & Growth Signals**: Detects whether internal `/pricing` and `/careers` pages exist and returns their URLs.
- **Built-in SSRF Protection**: Resolves target hostnames using `socket` and `ipaddress` before every request and redirect hop, immediately blocking (`status: "blocked"`) `localhost`, loopback (`127.0.0.0/8`, `::1`), private (`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`), and link-local (`169.254.0.0/16`) ranges.
- **Pay-Per-Event Friendly**: Charges `domain_enriched` (`count=1`) **only** when `status == "success"`. Blocked or failed URLs are never charged.

***

### Input Schema

| Field | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `urls` | `array<string>` | Yes | `["https://stripe.com", "https://linear.app", "https://shopify.com"]` | List of B2B website URLs or bare domains to enrich. |
| `concurrency` | `integer` | No | `15` | Maximum number of domains fetched concurrently (`1`–`50`). |

#### Example Input

```json
{
  "urls": [
    "https://stripe.com",
    "https://linear.app",
    "https://shopify.com"
  ],
  "concurrency": 15
}
```

***

### Output JSON Example

Each input URL produces one structured item in the Apify Dataset (or in the MCP tool response):

```json
[
  {
    "url": "https://linear.app",
    "final_url": "https://linear.app",
    "domain": "linear.app",
    "status": "success",
    "http_status": 200,
    "title": "Linear – The system for product development",
    "description": "Purpose-built for planning and building products with AI agents.",
    "emails": [
      "hello@linear.app"
    ],
    "social_links": {
      "twitter": "https://x.com/linear",
      "github": "https://github.com/linear",
      "youtube": "https://www.youtube.com/@linear"
    },
    "tech_stack": [
      "Next.js",
      "React",
      "Cloudflare"
    ],
    "has_pricing_page": true,
    "pricing_url": "https://linear.app/pricing",
    "has_careers_page": true,
    "careers_url": "https://linear.app/careers",
    "secondary_page_checked": "https://linear.app/contact",
    "error": null
  },
  {
    "url": "http://127.0.0.1",
    "final_url": null,
    "domain": "127.0.0.1",
    "status": "blocked",
    "http_status": null,
    "title": null,
    "description": null,
    "emails": [],
    "social_links": {},
    "tech_stack": [],
    "has_pricing_page": false,
    "pricing_url": null,
    "has_careers_page": false,
    "careers_url": null,
    "secondary_page_checked": null,
    "error": "Blocked IP address: 127.0.0.1"
  }
]
```

#### Status Values

- `success`: Domain was safely fetched and parsed (`domain_enriched` event charged).
- `blocked`: Target URL failed SSRF validation (private, loopback, link-local IP, or disallowed scheme). Not charged.
- `error`: Network timeout, HTTP 4xx/5xx, or redirect limit exceeded. Not charged.

***

### MCP Integration (`B2B-Domain-Enricher`)

This project also ships a standalone **Model Context Protocol (MCP)** server over SSE transport so AI agents (Claude Desktop, Cursor, custom MCP clients, or MCP marketplaces) can enrich domains on demand.

#### Exposed Tool

- **Server Name**: `B2B-Domain-Enricher`
- **Tool Name**: `enrich_domains(urls: list[str])`
- **Transport**: `sse`

#### Start the MCP Server Locally

```bash
python -m src.mcp_server
```

By default, the SSE endpoint runs at `http://127.0.0.1:8000/sse`.

#### Example MCP Client Configuration

```json
{
  "mcpServers": {
    "b2b-domain-enricher": {
      "url": "http://127.0.0.1:8000/sse"
    }
  }
}
```

#### Apify MCP Server Integration

Once published on the Apify Store, you can also invoke this Actor directly through the hosted Apify MCP server (`https://mcp.apify.com`) using your Apify API token.

***

### Local Development

```bash
python -m venv .venv
## Windows
.\.venv\Scripts\activate
## macOS / Linux
source .venv/bin/activate

pip install -r requirements.txt

## Run as an Apify Actor
python -m src.main

## Run as an MCP SSE Server
python -m src.mcp_server
```

# Actor input Schema

## `urls` (type: `array`):

List of B2B website URLs or domains to enrich.

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

Maximum number of domains to fetch concurrently.

## Actor input object example

```json
{
  "urls": [
    "https://stripe.com",
    "https://linear.app",
    "https://shopify.com"
  ],
  "concurrency": 15
}
```

# Actor output Schema

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

No description

# 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 = {
    "urls": [
        "https://stripe.com",
        "https://linear.app",
        "https://shopify.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("minnnnn/b2b-domain-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 = { "urls": [
        "https://stripe.com",
        "https://linear.app",
        "https://shopify.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("minnnnn/b2b-domain-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 '{
  "urls": [
    "https://stripe.com",
    "https://linear.app",
    "https://shopify.com"
  ]
}' |
apify call minnnnn/b2b-domain-enricher --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,minnnnn/b2b-domain-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/wzGRtkE3Du64Cla2a/builds/Hwiy7KdcZedEmu9ik/openapi.json
