# Website Contact & Email Extractor (`emperor1978/contact-email-extractor`) Actor

Extracts emails, phone numbers, social media links, and physical addresses from websites by crawling main pages and common contact sub-pages.

- **URL**: https://apify.com/emperor1978/contact-email-extractor.md
- **Developed by:** [The Emperor](https://apify.com/emperor1978) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 contact founds

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

## Website Contact & Email Extractor

Extract email addresses, phone numbers, social media profile links, and physical addresses from any website — fast, without a browser.

### What it does

For each URL you provide, the actor crawls the main page plus the most common contact sub-pages:

- `/contact`
- `/about`
- `/team`
- `/support`
- `/impressum`
- `/contact-us`
- `/about-us`

From each page it extracts:

| Signal | Method |
|---|---|
| **Email addresses** | Regex over HTML source + visible text; validated and deduplicated |
| **Phone numbers** | Regex supporting international and US formats |
| **Social media links** | Anchor tag scanning for Twitter/X, LinkedIn, Facebook, Instagram, GitHub |
| **Physical address** | JSON-LD structured data (`schema.org/PostalAddress`) with HTML fallback (`<address>` tag, class/id heuristics) |

Results from all crawled pages are merged and deduplicated before being stored.

### Input

```json
{
  "urls": [
    "https://apify.com",
    "https://example.com"
  ],
  "contactPaths": ["/contact", "/about", "/team", "/support", "/impressum", "/contact-us", "/about-us"],
  "requestTimeoutSecs": 15,
  "maxRetries": 2,
  "proxyConfiguration": { "useApifyProxy": true }
}
```

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `urls` | `string[]` | Yes | — | List of website URLs to process |
| `contactPaths` | `string[]` | No | See above | Sub-paths to probe on each domain |
| `requestTimeoutSecs` | `integer` | No | `15` | Per-request timeout (5–60) |
| `maxRetries` | `integer` | No | `2` | Retries on transient failures (0–5) |
| `proxyConfiguration` | `object` | No | `{}` | Apify proxy settings |

### Output

Each website produces one dataset record:

```json
{
  "url": "https://apify.com",
  "domain": "apify.com",
  "emails": [
    "hello@apify.com"
  ],
  "phones": [
    "+1 (555) 123-4567"
  ],
  "socialMedia": {
    "twitter": ["https://twitter.com/apify"],
    "linkedin": ["https://linkedin.com/company/apify"],
    "github": ["https://github.com/apifytech"]
  },
  "address": "Vodickova 704/36, Prague 1, 110 00, CZ",
  "pagesScraped": [
    "https://apify.com",
    "https://apify.com/contact"
  ],
  "scrapedAt": "2024-01-15T10:30:00+00:00",
  "error": null
}
```

If a page returns a 404, times out, or otherwise fails, it is skipped silently and the rest of the run continues. Any non-fatal per-page errors are noted in the top-level `error` field of the result.

### Pricing

This actor uses **pay-per-event** charging: **one charge event per website processed**, regardless of how many sub-pages were crawled.

### Technical details

- **Runtime**: Python 3.11
- **HTTP client**: `httpx` (async, no browser overhead)
- **HTML parser**: `BeautifulSoup4`
- **Concurrency**: All sub-pages for a single website are fetched concurrently; websites are processed sequentially to stay polite
- **Proxy support**: Pass an Apify proxy configuration to rotate IPs and avoid blocks

### Limitations

- Does not execute JavaScript — contact information loaded dynamically by JS will not be found. Use the [Web Scraper](https://apify.com/apify/web-scraper) for JS-heavy sites.
- Phone number extraction is heuristic and may include false positives (e.g. dates, zip codes) on some pages.
- Email blacklisting filters obvious placeholders and CDN/framework addresses but cannot catch every false positive.

# Actor input Schema

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

List of website URLs to extract contact information from. Each URL should be a valid HTTP/HTTPS URL (e.g. https://example.com).

## `contactPaths` (type: `array`):

Additional URL paths to crawl on each website, appended to the base domain. The defaults cover the most common contact page locations.

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

Maximum time in seconds to wait for a page to load before skipping it.

## `maxRetries` (type: `integer`):

Maximum number of times to retry a failed HTTP request before giving up.

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

Proxy configuration to use for requests. Recommended for production runs to avoid IP blocking.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com"
  ],
  "contactPaths": [
    "/contact",
    "/about",
    "/team",
    "/support",
    "/impressum",
    "/contact-us",
    "/about-us"
  ],
  "requestTimeoutSecs": 15,
  "maxRetries": 2,
  "proxyConfiguration": {}
}
```

# Actor output Schema

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

Scraped results stored in the default dataset

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

// Run the Actor and wait for it to finish
const run = await client.actor("emperor1978/contact-email-extractor").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://apify.com"] }

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

```

## MCP server setup

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

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/vfMfvdDaywqrilZe0/builds/kyhDClRuZaQa87cAO/openapi.json
