# X (Twitter) Scraper - Tweets, Profiles & Search (`vulnv/twitter-scraper`) Actor

Scrape X (Twitter): keyword tweet search (top or latest), full tweet details, user profiles, a user's tweets, a user's media posts and followers. Export text, views, likes, retweets, replies, media and author data to JSON/CSV/Excel. No login, cookies or proxy needed.

- **URL**: https://apify.com/vulnv/twitter-scraper.md
- **Developed by:** [VulnV](https://apify.com/vulnv) (community)
- **Categories:** Social media, Lead generation
- **Stats:** 6 total users, 4 monthly users, 92.1% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 tweets

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?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## X (Twitter) Scraper - Tweets, Profiles & Search

**Scrape X (Twitter) and export tweets, user profiles and followers to JSON, CSV or Excel.** Search tweets by keyword (Top or Latest), pull a single tweet's full details, get a user's profile, list a user's tweets or media posts, or collect an account's followers - all from one Actor. Each result is one clean, flat row with text, views, likes, retweets, replies, media and author data.

No login, no cookies, no proxies and no developer account to configure - data is fetched through a fast, managed pipeline. Just pick an operation, add your input and press **Start**.

> **Unofficial notice:** This is an independent tool and is **not** affiliated with, endorsed by, or connected to X, Twitter or X Corp. "X" and "Twitter" are trademarks of their respective owners, used here only to describe what the Actor scrapes.

### What is X (Twitter)?

X, formerly Twitter, is one of the world's largest real-time social networks, with hundreds of millions of monthly users. It is where news breaks first, where brands, founders, politicians and creators talk to their audiences in public, and where trends form within minutes. This scraper gives you programmatic access to X search, tweets, profiles and followers so you can monitor brands, track topics and research audiences at scale without an X account.

### Operations

Pick one **Operation** and fill in the matching field:

| Operation | Input field | What you get |
|-----------|-------------|--------------|
| **Search tweets by keyword** | `keywords` | Tweets matching each keyword, sorted Top or Latest, with text, media, engagement and author data. |
| **Tweet details** | `tweetUrls` | The full detail of each tweet, including reply context and attached media. |
| **User profile** | `userUrls` | A user's profile: followers, following, tweet and media counts, verification, bio, website, join date. |
| **User's tweets** | `userUrls` | The tweets on a user's timeline (pinned tweet first, then newest), including their retweets and thread replies. |
| **User's media** | `userUrls` | The user's Media tab: their tweets that carry photos or video, with direct image and MP4 links. |
| **User's followers** | `userUrls` | Accounts that follow the user, with handle, name, follower count, location and verification. |

`tweetUrls` accept `x.com/<user>/status/<id>` and `twitter.com/<user>/status/<id>` links or bare numeric tweet IDs. `userUrls` accept profile URLs (`https://x.com/nasa`), `@handles`, bare handles or numeric user IDs - one per line.

Looking for the replies to a tweet? Use the **[X (Twitter) Comments Scraper](https://apify.com/vulnv/twitter-comments-scraper)**.

### How to use it (step by step)

1. Choose an **Operation**.
2. Fill in the matching input:
   - Search tweets -> add one or more **Search keywords** (words, phrases, #hashtags, $cashtags and X search operators such as `from:nasa` or `lang:en` all work).
   - Tweet details -> paste **Tweet URLs / IDs**.
   - User profile / tweets / media / followers -> paste **User handles / URLs**.
3. Set **Maximum results per input** (default 100, or 0 for all available) for the paginated operations.
4. For search, optionally set **Search sort order** (Top or Latest).
5. Press **Start**. Export the dataset as JSON, CSV, Excel, XML or via the API.

### Input

| Field | Type | Description |
|-------|------|-------------|
| `operation` | string | **Required.** `search_tweets`, `tweet_detail`, `user_profile`, `user_tweets`, `user_media`, or `user_followers`. |
| `keywords` | array | Search keywords or X search queries (for `search_tweets`). |
| `tweetUrls` | array | Tweet URLs or numeric tweet IDs (for `tweet_detail`). |
| `userUrls` | array | Profile URLs, @handles or numeric user IDs (for the four user operations). |
| `maxItems` | integer | Max results per keyword / user. `0` = all available. Default `100`. |
| `searchSort` | string | `top` or `latest` (search only). |

Example input:

```json
{
  "operation": "search_tweets",
  "keywords": ["openai", "from:nasa"],
  "searchSort": "latest",
  "maxItems": 200
}
```

### Output

Every row carries a `record_type` of `tweet`, `user` or `follower`. Tweet fields:

| Field | Description |
|-------|-------------|
| `tweet_id`, `tweet_url`, `conversation_id` | Tweet identity, canonical x.com URL and thread root. |
| `text`, `lang`, `create_time`, `source` | Full text, language, time (ISO-8601 UTC) and posting client. |
| `view_count`, `like_count`, `retweet_count`, `reply_count`, `quote_count`, `bookmark_count` | Engagement metrics. |
| `is_reply`, `in_reply_to_tweet_id` | Reply context. |
| `is_retweet`, `retweeted_tweet_id`, `retweeted_text`, `retweeted_author_screen_name` | The original tweet, for retweets. |
| `is_quote`, `quoted_tweet_id`, `quoted_text`, `quoted_author_screen_name` | The quoted tweet, for quote tweets. |
| `hashtags`, `mentions`, `urls` | Hashtags, @mentions and expanded links. |
| `media_type`, `media_count`, `image_urls`, `video_urls`, `video_duration_seconds` | Attached photos and videos (highest-quality MP4 per video). |
| `author_id`, `author_screen_name`, `author_name`, `author_profile_url`, `author_avatar_url`, `author_followers_count`, `author_verified` | Author data. |

User (`user`) rows add `user_id`, `screen_name`, `name`, `description`, `location`, `website`, `profile_url`, `avatar_url`, `banner_url`, `followers_count`, `following_count`, `tweet_count`, `media_count`, `verified`, `verification_type`, `is_protected`, `affiliates_count`, `pinned_tweet_id` and `create_time` (join date). Follower (`follower`) rows add `followed_screen_name` plus the follower's `user_id`, `screen_name`, `name`, `location`, `profile_url`, `avatar_url`, `followers_count`, `verified` and `create_time`.

Example tweet row:

```json
{
  "record_type": "tweet",
  "operation": "tweet_detail",
  "input": "2105677443327570430",
  "tweet_id": "2105677443327570430",
  "tweet_url": "https://x.com/NASA/status/2105677443327570430",
  "text": "@Space_Station @SpaceX @NASAAdmin \"Human spaceflight is truly a team sport...\"",
  "lang": "en",
  "create_time": "2026-10-01T15:13:18+00:00",
  "is_reply": true,
  "in_reply_to_tweet_id": "2105662944889675873",
  "view_count": 26670,
  "like_count": 95,
  "retweet_count": 9,
  "reply_count": 4,
  "mentions": ["Space_Station", "SpaceX", "NASAAdmin", "astro_watkins"],
  "media_type": "video",
  "video_urls": ["https://video.twimg.com/amplify_video/.../3840x2160/....mp4"],
  "video_duration_seconds": 54,
  "author_screen_name": "NASA",
  "author_followers_count": 92378239,
  "author_verified": true
}
```

### Common use cases

- **Brand and competitor monitoring** - search a brand, product or cashtag on a schedule and collect every new mention with engagement data.
- **Social listening and sentiment analysis** - build datasets of tweets around a topic, hashtag or event.
- **Influencer and lead research** - pull profiles and recent tweets of accounts in a niche, or list who follows a competitor.
- **Content and media archiving** - export a user's tweets or media posts with direct image and video links.
- **AI and market research** - feed clean, structured X data into dashboards, spreadsheets or models.

### Notes on reliability

- X search matches more than the tweet text (quoted tweets, linked articles, media and account signals), so some results will not contain your keyword literally. Very rare or nonsense keywords can still return loosely related tweets.
- **Latest** is mostly newest-first but X may mix in a few older, highly relevant tweets; sort by `create_time` if you need strict order.
- Tweet details for a retweet return the retweet itself with X's shortened "RT @user:" text; run the original tweet's id for its full text.
- The followers list returns the basic profile of each follower (handle, name, follower count, location, verification, join date); use **User profile** on a follower for the full bio and counts.
- Image and video URLs are served by X's CDN; fetch them promptly.
- Counts reflect what X returns at scrape time. If a tweet or account is deleted, suspended, protected or does not exist, that input is skipped and the run continues.

### FAQ

**Do I need an X account, cookies or a developer API key?** No. Just add your input and press Start.

**Does it scrape replies to a tweet?** Not this Actor - use the [X (Twitter) Comments Scraper](https://apify.com/vulnv/twitter-comments-scraper) for replies and comments.

**Can I use X search operators?** Yes. Queries like `from:nasa`, `to:nasa`, `lang:en`, `min_faves:100`, `since:2026-09-01` or `"exact phrase"` go straight into **Search keywords**.

**Which user inputs work?** `https://x.com/<handle>`, `https://twitter.com/<handle>`, `@handle`, a bare handle, or a numeric user ID. Numeric entries are read as user IDs; write a numeric handle as `@123`.

**Can I run several keywords or users at once?** Yes - add multiple lines. Cross-input duplicate tweets are removed automatically.

**Can I try it for free?** Yes. Users on the free Apify plan can fetch up to 10 results in total to try the Actor. Upgrade to a paid Apify plan to run it without that limit.

**What export formats are supported?** JSON, CSV, Excel, XML and HTML, plus the Apify API and integrations such as Google Sheets, Zapier, Make and webhooks.

### Pricing

This Actor is **pay per result**: you are charged for each record it returns (tweets, tweet details, user profiles and followers), plus standard Apify platform usage. Different record types have different prices; see the **Pricing** tab for current rates. You are never charged for inputs that return nothing.

### Related scrapers

- **[X (Twitter) Comments Scraper](https://apify.com/vulnv/twitter-comments-scraper)** - replies and comments on any tweet.
- **[Threads Scraper](https://apify.com/vulnv/threads-scraper)** - Threads creators, posts and replies.
- **[Reddit Posts Search Scraper](https://apify.com/vulnv/reddit-posts-search-scraper)** - Reddit posts and comments by keyword.

# Actor input Schema

## `operation` (type: `string`):

What to scrape. Each operation uses a different input field below:

• Search tweets → Keywords
• Tweet details → Tweet URLs / IDs
• User profile → User handles / URLs
• User's tweets → User handles / URLs
• User's media → User handles / URLs
• User's followers → User handles / URLs

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

For the "Search tweets" operation. Add one or more keywords - plain words, phrases, #hashtags, @mentions, $cashtags and X search operators (e.g. from:nasa, lang:en, min_faves:100) all work. Each keyword is searched independently and cross-keyword duplicates are removed.

## `tweetUrls` (type: `array`):

For the "Tweet details" operation. Paste full x.com or twitter.com status URLs (e.g. https://x.com/nasa/status/2105649148548493418) or bare numeric tweet IDs - one per line.

## `userUrls` (type: `array`):

For the user operations. Paste profile URLs (https://x.com/nasa), @handles, bare handles (nasa) or numeric user IDs (e.g. 11348282) - one per line. All-digit entries are read as user IDs; write a numeric handle as @123 instead.

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

Upper bound on results per keyword / user (for the paginated operations: search, user's tweets, user's media, followers). Cost scales linearly. Set 0 to fetch all available.

## `searchSort` (type: `string`):

For "Search tweets" only. Top returns X's most relevant / popular matches; Latest returns the most recent matches first.

## Actor input object example

```json
{
  "operation": "search_tweets",
  "keywords": [
    "openai"
  ],
  "maxItems": 100,
  "searchSort": "top"
}
```

# Actor output Schema

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

All scraped X (Twitter) results in the default dataset.

## `overview` (type: `string`):

Overview table of the scraped results.

# 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": [
        "openai"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("vulnv/twitter-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": ["openai"] }

# Run the Actor and wait for it to finish
run = client.actor("vulnv/twitter-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": [
    "openai"
  ]
}' |
apify call vulnv/twitter-scraper --silent --output-dataset

```

## MCP server setup

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