# Twitter Profile Scraper With Contact Email (`api-empire/twitter-profile-scraper`) Actor

Twitter Profile Scraper: Extract profile details including usernames, bios, follower counts, websites, profile URLs, and publicly available contact emails. Build enriched datasets for lead generation, influencer research, prospecting, audience analysis, and social media intelligence.

- **URL**: https://apify.com/api-empire/twitter-profile-scraper.md
- **Developed by:** [API Empire](https://apify.com/api-empire) (community)
- **Categories:** Automation, Lead generation, Social media
- **Stats:** 7 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.99 / 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.

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

### Twitter Scraper — Extract Tweets, Bio Emails and Media as JSON

This actor scrapes public Twitter/X profiles for tweets, replies, and an optional lead-profile record, then enriches every row with a bio-extracted contact email, expanded bio/website links, a likely-business-account flag, and full media asset variants — best-quality video, image size maps, and GIF detection. No Twitter/X login is required for the core scrape. Every response returns typed, normalized JSON — no HTML, no selectors, no parsing — so an agent or pipeline can consume it directly. After this page, you'll know every input option and output field this actor exposes.

### What is Twitter Profile Scraper With Contact Email?

Twitter Profile Scraper With Contact Email is an Apify actor that pulls tweets and replies from any public Twitter/X profile and turns the same already-fetched response into lead-generation data: a regex-matched bio email, resolved bio/website links, a likely-business-account heuristic, and fully resolved media assets (best-quality video URL, image size variants, GIF flag). No Twitter/X account or login is required for the core tweet/media/lead-signal scrape — login cookies are only needed if you turn on reply scraping.

- Scrape tweets and replies from any public profile URL or handle
- Extract bio contact and lead signals (`bioEmail`, `profileWebsiteUrl`, `bioExpandedLinks`, `isLikelyBusinessAccount`)
- Resolve full media asset variants (best-quality video, image size map, GIF flag) with no separate download step
- Emit an optional lead-profile ("about") record per user
- Export results as JSON, CSV, Excel, or other Apify dataset formats — no proxy setup required to get started

### What data does Twitter Profile Scraper With Contact Email collect?

The actor returns four kinds of data from a single run: tweet content, bio-derived lead signals, resolved media assets, and (optionally) a per-user lead-profile record.

| Data Type | Key Fields | JSON Field Names |
| --- | --- | --- |
| Tweets & replies | text, timestamp, engagement counts, tweet URL | `full_text`, `created_at`, `favorite_count`, `retweet_count`, `reply_count`, `tweetUrl` |
| Bio contact & lead signals | bio email, resolved links, business-account flag | `bioEmail`, `profileWebsiteUrl`, `bioExpandedLinks`, `isLikelyBusinessAccount`, `businessAccountSignals` |
| Media assets | best-quality video, image size variants, GIF flag | `mediaAssets`, `hasVideo`, `hasGif`, `mediaCount` |
| Lead profile ("about") records | profile identity, verification, professional metadata | `screen_name`, `rest_id`, `verification`, `professional`, `profile_bio`, `aboutData` |

#### Need more Twitter (X) data?

This is currently the only Twitter/X scraper published under the API-Empire account — there is no separate hashtag, search, or trends actor to cross-sell here. If you need tweet or reply data beyond what a profile-by-profile crawl covers, the input's `handles`/`profileUrls` list already accepts as many profiles as you want to scan in one run.

### How does Twitter Profile Scraper With Contact Email differ from the official X (Twitter) API?

X's own API requires a developer account and, since the platform moved to paid, tiered access in 2023, most useful read access sits behind paid tiers with per-endpoint rate limits and monthly post-consumption caps; this actor runs directly from a profile URL or handle with no developer application at all.

| Feature | X (Twitter) API | Twitter Profile Scraper With Contact Email |
| --- | --- | --- |
| Access approval | Requires a developer account and, for most useful read access, a paid tier | Runs immediately from a profile URL or handle — no application |
| Historical/full-archive access | Deeper historical search is gated to higher access levels | Reads whatever the profile's own timeline currently serves, page by page |
| Rate limits | Per-endpoint request caps on rolling windows, plus monthly post-read/consumption caps | Bound by x.com's own request limits; Apify Proxy is recommended for reliability against them |
| Bio lead signals (email, business flag) | Not a native field — the raw profile object must be parsed by your own code | Computed automatically for every row when `extractBioContacts` is on |
| Media resolution (best video, size variants) | Returned as raw variant arrays; the caller picks the best one | Resolved automatically into `bestVideoUrl` / `imageVariants` when `includeMediaVariants` is on |
| Setup time | Developer application, tier selection, billing setup | Enter a profile URL or handle and start the run |

If you already hold an approved X developer account and need first-party guarantees, the official API is the right tool. If you want profile-level tweet, reply, bio-lead, and media data as structured JSON without an approval process, this actor returns the same public data with no application step.

### Why do developers and teams scrape X (Twitter)?

#### For lead generation and outreach teams

Sales and growth teams use this actor to turn a list of target profiles into a lead sheet without opening each one by hand: run it with `emitLeadProfile` on and `extractBioContacts` on, and every profile returns a record carrying `bioEmail`, `profileWebsiteUrl`, `bioExpandedLinks`, and an `isLikelyBusinessAccount` flag with `businessAccountSignals`. Because the flag is derived from the account's own professional/verification metadata, a lead list can be filtered down to likely business or creator accounts before anyone reaches out — no manual bio-reading required, and no field is fabricated when nothing is found.

#### For marketers and content/brand teams

Brand and content teams pull a creator or competitor's tweet history to review content mix and republish or archive media: `mediaAssets` resolves every photo, video, and GIF attached to a tweet into a best-quality URL and full size/bitrate variant map, while `hasVideo`, `hasGif`, and `mediaCount` let a team filter for video-heavy or image-heavy accounts. Pairing that with the bio-lead fields supports influencer vetting — checking who a creator is and what they post in the same pass, before an outreach decision is made.

#### For researchers and analysts

Researchers studying public discourse or account behavior use the date-bounded (`scanStartDate`/`scanEndDate`) and retweet/media filters to pull a defined public window of a profile's activity — engagement counts (`favorite_count`, `retweet_count`, `reply_count`, `quote_count`), language (`lang`), and reply structure (`in_reply_to_status_id_str`, `conversation_id_str`) all come back in the same typed row. Because the actor only reads what a public profile page already serves, the scope stays limited to publicly accessible content, which matters for research designed around public-data-only sourcing.

#### For developers building data products

Developers building lead-enrichment tools, CRM pipelines, or monitoring dashboards call this actor as a normal Apify run and consume `bioEmail`, `profileWebsiteUrl`, and `businessAccountSignals` directly into their own schema, without writing an HTML parser against x.com. Because the schema stays stable across runs and the actor auto-discovers X's current API query IDs and bearer token from the live client bundle instead of hardcoding them, an integration built once keeps working without a client-side scraper to maintain.

### How to scrape X (Twitter) (step by step)

1. Open the Twitter Profile Scraper With Contact Email actor on its Apify Store listing.
2. Provide at least one target in `profileUrls` (full profile URL) or `handles` (username without `@`).
3. Set optional filters — `scanStartDate`/`scanEndDate` for a date window, `includeRetweets`/`requireMedia` for tweet filtering, and `replyCountThreshold` if you also enable `includeReplies`.
4. Start the run. Set `maxLeadRecords` to cap total rows, and turn on `emitLeadProfile`/`extractBioContacts`/`includeMediaVariants` for the lead and media data you need.
5. Download results as JSON, CSV, or another Apify dataset export format once the run finishes.

#### What to do when X changes its structure

The actor re-discovers X's current API query IDs and bearer token from the live client JavaScript bundle on every run, and resolves a profile's user ID through several independent fallback paths (structured page data, then regex patterns, then a banner-image ID) rather than one brittle selector. The output schema stays stable, so an integration built against these field names keeps working without changes on your end.

### ⬇️ Input

No single field is marked required by the schema — you must supply at least one of `profileUrls` or `handles` for the run to do anything.

| Parameter | Required | Type | Description | Example Value |
| --- | --- | --- | --- | --- |
| `profileUrls` | No | array | List of Twitter/X profile URLs (e.g., `https://x.com/elonmusk`). Required if `handles` is empty. Also accepts the base actor's `startUrls` key. | `["https://x.com/elonmusk"]` |
| `handles` | No | array | List of usernames without the `@` (e.g., `elonmusk`). Required if `profileUrls` is empty. Also accepts the base actor's `twitterHandles` key. | `["nasa"]` |
| `maxLeadRecords` | No | integer | Hard cap on total items (tweets/replies/lead-profile records) written across the whole run. UI prefill is 10; if the field is omitted entirely the actor applies a default of 100. Also accepts the base actor's `maxItems` key. | `50` |
| `scanStartDate` | No | string | Lower bound for tweet date. Absolute (`YYYY-MM-DD`) or relative (e.g., `7 days`). Empty = no lower bound. Also accepts the base actor's `start` key. | `"7 days"` |
| `scanEndDate` | No | string | Upper bound for tweet date. Absolute (`YYYY-MM-DD`) or relative (e.g., `1 day`). Empty = no upper bound. Also accepts the base actor's `end` key. | `""` |
| `includeRetweets` | No | boolean | When off, native retweets (`full_text` starting with `RT @`) are dropped — matches the base actor's own default. Only effective for roughly the last 7–10 days. Also accepts `includeNativeRetweets`. | `false` |
| `requireMedia` | No | boolean | Keep only tweets that contain at least one photo. Off matches the base actor's own default. Also accepts `onlyImages`. | `false` |
| `emitLeadProfile` | No | boolean | Emit one profile/about record per user, enriched with the same bio-contact and business-heuristic fields as tweet rows. Off matches the base actor's own default. Also accepts `getAboutData`. | `true` |
| `extractBioContacts` | No | boolean | Turn on bio/profile contact and lead-signal extraction (`bioEmail`, `profileWebsiteUrl`, `bioExpandedLinks`, `isLikelyBusinessAccount`). Default `true`. | `true` |
| `includeMediaVariants` | No | boolean | Turn on full media asset variant extraction (`mediaAssets[]`, `hasVideo`, `hasGif`, `mediaCount`). Default `true`. | `true` |
| `includeReplies` | No | boolean | Fetch replies to each qualifying tweet via the TweetDetail endpoint. Requires login cookies. Off matches the base actor's own default. Also accepts `getReplies`. | `false` |
| `replyCountThreshold` | No | integer | Only fetch replies for tweets whose `reply_count` is at least this value. Also accepts `minReplyCount`. | `0` |
| `authToken` | No | string | Value of the `auth_token` cookie from x.com (devtools → Application → Cookies). Required for `includeReplies`. | `""` |
| `csrfToken` | No | string | Value of the `ct0` cookie from x.com. Required for `includeReplies`. | `""` |
| `proxyConfiguration` | No | object | Apify Proxy configuration. Recommended for reliability against rate limits. | `{"useApifyProxy": true}` |

Example JSON input:

```json
{
  "profileUrls": ["https://x.com/elonmusk"],
  "handles": [],
  "maxLeadRecords": 50,
  "scanStartDate": "7 days",
  "scanEndDate": "",
  "includeRetweets": false,
  "requireMedia": false,
  "emitLeadProfile": true,
  "extractBioContacts": true,
  "includeMediaVariants": true,
  "includeReplies": false,
  "replyCountThreshold": 0,
  "authToken": "",
  "csrfToken": "",
  "proxyConfiguration": { "useApifyProxy": true }
}
```

The most common input mistake is leaving both `profileUrls` and `handles` empty — the schema doesn't mark either one as required, so the run starts, logs a warning, and finishes with zero rows instead of failing loudly.

### ⬆️ Output

Every row is written to the default Apify dataset as typed, normalized JSON, exportable as JSON, CSV, Excel, or the other standard Apify dataset formats. Tweet/reply rows and lead-profile rows share one dataset but carry structurally different fields, distinguished by the `type` value.

#### Scraped tweets and replies (`type: "tweet"` / `"reply"`)

```json
{
  "id_str": "1234567890123456789",
  "type": "tweet",
  "isReply": false,
  "tweetUrl": "https://x.com/example/status/1234567890123456789",
  "full_text": "Reach out at hello@example.com or check example.com for our latest drop",
  "created_at": "Wed Jul 22 14:03:11 +0000 2026",
  "user": {
    "screen_name": "example",
    "name": "Example Co",
    "description": "Reach out at hello@example.com or check example.com",
    "verified": false
  },
  "bioEmail": "hello@example.com",
  "profileWebsiteUrl": "https://example.com/",
  "bioExpandedLinks": ["https://example.com/shop"],
  "isLikelyBusinessAccount": true,
  "businessAccountSignals": {
    "professionalType": "Business",
    "professionalCategory": "Retail",
    "verifiedType": null
  },
  "mediaAssets": [
    {
      "type": "video",
      "mediaUrl": "https://pbs.twimg.com/media/example.jpg",
      "bestVideoUrl": "https://video.twimg.com/example.mp4",
      "videoBitrate": 2176000,
      "videoVariants": [{"url": "https://video.twimg.com/example_low.mp4", "bitrate": 632000, "contentType": "video/mp4"}],
      "isGif": false
    }
  ],
  "hasVideo": true,
  "hasGif": false,
  "mediaCount": 1,
  "favorite_count": 412,
  "retweet_count": 38,
  "reply_count": 12,
  "quote_count": 3,
  "bookmark_count": 9,
  "views_count": 15230,
  "user_id_str": "987654321",
  "conversation_id_str": "1234567890123456789",
  "lang": "en",
  "is_quote_status": false,
  "favorited": false,
  "retweeted": false,
  "bookmarked": false,
  "possibly_sensitive": false,
  "display_text_range": [0, 74],
  "scrapedAt": "2026-07-25T00:00:00Z"
}
```

`isReply` and `parentTweetId` are only present on reply rows (when `includeReplies` is on); `in_reply_to_status_id_str`, `in_reply_to_user_id_str`, and `in_reply_to_screen_name` only appear when the source tweet itself is a reply. `bioEmail`, `profileWebsiteUrl`, `bioExpandedLinks`, and `businessAccountSignals` are `null` when nothing is found — never fabricated. `mediaAssets` is `null` when the row has no attached media.

#### Lead profile records (`type: "about"`, when `emitLeadProfile` is on)

```json
{
  "type": "about",
  "aboutData": true,
  "screen_name": "example",
  "rest_id": "987654321",
  "is_blue_verified": false,
  "profile_image_shape": "Circle",
  "verification": {"verified_type": "Business"},
  "avatar": {"image_url": "https://pbs.twimg.com/profile_images/example_normal.jpg"},
  "core": {"created_at": "Mon Jan 05 10:00:00 +0000 2015", "name": "Example Co"},
  "location": {"location": "Austin, TX"},
  "professional": {"professional_type": "Business", "category": [{"name": "Retail"}]},
  "profile_bio": {"description": "Reach out at hello@example.com or check example.com"},
  "user": {"screen_name": "example", "description": "Reach out at hello@example.com or check example.com"},
  "bioEmail": "hello@example.com",
  "profileWebsiteUrl": "https://example.com/",
  "bioExpandedLinks": ["https://example.com/shop"],
  "isLikelyBusinessAccount": true,
  "businessAccountSignals": {"professionalType": "Business", "professionalCategory": "Retail", "verifiedType": "Business"},
  "scrapedAt": "2026-07-25T00:00:00Z"
}
```

Every dataset row — tweet, reply, or lead-profile record — is charged under the single `row_result` pay-per-event unit; the actor does not push any separate uncharged error or accounting rows.

### How many results can you scrape with Twitter Profile Scraper With Contact Email?

`maxLeadRecords` is the real limit: it caps total rows (tweets, replies, and lead-profile records combined) written across the whole run, and defaults to 100 when omitted. There is no maximum enforced by the input schema itself — set it as high as your use case needs. Per profile, the actor pages through a user's timeline in batches of roughly 50 tweets and stops after 40 pages for that profile even if `maxLeadRecords` hasn't been reached yet, then moves on to the next target; it also stops early if X's own pagination runs out of pages or your date filter has scrolled past the requested window. With multiple targets in `profileUrls`/`handles`, the cap applies to the run as a whole, not per profile.

### Integrate Twitter Profile Scraper With Contact Email and automate your workflow

Twitter Profile Scraper With Contact Email works with any language or tool that can send an HTTP request, since it runs as a standard Apify actor.

#### REST API integration

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_API_TOKEN>")
run = client.actor("<your-username>/twitter-profile-scraper-with-contact-email").call(
    run_input={
        "profileUrls": ["https://x.com/elonmusk"],
        "maxLeadRecords": 50,
        "emitLeadProfile": True,
    }
)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item.get("type"), item.get("bioEmail"), item.get("tweetUrl"))
```

Works in Python, Node.js, Go, Ruby, cURL.

#### MCP for AI agents

This actor is callable through Apify's MCP server, which exposes any Apify actor as a tool by its store ID (`<your-username>/twitter-profile-scraper-with-contact-email`). Register it against an MCP-compatible client (Claude, or any other MCP-aware agent framework) pointed at your Apify token to call it as an agent tool rather than a raw HTTP request.

#### Automation platforms (n8n, Make)

In n8n, use the Apify node (or a generic HTTP Request node against the Apify API) configured with your API token and this actor's ID to trigger a run and read back the dataset. In Make, the Apify app's "Run an Actor" module and "Get Dataset Items" module cover the same run-then-fetch pattern without custom code.

### Is it legal to scrape X (Twitter)?

Scraping publicly accessible X (Twitter) profiles is generally legal; this actor returns only data that a public profile page already serves, without logging in or bypassing any access restriction (login cookies are only used, optionally, for reply scraping you're already authorized to see). Because bio emails and other profile fields are personal data, storing or using them at scale is subject to data protection law — GDPR in the EU/UK and CCPA in California — which govern how you may lawfully store, process, and use personal data you collect, not whether public reading itself is permitted. Consult legal counsel for commercial use cases involving bulk personal data.

### Frequently asked questions

#### Does Twitter Profile Scraper With Contact Email work without a Twitter/X account?

Yes. Profile scraping, bio-contact extraction, and media asset resolution all work logged out. Only `includeReplies` (reply scraping) requires your own `auth_token`/`ct0` login cookies.

#### How often is the scraped data updated?

Every run fetches live from x.com at the time it executes — nothing is served from a cache. Run it again whenever you need a fresh snapshot of a profile.

#### What happens if a profile is deleted, private, or has no tweets?

If the profile can't be resolved to a user ID, the actor logs a warning and skips that target, continuing with the rest of your list. If a profile resolves but has no tweets matching your filters, that target simply contributes zero rows — the run still completes normally.

#### Can I scrape private or protected X accounts?

No. Only publicly accessible profiles and tweets are returned; the actor does not bypass private-account restrictions.

#### Does Twitter Profile Scraper With Contact Email work for AI agent workflows and LLM pipelines?

Yes. It's callable as a standard HTTP endpoint by any agent framework, and it's also reachable through Apify's MCP server as an agent tool. Every response is typed JSON — no parsing step before passing it to an LLM.

#### How does Twitter Profile Scraper With Contact Email handle X's anti-bot system?

The actor re-discovers X's current bearer token and GraphQL query IDs from the live client JavaScript on every run instead of hardcoding them, resolves user IDs through several independent fallback methods, and activates a guest session token when no login cookies are supplied. Apify Proxy is supported and recommended for reliability against rate limits.

#### Does Twitter Profile Scraper With Contact Email return data in a format LLMs can use directly?

Yes. Typed, normalized JSON with stable field names — no HTML, no selectors, no parsing. Pass it directly into an LLM context window, a vector store, or an agent tool.

#### Can I use this actor without managing proxies?

Yes. `proxyConfiguration` is optional and disabled by default; the actor runs without Apify Proxy, though enabling it is recommended for reliability against rate limits.

#### Will this actor guess or fabricate an email or website if none is present?

No. `bioEmail`, `profileWebsiteUrl`, and `bioExpandedLinks` are only populated when a real match is found in the account's own bio or link fields; otherwise they are `null`.

#### Is extracting bio contacts or media variants an extra request?

No. Both are derived from the same profile/tweet response already fetched for the core scrape — nothing extra is downloaded or re-fetched.

#### What happens when X changes its structure or blocks the scraper?

The scraper is maintained and its output schema stays stable — field names and types don't change on your end. There's no numeric turnaround guarantee, but the actor already includes multiple fallback extraction paths designed to survive routine markup and endpoint changes.

### Your feedback

Found a bug or missing a field? We want to know. Reach out through this actor's Apify Store page or issue tracker so it can be fixed — reports like this are how the actor stays maintained and accurate.

# Actor input Schema

## `profileUrls` (type: `array`):

List of Twitter/X profile URLs (e.g., https://x.com/elonmusk). Required if handles is empty. (Accepts the base actor's `startUrls` key too.)

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

List of usernames without the @ (e.g., elonmusk). Required if profileUrls is empty. (Accepts the base actor's `twitterHandles` key too.)

## `maxLeadRecords` (type: `integer`):

Hard cap on total items (tweets/replies/lead-profile records) written across the whole run. Default 100 when omitted. (Accepts the base actor's `maxItems` key too.)

## `scanStartDate` (type: `string`):

Lower bound for tweet date. Use absolute date (YYYY-MM-DD) or relative value (for example, 7 days). Empty = no lower bound. (Accepts the base actor's `start` key too.)

## `scanEndDate` (type: `string`):

Upper bound for tweet date. Use absolute date (YYYY-MM-DD) or relative value (for example, 1 day). Empty = no upper bound. (Accepts the base actor's `end` key too.)

## `includeRetweets` (type: `boolean`):

When off (unchecked), native retweets (full\_text starts with 'RT @') are dropped — this matches the base actor's own default. Only effective for the last ~7-10 days. (Accepts the base actor's `includeNativeRetweets` key too.)

## `requireMedia` (type: `boolean`):

Keep only tweets that contain at least one photo. Off (unchecked) matches the base actor's own default. (Accepts the base actor's `onlyImages` key too.)

## `emitLeadProfile` (type: `boolean`):

Emit one profile/about record per user, enriched with the same bio-contact and business-heuristic fields as tweet rows. Off (unchecked) matches the base actor's own default. (Accepts the base actor's `getAboutData` key too.)

## `extractBioContacts` (type: `boolean`):

Turn on bio/profile contact & lead-signal extraction (bioEmail, profileWebsiteUrl, bioExpandedLinks, isLikelyBusinessAccount).

## `includeMediaVariants` (type: `boolean`):

Turn on full media asset variant extraction (mediaAssets\[], hasVideo, hasGif, mediaCount).

## `includeReplies` (type: `boolean`):

Fetch replies to each qualifying tweet via the TweetDetail endpoint. Requires login cookies. Off (unchecked) matches the base actor's own default. (Accepts the base actor's `getReplies` key too.)

## `replyCountThreshold` (type: `integer`):

Only fetch replies for tweets whose reply\_count is at least this value. (Accepts the base actor's `minReplyCount` key too.)

## `authToken` (type: `string`):

Value of the `auth_token` cookie from x.com (devtools → Application → Cookies). Required for includeReplies.

## `csrfToken` (type: `string`):

Value of the `ct0` cookie from x.com. Required for includeReplies.

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

Apify proxy configuration. Recommended for reliability against rate limits.

## Actor input object example

```json
{
  "profileUrls": [
    "https://x.com/elonmusk"
  ],
  "handles": [
    ""
  ],
  "maxLeadRecords": 10,
  "extractBioContacts": true,
  "includeMediaVariants": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

All scraped items in the Actor's default dataset: tweets, replies, and (if enabled) one profile/about record per user, with bio-contact and media-asset fields.

# 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 = {
    "profileUrls": [
        "https://x.com/elonmusk"
    ],
    "handles": [
        ""
    ],
    "maxLeadRecords": 10,
    "replyCountThreshold": 0,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("api-empire/twitter-profile-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 = {
    "profileUrls": ["https://x.com/elonmusk"],
    "handles": [""],
    "maxLeadRecords": 10,
    "replyCountThreshold": 0,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("api-empire/twitter-profile-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 '{
  "profileUrls": [
    "https://x.com/elonmusk"
  ],
  "handles": [
    ""
  ],
  "maxLeadRecords": 10,
  "replyCountThreshold": 0,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call api-empire/twitter-profile-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,api-empire/twitter-profile-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/TCR6i89sKA1IrKtN0/builds/plmt15cHhEn77xRMR/openapi.json
