# Twitter/X Leads Scraper - Profile Email Finder (`flash_scraper/twitter-leads-scraper`) Actor

Turn X/Twitter searches, hashtags, or handles into contactable author leads — collapse tweets to unique profiles, extract emails from bios + linked sites, follower/verified filters, 0-100 lead score, dedupe, and AI cold openers. Export CSV/JSON.

- **URL**: https://apify.com/flash\_scraper/twitter-leads-scraper.md
- **Developed by:** [Flash Scrape](https://apify.com/flash_scraper) (community)
- **Categories:** Lead generation, Social media, AI
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $14.00 / 1,000 leads

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#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

## Twitter/X Leads Scraper — turn searches and hashtags into contactable author profiles

**Turn X/Twitter into a lead list you can actually email.** Give this actor search terms, hashtags, or @handles and get back **one row per unique author** — not a noisy tweet timeline — with their name, bio, follower count, verified status, website, an **email** found in the bio or on their linked site, an `email_status` flag, and a **0–100 lead score** that sorts the best leads first. Built for B2B cold email, creator and founder outreach, agencies, and recruiters who want contactable people, not raw tweets. **Pay-per-result** — you're charged only for the leads delivered after your filters — and **no X/Twitter login or API key** is needed.

### What it does

- **Searches X/Twitter** for your terms, hashtags, and handles — tweets are fetched through the [`apidojo/tweet-scraper`](https://apify.com/apidojo/tweet-scraper) data provider, so you never supply credentials.
- **Collapses tweets into unique authors**: a two-pass roll-up dedupes every matching tweet down to one row per author handle, and averages likes + retweets + replies across each author's collected tweets into an `engagement_rate` (when the underlying data carries engagement counts).
- **Finds emails from two sources**: it scans each author's **bio text** for inline emails, and (with `enrichEmails` on) visits their **bio-link website** — home, `/contact`, `/contact-us`, and `/about` — to extract real emails plus LinkedIn/Facebook/Twitter links. Link-in-bio pages (Linktree, Beacons, etc.) are resolved one hop further, but only to domains matching the author's own name or handle, so a sponsor's email never contaminates your list.
- **Filters before you pay**: min/max follower bands, verified-only, has-website, has-email.
- **Scores every lead 0–100** — email +40, website +15, follower-band fit up to +15, verified +5, engagement up to +20 — and sorts best-first.
- **Dedupes** by handle, website domain, and email, and **optionally writes an AI cold-opener** per lead using your own OpenAI or Anthropic key (used once per run, never stored).

### Use cases

- **Niche founder outreach** — search *"ai founder"* or *"shopify agency"* and get the people tweeting about your space, with emails.
- **Hashtag communities** — turn `#buildinpublic` into a CSV of contactable indie builders for a launch campaign.
- **Creator partnerships** — filter to 5k–500k followers to find mid-tier creators with real engagement, then pitch collaborations.
- **Recruiting** — find engineers or designers active in a technical hashtag and reach them off-platform by email.
- **CRM enrichment** — feed a list of known @handles and get back emails, websites, and social links for your existing contacts.

### Input

Provide at least one of `searchTerms`, `hashtags`, or `handles`.

| Field | Type | Default | Description |
|---|---|---|---|
| `searchTerms` | array | `["ai founder", "saas indie hacker"]` | Keywords/phrases to search X/Twitter for. Matching tweets are collapsed to their authors. |
| `hashtags` | array | `["buildinpublic"]` | Hashtags (with or without `#`); treated as extra search terms. |
| `handles` | array | — | Specific @handles or profile URLs to pull tweets from, one per line. |
| `maxItems` | integer | `200` | How many **tweets** to fetch before rolling up to unique authors. More tweets = more authors discovered. |
| `minFollowers` | integer | `0` | Keep only authors with at least this many followers (0 = off). |
| `maxFollowers` | integer | `0` | Keep only authors with at most this many followers (0 = no cap). |
| `onlyVerified` | boolean | `false` | Keep only verified profiles. |
| `onlyWithWebsite` | boolean | `false` | Drop authors with no bio link. |
| `onlyWithEmail` | boolean | `false` | Drop authors where no email could be found. |
| `enrichEmails` | boolean | `true` | Visit each author's bio-link website to extract emails and socials. |
| `writeOpeners` | boolean | `false` | Generate a personalized one-sentence AI opener per lead (needs your key below). |
| `llmProvider` | string | `"openai"` | `openai` or `anthropic`. |
| `llmApiKey` | string | — | Your own OpenAI/Anthropic API key. Used only for openers; never stored. |
| `llmModel` | string | — | Optional model override (defaults: `gpt-4o-mini` / `claude-haiku-4-5`). |

```json
{
  "searchTerms": ["ai founder", "saas indie hacker"],
  "hashtags": ["buildinpublic"],
  "maxItems": 200,
  "minFollowers": 1000,
  "onlyWithEmail": true,
  "enrichEmails": true
}
```

### Output

One dataset row per unique author, sorted best lead first. Export to CSV, JSON, or Excel from the Output tab.

```json
{
  "handle": "somefounder",
  "name": "Some Founder",
  "bio": "Building an AI tool for agencies. Ex-Google. hello@somestartup.com",
  "email": "hello@somestartup.com",
  "website": "https://somestartup.com",
  "followers": 24800,
  "verified": true,
  "engagement_rate": 1.8,
  "tweets_seen": 3,
  "profile_url": "https://x.com/somefounder",
  "email_status": "found",
  "lead_score": 90
}
```

When enrichment finds more, rows also carry `extra_emails` (up to 5 additional addresses) and any `linkedin` / `facebook` / `twitter` links found on the author's site. With `writeOpeners` on, each lead gets an `icebreaker` field.

### Pricing

This actor uses Apify **pay-per-event pricing: a fraction of a cent per result — see the Pricing tab** for the exact rate. You're charged **only for the author leads delivered after dedup and your filters** — with `onlyWithEmail` on, authors without an email cost you nothing. No subscription, no charge for empty runs, and the **free Apify plan is enough to try it** on a real search before spending anything.

### Tips / FAQ

**Why authors instead of tweets?** Search results are tweets, but for outreach you need people. Every matching tweet is rolled up to its author, so the dataset is a deduped list of contactable profiles — `tweets_seen` tells you how often each author matched.

**Will every author have an email?** No. X shows public emails for very few accounts; most emails come from bios and linked websites. Authors with no email show `email_status: "missing"` — use `onlyWithEmail` to keep (and pay for) only contactable leads.

**Is `maxItems` the number of leads?** No — it's the number of **tweets scanned** before the author roll-up. 200 tweets might yield anywhere from a handful to ~150 unique authors depending on the query.

**Why is `engagement_rate` sometimes null?** It's computed from like/retweet/reply counts averaged across the author's collected tweets; when the underlying data doesn't include those counts, the field stays null and the lead score simply skips that component.

**Where does the data come from, and what if the source is down?** Tweets come via an upstream data provider (`apidojo/tweet-scraper`). On a transient upstream outage the run ends gracefully with a "temporarily unavailable — please retry" message and **you're charged nothing**.

**Is this legal?** It reads **public** profile and tweet data only. Use the leads for legitimate outreach and follow X's terms plus anti-spam laws (CAN-SPAM, GDPR).

### Related actors

- [LinkedIn Leads Scraper](https://apify.com/flash_scraper/linkedin-leads-scraper) — the same scored-leads approach for LinkedIn profiles
- [Bulk Email Verifier](https://apify.com/flash_scraper/email-verifier) — verify every email before you launch a campaign
- [Email Pattern Finder](https://apify.com/flash_scraper/email-pattern-finder) — guess-and-verify work emails when the bio has none

**Support:** found a bug or need a feature? Open an Issue on this actor's **Issues tab** — typical response within 1 business day.

# Actor input Schema

## `searchTerms` (type: `array`):

Keywords / phrases to search X/Twitter for. Tweets matching these are collapsed to their unique author profiles. e.g. 'ai founder', 'shopify agency'.

## `hashtags` (type: `array`):

Hashtags to search (with or without the #). Treated as additional search terms. e.g. 'buildinpublic', 'saas'.

## `handles` (type: `array`):

Specific @handles / profile URLs to pull tweets from (one per line). e.g. 'naval' or 'https://x.com/naval'.

## `maxItems` (type: `integer`):

How many tweets to fetch before rolling them up to unique authors. More tweets = more unique authors discovered.

## `minFollowers` (type: `integer`):

Keep only authors with at least this many followers (0 = no filter).

## `maxFollowers` (type: `integer`):

Keep only authors with at most this many followers (0 = no cap). Use with min to target nano/micro/macro tiers.

## `onlyVerified` (type: `boolean`):

Keep only verified (blue-check) profiles — usually larger, established accounts.

## `onlyWithWebsite` (type: `boolean`):

Drop authors with no bio link (you can't enrich an email without one).

## `onlyWithEmail` (type: `boolean`):

Drop authors where no email could be found. Best for cold-email campaigns.

## `enrichEmails` (type: `boolean`):

Visit each author's bio-link website (home + /contact + /about) to extract emails and social links. Higher email fill-rate. No key needed.

## `writeOpeners` (type: `boolean`):

Generate a personalized one-sentence outreach opener for each lead. Requires your OpenAI/Anthropic key below.

## `llmProvider` (type: `string`):

AI provider used to write the cold openers — OpenAI (GPT) or Anthropic (Claude). Use the provider that matches the LLM API key you supply.

## `llmApiKey` (type: `string`):

Your own OpenAI or Anthropic API key. Used only to write the openers; never stored.

## `llmModel` (type: `string`):

Override the default model (gpt-4o-mini for OpenAI, claude-haiku-4-5-20251001 for Anthropic).

## Actor input object example

```json
{
  "searchTerms": [
    "growth marketer"
  ],
  "hashtags": [
    "saas"
  ],
  "handles": [
    "naval"
  ],
  "maxItems": 200,
  "minFollowers": 0,
  "maxFollowers": 0,
  "onlyVerified": false,
  "onlyWithWebsite": false,
  "onlyWithEmail": false,
  "enrichEmails": true,
  "writeOpeners": false,
  "llmProvider": "openai"
}
```

# 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 = {
    "searchTerms": [
        "ai founder",
        "saas indie hacker"
    ],
    "hashtags": [
        "buildinpublic"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("flash_scraper/twitter-leads-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 = {
    "searchTerms": [
        "ai founder",
        "saas indie hacker",
    ],
    "hashtags": ["buildinpublic"],
}

# Run the Actor and wait for it to finish
run = client.actor("flash_scraper/twitter-leads-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 '{
  "searchTerms": [
    "ai founder",
    "saas indie hacker"
  ],
  "hashtags": [
    "buildinpublic"
  ]
}' |
apify call flash_scraper/twitter-leads-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/lWsAO1tHF9UF65oWy/builds/MJZp5yIZcFE7bmNKM/openapi.json
