# Website Email, Phone Number, Social Links & Link Scraper (`whoareyouanas/website-link-scraper`) Actor

Scrape emails, phone numbers, social links, internal links, external links, images, and files from websites page-wise with low-cost HTTP crawling.

- **URL**: https://apify.com/whoareyouanas/website-link-scraper.md
- **Developed by:** [Anas Nadeem](https://apify.com/whoareyouanas) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

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

## Website Email, Phone Number, Social Links & Link Scraper

Low-cost Apify Actor to scrape websites page-wise and extract:

- emails
- phone numbers
- social links
- internal/external links
- image URLs
- file URLs (PDF, DOCX, CSV, ZIP, etc.)

It supports two output modes:

- `full` - one dataset item per crawled page with complete extracted data
- `emails_only` - one dataset item per unique email (compatible with common email-only workflows)

Each run also emits:

- one `seed_summary` row per input seed URL
- one `run_summary` row with global totals

### Why this Actor

- HTTP-first crawling (`crawlerType: "http"`) for cheaper runs
- optional browser mode (`crawlerType: "browser"`) for JS-heavy pages
- shallow crawling with `maxDepth` and `maxPages` to keep spend predictable
- include/exclude URL globs for crawl control

### Input

Core fields:

- `startUrls` (required)
- `mode` (`full` | `emails_only`)
- `crawlerType` (`http` | `browser`)
- `maxPages`, `maxDepth`
- `sameDomainOnly`, `includeSubdomains`
- `includeUrlGlobs`, `excludeUrlGlobs`
- `extractEmails`, `extractPhones`, `extractSocial`, `extractImages`, `extractFiles`, `extractLinks`

See `.actor/input_schema.json` for the full schema.

### Output examples

#### Full mode row

```json
{
  "recordType": "page",
  "seedUrl": "https://example.com/",
  "pageUrl": "https://example.com/contact",
  "depth": 1,
  "statusCode": 200,
  "title": "Contact",
  "emails": ["hello@example.com"],
  "phoneNumbers": ["+12025550123"],
  "socialLinks": {
    "linkedin": [],
    "x": [],
    "facebook": [],
    "instagram": [],
    "youtube": [],
    "tiktok": [],
    "threads": [],
    "telegram": [],
    "whatsapp": [],
    "discord": [],
    "pinterest": [],
    "reddit": [],
    "github": []
  },
  "internalLinks": [],
  "externalLinks": [],
  "images": [],
  "files": [],
  "counts": {
    "emails": 1,
    "phoneNumbers": 1,
    "socialLinks": 0,
    "internalLinks": 0,
    "externalLinks": 0,
    "images": 0,
    "files": 0
  }
}
````

#### Emails-only row

````json
{
  "recordType": "email",
  "seedUrl": "https://example.com/",
  "url": "https://example.com/contact",
  "email": "hello@example.com",
  "depth": 1,
  "statusCode": 200
}

#### Seed summary row

```json
{
  "recordType": "seed_summary",
  "seedUrl": "https://example.com/",
  "mode": "full",
  "crawlerType": "http",
  "pagesCrawled": 14,
  "failedRequests": 1,
  "uniqueEmails": 6,
  "statusCodeHistogram": {
    "200": 13,
    "404": 1
  },
  "totals": {
    "emails": 9,
    "phoneNumbers": 4,
    "socialLinks": 11,
    "internalLinks": 173,
    "externalLinks": 42,
    "images": 88,
    "files": 7
  }
}
````

#### Run summary row

```json
{
  "recordType": "run_summary",
  "mode": "full",
  "crawlerType": "http",
  "seedsTotal": 3,
  "pagesCrawled": 39,
  "failedRequests": 2,
  "uniqueEmails": 15,
  "totals": {
    "emails": 24,
    "phoneNumbers": 11,
    "socialLinks": 29,
    "internalLinks": 513,
    "externalLinks": 126,
    "images": 244,
    "files": 19
  },
  "durationMs": 5841
}
```

````

### Local development

```bash
npm install
npm run build
npm run dev
npm test
````

### Notes

- Invalid start URLs are skipped with a warning.
- 4xx/5xx pages may produce no data but do not crash the whole run.
- Use `sameDomainOnly: true` for cost-efficient, controlled crawls.

# Actor input Schema

## `startUrls` (type: `array`):

Seed URLs to crawl.

## `mode` (type: `string`):

Use `full` for page-wise link intelligence or `emails_only` for one row per email.

## `crawlerType` (type: `string`):

HTTP is cheaper and faster. Browser handles heavy JS websites.

## `maxPages` (type: `integer`):

Maximum number of pages to process.

## `maxDepth` (type: `integer`):

How deep to follow links from each start URL.

## `sameDomainOnly` (type: `boolean`):

If enabled, crawler follows only links from the same domain as each seed URL.

## `includeSubdomains` (type: `boolean`):

Treat subdomains as internal when same-domain crawling is enabled.

## `includeUrlGlobs` (type: `array`):

If non-empty, only URLs matching at least one glob are crawled.

## `excludeUrlGlobs` (type: `array`):

URLs matching any glob are skipped.

## `extractLinks` (type: `boolean`):

Extract and classify internal and external page links.

## `extractEmails` (type: `boolean`):

Extract email addresses from page content and mailto links.

## `extractPhones` (type: `boolean`):

Extract phone numbers from tel links and page text.

## `extractSocial` (type: `boolean`):

Extract profile links for major social platforms.

## `extractImages` (type: `boolean`):

Extract image URLs from page markup and metadata.

## `extractFiles` (type: `boolean`):

Extract downloadable file links such as PDFs, docs, and archives.

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

Maximum number of parallel requests while crawling.

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

Timeout in seconds for each page request.

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

Optional proxy settings. Leave empty for direct connections.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://whoareyouanas.com/"
    }
  ],
  "mode": "full",
  "crawlerType": "http",
  "maxPages": 200,
  "maxDepth": 2,
  "sameDomainOnly": true,
  "includeSubdomains": false,
  "includeUrlGlobs": [],
  "excludeUrlGlobs": [],
  "extractLinks": true,
  "extractEmails": true,
  "extractPhones": true,
  "extractSocial": true,
  "extractImages": true,
  "extractFiles": true,
  "maxConcurrency": 25,
  "requestTimeoutSecs": 20
}
```

# 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 = {
    "startUrls": [
        {
            "url": "https://whoareyouanas.com/"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("whoareyouanas/website-link-scraper").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 = { "startUrls": [{ "url": "https://whoareyouanas.com/" }] }

# Run the Actor and wait for it to finish
run = client.actor("whoareyouanas/website-link-scraper").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 '{
  "startUrls": [
    {
      "url": "https://whoareyouanas.com/"
    }
  ]
}' |
apify call whoareyouanas/website-link-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=whoareyouanas/website-link-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Website Email, Phone Number, Social Links & Link Scraper",
        "description": "Scrape emails, phone numbers, social links, internal links, external links, images, and files from websites page-wise with low-cost HTTP crawling.",
        "version": "0.1",
        "x-build-id": "CAzw7Ii9ZrdDRmeMg"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/whoareyouanas~website-link-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-whoareyouanas-website-link-scraper",
                "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/whoareyouanas~website-link-scraper/runs": {
            "post": {
                "operationId": "runs-sync-whoareyouanas-website-link-scraper",
                "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/whoareyouanas~website-link-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-whoareyouanas-website-link-scraper",
                "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",
                "required": [
                    "startUrls"
                ],
                "properties": {
                    "startUrls": {
                        "title": "Start URLs",
                        "type": "array",
                        "description": "Seed URLs to crawl.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "mode": {
                        "title": "Output mode",
                        "enum": [
                            "full",
                            "emails_only"
                        ],
                        "type": "string",
                        "description": "Use `full` for page-wise link intelligence or `emails_only` for one row per email.",
                        "default": "full"
                    },
                    "crawlerType": {
                        "title": "Crawler type",
                        "enum": [
                            "http",
                            "browser"
                        ],
                        "type": "string",
                        "description": "HTTP is cheaper and faster. Browser handles heavy JS websites.",
                        "default": "http"
                    },
                    "maxPages": {
                        "title": "Max pages",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of pages to process.",
                        "default": 200
                    },
                    "maxDepth": {
                        "title": "Max depth",
                        "minimum": 0,
                        "type": "integer",
                        "description": "How deep to follow links from each start URL.",
                        "default": 2
                    },
                    "sameDomainOnly": {
                        "title": "Same domain only",
                        "type": "boolean",
                        "description": "If enabled, crawler follows only links from the same domain as each seed URL.",
                        "default": true
                    },
                    "includeSubdomains": {
                        "title": "Include subdomains",
                        "type": "boolean",
                        "description": "Treat subdomains as internal when same-domain crawling is enabled.",
                        "default": false
                    },
                    "includeUrlGlobs": {
                        "title": "Include URL globs",
                        "type": "array",
                        "description": "If non-empty, only URLs matching at least one glob are crawled.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "excludeUrlGlobs": {
                        "title": "Exclude URL globs",
                        "type": "array",
                        "description": "URLs matching any glob are skipped.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "extractLinks": {
                        "title": "Extract links",
                        "type": "boolean",
                        "description": "Extract and classify internal and external page links.",
                        "default": true
                    },
                    "extractEmails": {
                        "title": "Extract emails",
                        "type": "boolean",
                        "description": "Extract email addresses from page content and mailto links.",
                        "default": true
                    },
                    "extractPhones": {
                        "title": "Extract phone numbers",
                        "type": "boolean",
                        "description": "Extract phone numbers from tel links and page text.",
                        "default": true
                    },
                    "extractSocial": {
                        "title": "Extract social links",
                        "type": "boolean",
                        "description": "Extract profile links for major social platforms.",
                        "default": true
                    },
                    "extractImages": {
                        "title": "Extract image URLs",
                        "type": "boolean",
                        "description": "Extract image URLs from page markup and metadata.",
                        "default": true
                    },
                    "extractFiles": {
                        "title": "Extract file URLs",
                        "type": "boolean",
                        "description": "Extract downloadable file links such as PDFs, docs, and archives.",
                        "default": true
                    },
                    "maxConcurrency": {
                        "title": "Max concurrency",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of parallel requests while crawling.",
                        "default": 25
                    },
                    "requestTimeoutSecs": {
                        "title": "Request timeout (secs)",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Timeout in seconds for each page request.",
                        "default": 20
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Optional proxy settings. Leave empty for direct connections."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
