# X (Twitter) Email Scraper (`email_scraper/x-twitter-email-scraper`) Actor

Scrape publicly available email addresses and profile data from X (Twitter) with the X (Twitter) Email Scraper. Extract emails from public profiles efficiently for lead generation, prospecting, research, and social media data collection.

- **URL**: https://apify.com/email\_scraper/x-twitter-email-scraper.md
- **Developed by:** [Email Scraper](https://apify.com/email_scraper) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.49 / 1,000 results

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

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

### X (Twitter) Email Scraper Overview

The **X (Twitter) Email Scraper** is an Apify Actor designed to discover email addresses that are publicly surfaced in Google search results pointing to X (Twitter) profiles. It searches `site:x.com` for your chosen keywords and email-domain suffixes, optionally adds a country, state, or city filter, parses organic search results, and pushes unique email leads into an Apify dataset.

The **X (Twitter) Email Scraper** is built for contact discovery, lead research, market research, audience research, and other workflows where publicly indexed X (Twitter) profile descriptions may contain an email address. It does not log in to X, and the implementation targets information exposed through Google SERP snippets.

With the **X (Twitter) Email Scraper**, you can provide one or many search keywords, one or many email-domain suffixes, an optional location, and optional exclusion words. The Actor then works through each keyword and domain combination, collecting matching email addresses when they appear in parsed search snippets.

### X (Twitter) Email Scraper Features

The **X (Twitter) Email Scraper** focuses on a simple search-to-dataset workflow:

- **Keyword-based discovery:** Search X (Twitter) pages using terms such as `skincare`, `fitness coach`, or other niche-specific queries.
- **Multiple keyword support:** Submit a list of keywords and process them one by one.
- **Domain filtering:** Target suffixes such as `@gmail.com`, `@yahoo.com`, `@outlook.com`, or business domains.
- **Location targeting:** Add a country, state, or city to narrow the search query.
- **Exclude-word filtering:** Skip a complete result snippet when its description contains a configured excluded word or phrase.
- **Unique email collection:** Previously seen email addresses are tracked so duplicate addresses are not pushed again.
- **Incremental dataset output:** Matching records are pushed to the Apify dataset during the run.
- **Resume state:** Progress and the already-seen email set are stored in the Apify key-value store, allowing the Actor to resume its cursor after an interruption.

### How to Use the X (Twitter) Email Scraper

The **X (Twitter) Email Scraper** starts from the input object defined in `actor.json`. The required input is `keywords`. You can enter one or many keywords, while the other filters refine the search.

For each keyword and domain pair, the **X (Twitter) Email Scraper** builds a search query in the form `site:x.com [keyword] "[domain]"`. When a location is supplied, that location is also added to the query.

The implementation paginates Google results and uses a dedicated Apify `GOOGLE_SERP` proxy group. Each request has retry behavior, and the proxy URL can rotate after a failed attempt.

### X (Twitter) Email Scraper Data Extraction

The **X (Twitter) Email Scraper** extracts email addresses from the description text of organic Google search results that match the requested domain suffix. It also stores context from the result so you can understand where an address came from.

The Actor pushes these fields for every accepted result:

| Field         | Type   | Description                                                           |
| ------------- | ------ | --------------------------------------------------------------------- |
| `network`     | string | Identifies the source as `X (Twitter).com`.                           |
| `keyword`     | string | The keyword used for the search combination that produced the result. |
| `title`       | string | The parsed title of the Google organic result.                        |
| `description` | string | The parsed description/snippet associated with the result.            |
| `url`         | string | The URL extracted from the Google result.                             |
| `email`       | string | The unique email address extracted from the result description.       |

The **X (Twitter) Email Scraper** uses a domain-aware regular expression, so only addresses containing one of the configured suffixes are considered. Email addresses are deduplicated globally within the run through a persistent set.

The default Apify dataset view is configured to display `keyword`, `title`, `description`, `url`, and `email` as the main table columns. The implementation also pushes `network`, so it is part of the dataset record even though the default transformed view does not list it.

### X (Twitter) Email Scraper Use Cases

The **X (Twitter) Email Scraper** can support several practical research workflows when the required contact information is publicly indexed.

#### Lead Generation

Use targeted keywords such as job roles, professions, niches, or interests to identify public email contacts associated with X (Twitter) search results.

#### Market Research

Collect search-result context and email addresses for niche research. Combining several related queries can help explore different segments of the same market.

#### Competitor and Audience Research

Search for terms related to an industry, product category, or community and inspect the resulting X (Twitter) profile context. The saved URL and description provide useful reference information.

#### CRM Enrichment

The **X (Twitter) Email Scraper** can provide publicly indexed email contacts for downstream data workflows. Use the structured dataset fields to review and transform the records before importing them into another system.

#### Content and Academic Research

Researchers can use keyword and location combinations to investigate publicly indexed profiles and contact details relevant to a study or topic.

### X (Twitter) Email Scraper Input

| Input           | Type             | Required | Default                     | Description                                                                                    |
| --------------- | ---------------- | -------- | --------------------------- | ---------------------------------------------------------------------------------------------- |
| `keywords`      | array of strings | Yes      | `["skincare", "cosmetics"]` | Keywords or queries used to search for X (Twitter) results.                                    |
| `location`      | string           | No       | `""`                        | Optional country, state, or city used to narrow the Google search.                             |
| `customDomains` | array of strings | No       | `["@gmail.com"]`            | Email-domain suffixes to match, such as `@gmail.com` or `@outlook.com`.                        |
| `maxEmails`     | integer          | No       | `10`                        | Maximum email target applied to each keyword + domain combination. Input range is 1 to 10,000. |
| `excludeWords`  | array of strings | No       | `[]`                        | Words or phrases that cause a matching result snippet to be skipped.                           |

The **X (Twitter) Email Scraper** treats `keywords` as the primary search input. More specific combinations generally produce more focused search queries than a single broad term.

For `excludeWords`, single terms are matched case-insensitively as whole words, while phrases are matched as case-insensitive substrings. If an exclusion matches the result description, the entire snippet is skipped before email extraction.

### X (Twitter) Email Scraper Input Strategy

For better targeting, use several closely related keywords instead of relying on a single broad term. For example, a fitness research run might use `Fitness Coach`, `Fitness Influencer`, `Fitness Trainer`, and `Online Fitness Coach`.

On Apify's free tier, the implementation can reduce a requested maximum above 100 to a 100-email run-wide ceiling. Paid-user detection is handled by the runtime environment. Local runs are treated as paid/unlimited by the code.

### X (Twitter) Email Scraper Output

The **X (Twitter) Email Scraper** returns structured records in the Apify dataset as soon as matching addresses are found. This incremental approach means records are not held until the very end of the run before being pushed.

A typical record looks like this:

```json
{
  "network": "X (Twitter).com",
  "keyword": "fitness coach",
  "title": "Example X profile",
  "description": "Fitness coach ... contact: coach@example.com",
  "url": "https://x.com/example",
  "email": "coach@example.com"
}
```

### Example Input

```json
{
  "keywords": [
    "fitness coach",
    "fitness influencer",
    "online fitness coach"
  ],
  "location": "New york",
  "customDomains": [
    "@gmail.com",
    "@yahoo.com"
  ],
  "maxEmails": 20,
  "excludeWords": [
    "crypto",
    "onlyfans"
  ]
}
```

### Example Output

```json
{
  "network": "X (Twitter).com",
  "keyword": "fitness coach",
  "title": "Example Fitness Coach | X",
  "description": "Fitness coach and creator. Email: coach@example.com",
  "url": "https://x.com/example",
  "email": "coach@example.com"
}
```

### X (Twitter) Email Scraper Pagination and Stopping Behavior

The **X (Twitter) Email Scraper** can paginate through Google result pages for each keyword-domain pair. The implementation allows up to 1,000 result pages per pair, but it may stop earlier based on result quality, empty pages, extraction yield, or request failures.

The collector stops after three consecutive pages with no new emails. After page 25, it also stops when there are two consecutive empty-result pages or when the latest five pages yield fewer than five emails combined.

A pair can also stop after repeated request failures. The SERP fetcher retries with a rotated proxy, and three consecutive hard failure cycles cause the current pair to stop.

### X (Twitter) Email Scraper Data Quality and Reliability

The **X (Twitter) Email Scraper** works from public Google search-result data rather than authenticated X (Twitter) account access. As a result, coverage depends on what Google indexes and exposes in its organic snippets at the time of the run.

The scraper parses the result title, URL, and description, then searches the description for addresses matching the configured email suffixes. A description can contain several addresses, although the persistent tracker prevents the same email from being pushed more than once during the run.

The stored state contains the seen-email set and the current keyword/domain cursor, helping the Actor continue from its saved position after an interruption.

### Search Intent and SEO-Friendly Query Design

The **X (Twitter) Email Scraper** is designed around search intent: finding publicly indexed X (Twitter) profile results that contain an email address matching a chosen domain suffix.

Useful search strategies combine a specific topic, role, audience, product, or profession with the desired email domain. Location filters can narrow broad searches, while multiple related keywords can broaden discovery without abandoning the target niche.

### X (Twitter) Email Scraper API and Automation

The **X (Twitter) Email Scraper** runs as an Apify Actor and writes results to its dataset while using the Apify key-value store for resume state.

The **X (Twitter) Email Scraper** does not define a custom external API in the supplied code. API access, scheduling, and external orchestration should therefore use the standard capabilities provided by the Apify platform rather than assumptions about a separate scraper endpoint.

### X (Twitter) Email Scraper FAQs

#### What does this X (Twitter) scraper do?

The **X (Twitter) Email Scraper** is an Apify Actor that searches Google for X (Twitter) results matching your keywords and configured email domains, then extracts matching addresses from result descriptions.

#### How does the X (Twitter) Email Scraper find emails?

It builds Google queries using `site:x.com`, your keyword, and an email-domain suffix. The Actor parses organic result snippets and applies an email-matching regular expression to the description text.

#### Can I search multiple keywords?

Yes. The **X (Twitter) Email Scraper** accepts a string array for `keywords` and processes the entries one by one.

#### Can I use multiple email domains?

Yes. Add multiple suffixes to `customDomains`. Each keyword-domain pair is treated as its own search target.

#### Can I target a city or country?

Yes. Enter a country, state, or city in `location`. The value is added to the Google query as an additional search term.

#### What happens when an exclude word matches?

The **X (Twitter) Email Scraper** skips the complete result snippet when an excluded word or phrase appears in the parsed description. It does not extract an email from that skipped snippet.

#### Is `maxEmails` a run-wide limit?

No. In the main collection loop, the value is applied independently to each keyword-domain pair. The available output can still be lower because the scraper only collects publicly indexed matching addresses and deduplicates emails.

#### Does the Actor guarantee the requested number of emails?

No. The **X (Twitter) Email Scraper** can only return addresses exposed in the search results it can retrieve. Empty results, low-yield pages, filtering, duplicate addresses, or request failures can reduce the final count.

#### Is X (Twitter) login required?

No X (Twitter) login is implemented in the supplied code. The Actor searches Google and extracts information from publicly indexed result snippets.

#### Does the scraper use a proxy?

Yes. The **X (Twitter) Email Scraper** initializes an Apify `GOOGLE_SERP` proxy and can rotate the proxy URL when a request attempt fails.

#### Are duplicate emails removed?

Yes. The Actor keeps a persistent set of seen email addresses and only pushes a new email once during the run state being tracked.

#### What fields are returned?

The **X (Twitter) Email Scraper** pushes `network`, `keyword`, `title`, `description`, `url`, and `email`. The default dataset view displays the last five fields except `network`.

#### Can a run resume after interruption?

The Actor persists the current cursor and the seen-email set in an Apify key-value store. This allows later execution to use the saved progress state.

### Why Use the X (Twitter) Email Scraper

The **X (Twitter) Email Scraper** turns a list of research terms into a structured contact-discovery workflow without requiring manual review of every search result.

Its main advantage is controlled targeting. You choose the keywords, email domains, location, exclusion words, and per-combination target. The Actor then applies those settings consistently across its search matrix.

The **X (Twitter) Email Scraper** also includes operational safeguards such as proxy rotation, request retries, pagination stopping rules, duplicate tracking, and persisted progress. These features help keep long-running searches organized while avoiding unnecessary low-yield pagination.

### X (Twitter) Email Scraper Support

For issues, input questions, or custom requirements, use the Actor's Apify support/discussion channels and the contact address provided in its configuration: **<alphascraper69@gmail.com>**.

When reporting a problem with the **X (Twitter) Email Scraper**, include the input you used, the relevant run ID, and a short description of the observed behavior. This makes it easier to reproduce and troubleshoot search or extraction issues.

# Actor input Schema

## `keywords` (type: `array`):

A list of keywords or queries to search for.

## `location` (type: `string`):

Optional country, state or city used to narrow the search. Leave it empty to search without a geographic filter.

## `customDomains` (type: `array`):

List of custom email domains

## `maxEmails` (type: `integer`):

How many addresses each search keyword + domain suffix combination may collect before the finder moves on to the next one. This is a per-combination target, not a run-wide total: with 3 keyword and 2 Domains and a limit of 20, the run works through all 6 combinations and aims for up to 20 addresses in each, so up to 120 overall. Lower values finish sooner and cost less; higher values dig deeper but never guarantee a fuller result, since the run can only find what is publicly listed.

## `excludeWords` (type: `array`):

Words or phrases you do not want to see.

## Actor input object example

```json
{
  "keywords": [
    "skincare",
    "cosmetics",
    "Supplier"
  ],
  "location": "New york",
  "customDomains": [
    "@gmail.com"
  ],
  "maxEmails": 10,
  "excludeWords": []
}
```

# Actor output Schema

## `dataset` (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 = {
    "keywords": [
        "skincare",
        "cosmetics",
        "Supplier"
    ],
    "location": "New york",
    "customDomains": [
        "@gmail.com"
    ],
    "excludeWords": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("email_scraper/x-twitter-email-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 = {
    "keywords": [
        "skincare",
        "cosmetics",
        "Supplier",
    ],
    "location": "New york",
    "customDomains": ["@gmail.com"],
    "excludeWords": [],
}

# Run the Actor and wait for it to finish
run = client.actor("email_scraper/x-twitter-email-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 '{
  "keywords": [
    "skincare",
    "cosmetics",
    "Supplier"
  ],
  "location": "New york",
  "customDomains": [
    "@gmail.com"
  ],
  "excludeWords": []
}' |
apify call email_scraper/x-twitter-email-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,email_scraper/x-twitter-email-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/CdOWuUWjnrPehC21l/builds/oBAySZUf1z7vye9QB/openapi.json
