# Website Contact & Social Extractor (`thenightowl/website-contact-extractor`) Actor

Give it a website, get its emails, phone numbers (validated, mobile vs landline), WhatsApp links, social profiles (Instagram, Facebook, X, LinkedIn, TikTok, YouTube, Telegram…), addresses and company data. Homepage + contact pages, robots.txt respected. $0.40 per 1,000 pages. Also an MCP server.

- **URL**: https://apify.com/thenightowl/website-contact-extractor.md
- **Developed by:** [Mohamad Najia](https://apify.com/thenightowl) (community)
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 7 total users, 6 monthly users, 78.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.40 / 1,000 page fetcheds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 & Social Extractor — emails, phones, WhatsApp & social profiles from any website

**Give it a website. Get back how to reach the company.** The extractor reads the homepage and the site's own
contact / about / impressum pages and returns, deduplicated and with the page each item came from:

- **Emails** — from `mailto:` links, schema.org markup and visible text, including obfuscated ones
  (`name [at] company [dot] com`); role mailboxes (`info@`, `sales@`) are flagged so you can pick the personal ones.
- **Phone numbers** — validated with Google's libphonenumber, returned in E.164 and international format with the
  country and **type (mobile / landline / toll-free / fax)**. Pass `region` (e.g. `AE`) and local numbers without a
  country code are read correctly.
- **WhatsApp** — `wa.me`, `api.whatsapp.com`, `whatsapp://` chat links and group invites.
- **Social profiles** — Instagram, Facebook, X/Twitter, LinkedIn, YouTube, TikTok, Telegram, Snapchat, Pinterest,
  Threads, GitHub, Behance, Dribbble, Medium, Discord, Vimeo, TripAdvisor, Google Business — with handles.
  Share buttons and "follow us" widgets pointing at nothing are excluded.
- **Addresses & company data** — schema.org `Organization` / `LocalBusiness` (name, address, opening hours, geo),
  `<address>` blocks, microdata, page languages.

**$0.40 per 1,000 pages** (a typical site is 2–3 pages). Failed fetches are free. No proxies, no AI, nothing stored.

### Three ways to use it

| | |
|---|---|
| **Run it** (Apify) | paste up to 5,000 website URLs → one dataset row per site, ready for a CRM or a mail-merge. |
| **Call it from an AI agent** | MCP server at `/mcp` with five tools — "find the sales email for acme.ae" just works. |
| **REST** | `POST /v1/tools/extract_contacts {"url": "acme.ae", "region": "AE"}` |

### Tools

| tool | what | price |
|---|---|---|
| `extract_contacts` | homepage + up to 19 contact pages → everything above | per page |
| `extract_contacts_bulk` | up to 50 sites in one call, per-site results + summary | per page |
| `find_social_profiles` | homepage only, social + WhatsApp links | 1 page |
| `check_url` | reachable? final URL, status, title, languages, has a contact page? | 1 page |
| `extract_from_html` | same parser on HTML you already have | **free** |

### Example

```json
// extract_contacts {"url": "testco.ae", "max_pages": 3, "region": "AE"}
{"result": {
  "site": "testco.ae", "organization": {"name": "Test Co LLC"},
  "emails": [{"email": "ahmed@testco.ae", "source": "text_obfuscated", "role": false, "page": "https://testco.ae/"},
             {"email": "sales@testco.ae", "source": "mailto", "role": true, "page": "https://testco.ae/"}],
  "phones": [{"e164": "+971507654321", "international": "+971 50 765 4321", "region": "AE", "type": "mobile",
              "source": "tel_link", "page": "https://testco.ae/contact-us"}],
  "whatsapp": [{"e164": "+971501234567", "kind": "chat_link", "page": "https://testco.ae/"}],
  "social": {"instagram": [{"url": "https://www.instagram.com/testco_ae", "handle": "testco_ae", "source": "jsonld"}],
             "linkedin":  [{"url": "https://www.linkedin.com/company/testco", "handle": "testco"}]},
  "addresses": [{"street_address": "Office 12", "address_locality": "Dubai", "address_country": "AE", "source": "jsonld"}],
  "summary": {"emails": 4, "personal_emails": 1, "phones": 2, "mobile_phones": 1, "whatsapp": 1, "social_profiles": 4},
  "pages": [{"url": "https://testco.ae/", "status": 200, "ms": 412}, {"url": "https://testco.ae/contact-us", "status": 200, "ms": 388}],
  "billable_pages": 3},
 "data_confidence": "medium",
 "estimated_items": ["items marked source=text were found by pattern matching on visible text, not in explicit markup"],
 "warnings": [], "disclaimer": "Contact details are collected from the website's own public pages ..."}
```

`source` tells you how sure to be: `mailto` / `tel_link` / `jsonld` / `microdata` are explicit; `text` and `text_obfuscated`
were pattern-matched and deserve a glance. `data_confidence` is `high` when everything is explicit.

### Honest limits

- **Static HTML only.** Sites that render their contact details with JavaScript, in images, or behind a form return an
  empty result and a warning (and you pay for the page that was fetched, not for what it lacked).
- **robots.txt is respected** and the bot identifies itself. Some sites block all bots (HTTP 403) — those are reported, not retried
  through proxies. Owners of a site can pass `respect_robots=false`.
- **Public websites only.** The fetcher refuses private / internal addresses and non-web ports by design.
- **Not a consent check.** Finding an address does not make it lawful to email or call it; the response says so.

### Connect

- **Apify:** run from the Console (input form) or Standby URL + `/mcp` with `Authorization: Bearer <your Apify token>`.
- **Self-hosted:** `claude mcp add website-contacts --transport http https://contacts.noahsarch.tech/mcp --header "X-API-Key: <key>"`
- **REST:** `POST https://contacts.noahsarch.tech/v1/tools/extract_contacts`; OpenAPI at `/openapi.json`.

### Built on

[httpx](https://www.python-httpx.org/), [selectolax / lexbor](https://github.com/rushter/selectolax),
[libphonenumber](https://github.com/google/libphonenumber), [schema.org](https://schema.org/Organization), RFC 9309 (robots.txt).

***

### بالعربية

**مستخرج بيانات التواصل من المواقع** — أعطه موقع أي شركة ويعيد لك البريد الإلكتروني، أرقام الهاتف (مُتحقَّق منها، جوال أم أرضي)،
روابط واتساب، حسابات التواصل الاجتماعي (إنستغرام، فيسبوك، إكس، لينكدإن، تيك توك، يوتيوب، تيليغرام…)، والعنوان وبيانات الشركة
من الصفحة الرئيسية وصفحات «اتصل بنا». 0.40 دولار لكل 1000 صفحة؛ الصفحات التي يتعذّر جلبها مجانية. يحترم robots.txt، لا يستخدم
بروكسي ولا ذكاءً اصطناعياً، ولا يخزّن شيئاً. مرّر `region: "AE"` لقراءة الأرقام المحلية بدون رمز الدولة.

# Changelog

This Actor's version history is a separate document: https://apify.com/thenightowl/website-contact-extractor/changelog.md

# Actor input Schema

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

One company website per line (up to 5,000 per run). 'example.com' or full URLs.

## `text` (type: `string`):

Any text; every URL/domain found is processed.

## `max_pages` (type: `integer`):

Homepage plus up to (n-1) contact/about pages. 1 = homepage only (cheapest), 2–3 recommended.

## `region` (type: `string`):

ISO country code (AE, SA, GB, US…) used to read phone numbers written without +country code. Leave empty if sites are international.

## `include_social` (type: `boolean`):

Add social-profile links (Instagram, Facebook, X, LinkedIn, TikTok, YouTube, Telegram…) to each row.

## Actor input object example

```json
{
  "urls": [
    "https://www.emirates.com",
    "https://www.careem.com",
    "https://noahsarch.tech"
  ],
  "max_pages": 2,
  "include_social": true
}
```

# Actor output Schema

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

One row per site.

## `mcpEndpoint` (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://www.emirates.com",
        "https://www.careem.com",
        "https://noahsarch.tech"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("thenightowl/website-contact-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://www.emirates.com",
        "https://www.careem.com",
        "https://noahsarch.tech",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("thenightowl/website-contact-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://www.emirates.com",
    "https://www.careem.com",
    "https://noahsarch.tech"
  ]
}' |
apify call thenightowl/website-contact-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,thenightowl/website-contact-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/Wmg7eITXMBOAA2mYL/builds/EPxh9XSLUMATV8Smk/openapi.json
