# Website Contact Scraper - AI-Powered Lead Finder (`timo.sieber/website-lead-scraper`) Actor

AI-powered website scraper that extracts real contact data from company sites! Finds people, positions, emails & phone numbers using LLM technology. Scans team pages, contact sections & company info. Perfect for B2B lead generation and sales research.

- **URL**: https://apify.com/timo.sieber/website-lead-scraper.md
- **Developed by:** [Timo Sieber](https://apify.com/timo.sieber) (community)
- **Categories:** Lead generation, AI, Agents
- **Stats:** 60 total users, 3 monthly users, 0.0% runs succeeded, 8 bookmarks
- **User rating**: No ratings yet

## Pricing

$55.00 / 1,000 results

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## LLM-Guided Corporate Website Scraper

An advanced Apify actor that uses LLMs (Large Language Models) to identify and extract high-value business contact information from corporate websites.

### 🚀 Overview

This scraper goes far beyond traditional crawling. It:

- Uses GPT (OpenAI) to intelligently **rank internal URLs** based on their relevance to contact data
- Maximizes **content extraction**, including hidden and modal content
- Parses and validates contact fields using LLMs and custom regex preprocessing
- Aggregates data across multiple pages for higher confidence

### 💡 Key Features

- 🧰 **LLM-based URL Evaluation**: Scores and selects only the most promising URLs per domain
- 🔍 **Maximum Content Extraction**: Scrapes visible and hidden elements, emails, phone numbers, and text sections
- 🔧 **Custom Prompt Engineering**: Tailored prompts for URL scoring and field extraction
- 📊 **Smart Aggregation**: Merges multiple extractions into one confident, enriched result per domain
- 🚪 **Resilient Parsing**: Handles edge cases, malformed responses, and fallback scoring
- ✅ **GDPR-friendly Proxy Support**: With optional German residential proxies

### ⚙️ Input

This actor expects the following input:

```json
{
  "urls": ["https://example.com/"],
  "openaiApiKey": "sk-...",
  "maxRequests": 50,
  "useProxy": true,
  "enableUrlEvaluation": true,
  "aggregateResults": true,
  "includeExtendedFields": true,
  "costLimit": 1.0
}
```

### 🔄 Workflow

1. **Main page is loaded**
2. LLM evaluates internal links for contact relevance
3. Top N URLs are crawled (contact, impressum, team, etc.)
4. Content is extracted (even from modals, hidden fields, footers)
5. Text is preprocessed for LLM efficiency
6. LLM parses the data into a structured JSON object
7. Data is validated, weighted, and aggregated into one high-confidence result

### 🌐 Output Format

Each record pushed to the dataset contains:

```json
{
  "executive_name": "Max Mustermann",
  "executive_title": "Geschäftsführer",
  "company_email": "info@example.com",
  "company_phone": "+41 44 123 45 67",
  "company_address": "Musterstrasse 1, 8000 Zürich",
  "confidence_score": 0.92,
  "sources": [...],
  "aggregated_from_pages": 6,
  "domain": "example.com"
}
```

### 📈 Performance & Cost

- Average ~40 websites for 0.07 $ (at gpt-3.5-turbo rates)
- Each domain result is based on up to 8 evaluated subpages
- Internal cost tracking included

### 🔐 Notes

- Requires valid OpenAI API key (gpt-3.5-turbo)
- Proxy use is optional, but recommended for stable scraping
- Works well for DE/CH/Austria-based companies (Impressum detection)

### 🚪 Limitations

- Not optimized for dynamic SPAs
- Some LLM responses may still need fallback handling (included)

### 🚧 Future Improvements

- Add multilingual prompt switching (based on `targetLanguage` input)
- Upgrade to gpt-4-turbo for more robust data quality
- Add custom scoring model for aggregation weighting

***

🌟 **Created by Timo Sieber — for smarter, LLM-powered scraping at scale.**

# Actor input Schema

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

Liste der zu scrapenden Unternehmenswebseiten URLs

## `openaiApiKey` (type: `string`):

Ihr OpenAI API Key für GPT-3.5 Turbo

## `maxRequests` (type: `integer`):

Maximale Anzahl der zu verarbeitenden Hauptwebseiten

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

Anzahl gleichzeitiger Browser-Instanzen

## `useProxy` (type: `boolean`):

Aktiviert Proxies für höhere Erfolgsraten

## `targetLanguage` (type: `string`):

Sprache für die Datenextraktion

## `debugMode` (type: `boolean`):

Aktiviert erweiterte Logs

## `maxPagesPerDomain` (type: `integer`):

Maximale Anzahl Unterseiten die pro Website gescrapt werden

## `minUrlScore` (type: `integer`):

Mindest-LLM-Bewertung für URLs (30-100)

## `enableUrlEvaluation` (type: `boolean`):

Aktiviert LLM-basierte Bewertung aller gefundenen URLs

## `includeExtendedFields` (type: `boolean`):

Extrahiert zusätzliche Felder: Mobile, Fax, Adresse

## `aggregateResults` (type: `boolean`):

Kombiniert Daten von mehreren Unterseiten

## `industry` (type: `string`):

Branchenspezifische Optimierung

## `extractionFocus` (type: `string`):

Schwerpunkt der Kontaktdaten-Extraktion

## `costLimit` (type: `integer`):

Stoppt bei diesem OpenAI-Kostenlimit

## Actor input object example

```json
{
  "maxRequests": 50,
  "maxConcurrency": 2,
  "useProxy": false,
  "targetLanguage": "deutsch",
  "debugMode": false,
  "maxPagesPerDomain": 8,
  "minUrlScore": 40,
  "enableUrlEvaluation": true,
  "includeExtendedFields": true,
  "aggregateResults": true,
  "industry": "generic",
  "extractionFocus": "comprehensive",
  "costLimit": 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("timo.sieber/website-lead-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("timo.sieber/website-lead-scraper").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 '{}' |
apify call timo.sieber/website-lead-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,timo.sieber/website-lead-scraper"
        }
    }
}

```

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/uPPwfZwnfXL3ZlzhO/builds/dJs9ww8Pz5bm1viEK/openapi.json
