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

Scrape X (Twitter) posts from searches, accounts, lists and conversations. Advanced search filters, Latest or Top, dates, languages, likes and media. Get text, engagement, views, media, links and author data. No X account or API key needed.

- **URL**: https://apify.com/jmlp/x-twitter-scraper.md
- **Developed by:** [Mary Lou](https://apify.com/jmlp) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.14 / 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/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, Search, Profiles & Lists

Scrape **posts (tweets) from X**: any search, any account, any list, any conversation. Every post comes with its full text, likes, reposts, replies, quotes, bookmarks and views. You also get its photos and videos, links, hashtags and mentions, the post it quotes or reposts, and its author's profile: followers, bio, blue check.

Every filter of X's advanced search is a field: **dates, language, minimum likes, media, verified accounts, replies to or mentions of an account, location**.

**No X account, no API key, no cookies.** The scraper signs in to X with accounts of its own, each on a fixed IP. Prefer your own accounts? Paste them under **Your own X accounts** and the run uses yours alone.

***

### What you can do with it

- **Brand and social listening**: every post mentioning your brand, product or hashtag, as it happens, with a daily or hourly schedule
- **Competitor monitoring**: what competitors post, and how much engagement each post gets
- **Influencer research**: an account's posts with their likes, reposts and views, and the followers of everyone who talks about a topic
- **Market and trend research**: thousands of posts on a topic, a cashtag or an event for dashboards, spreadsheets and LLM workflows
- **Customer feedback**: every reply under a post, a launch or an announcement
- **Academic research**: datasets of public posts by keyword, date range and language

***

### How to scrape X (Twitter)

**1.** Tell it what to scrape. Fill in any of these, as many lines as you like:

- **Start URLs**: links pasted from your browser. A profile (`https://x.com/apify`), a profile's replies (`https://x.com/apify/with_replies`), a post (`https://x.com/elonmusk/status/2125797463047258119`), a search (`https://x.com/search?q=apify&f=live`), a hashtag (`https://x.com/hashtag/webscraping`) or a list (`https://x.com/i/lists/78783491`)
- **Search Terms**: what you would type into X's search, operators included: `web scraping`, `"open source" lang:en`, `#python min_faves:100`
- **Twitter handles**: accounts whose posts you want: `elonmusk`, `@apify`
- **Conversation IDs**: posts whose replies you want: an id or a link

**2.** Choose **Sort By**: **Latest** (newest first, as far back as X goes), **Top** (X's most relevant), or **Latest + Top**.

**3.** Optionally narrow it down under **Filter Tweets** and **Query Wizard**: a date range, a language, minimum likes, only images or videos, only verified accounts, replies to an account, and more.

**4.** Set **Maximum number of items on output** and press Start.

```json
{
  "searchTerms": ["web scraping", "#python min_faves:50"],
  "twitterHandles": ["apify"],
  "startUrls": ["https://x.com/i/lists/78783491"],
  "maxItems": 1000,
  "sort": "Latest",
  "tweetLanguage": "en",
  "start": "2026-11-01",
  "end": "2026-11-30"
}
```

Inputs written for other X scrapers on the Store work here as they are: the fields have the same names.

***

### How many posts you get

- **Searches and handles go back as far as X has posts.** X stops a long "Latest" search after a few hundred posts; this scraper picks it up again from the oldest post so far and carries on, so a run of one account's posts went back months, 1,200 posts without a gap.
- **Profile links** give the account's posts newest first, about 35 at a time. Turn on **Include reposts in profiles** to get its reposts too.
- **Lists** come 100 posts at a time, **conversations** about 36 replies at a time.
- **Maximum number of items** is shared across everything you give: with several searches and links, each gets its turn, so a cap of 300 gives you posts from all of them.
- Posts found by more than one search are delivered once.

#### Speed and X's limits

X limits how much each signed-in account may read per 15 minutes, and searches are limited the most. When the scraper's accounts have used theirs, the run **waits for X's window to reset** and carries on; its status says "waiting for X's rate limit". If the run would time out first, it ends normally with what it has, and **Continue from last run** picks up exactly there. Lists, profiles and conversations read many times faster than searches.

***

### Output

One row per post. Export as **JSON, CSV, Excel, XML or RSS**.

```json
{
  "type": "post",
  "id": "2125797463047258119",
  "url": "https://x.com/elonmusk/status/2125797463047258119",
  "text": "Every child in America will receive two SpaceX shares, one from the company and one from me personally",
  "created_at": "2026-11-26T03:43:05.000Z",
  "lang": "en",
  "like_count": 635529,
  "repost_count": 62566,
  "reply_count": 43757,
  "quote_count": 13663,
  "bookmark_count": 32050,
  "view_count": 38765919,
  "is_reply": false,
  "conversation_id": "2125797463047258119",
  "is_repost": false,
  "is_quote": false,
  "is_pinned": false,
  "hashtags": [],
  "mentions": [],
  "urls": [],
  "media": [],
  "author": {
    "id": "44196397",
    "username": "elonmusk",
    "name": "Elon Musk",
    "url": "https://x.com/elonmusk",
    "avatar": "https://pbs.twimg.com/profile_images/2122506092437504001/NSS4RHyZ_400x400.jpg",
    "followers": 239376475,
    "following": 1430,
    "posts_count": 113240,
    "is_blue_verified": true,
    "affiliation": "X",
    "protected": false
  },
  "quoted_post": null,
  "reposted_post": null,
  "source_type": "post",
  "source": "post 2125797463047258119",
  "scraped_at": "2026-12-01T19:35:51Z"
}
```

| Field | Notes |
| --- | --- |
| `text`, `lang`, `created_at` | The full text (a long post's whole text, not the first 280 characters), its language and when it was posted |
| `like_count`, `repost_count`, `reply_count`, `quote_count`, `bookmark_count`, `view_count` | Engagement, as X shows it |
| `is_reply`, `in_reply_to_*`, `conversation_id` | What it replies to, and the thread it belongs to |
| `is_repost`, `reposted_post`, `is_quote`, `quoted_post` | The post it reposts or quotes, in full |
| `media` | Photos, videos and GIFs: image, size, alt text, and for a video its best MP4, length and every format |
| `hashtags`, `cashtags`, `mentions`, `urls`, `card` | Everything in the post, with each link's real address and its preview card |
| `author` | Username, name, bio, location, profile picture, followers, following, post count, blue check, verified type and affiliation |
| `is_pinned`, `is_long_post`, `is_edited`, `possibly_sensitive`, `community_id` | More about the post |
| `search_term` | With **Include Search Terms**: the search or handle that found it |
| `source_type`, `source`, `source_url` | The search, profile, list or conversation it came from |

The run's `SUMMARY` record shows what each search and link gave, the search operators your filters added, and any waits for X's limits.

***

### Reliable on big runs

- **Inputs are read forgivingly.** x.com and twitter.com links, post ids, handles with or without @, dates as `2026-11-01`, `01/11/2026` or `30 days`, and field names used by other X scrapers (`maxTweets`, `searchQueries`, `handles`...) all work. Anything that cannot be read is skipped with a note in the log, not the whole run.
- **One failure costs only itself.** An account that doesn't exist or a deleted post is skipped and listed in the summary; the rest of the run carries on.
- **No failed runs for X's limits.** A run that has to stop ends normally, says why in its status, and can be continued.
- **Resumable.** Progress is saved every 30 seconds.

***

### FAQ

**Do I need an X account, cookies or an API key?**
No. The scraper reads X with signed-in accounts of its own. You never give it a login.

**Can I use my own X accounts?**
Yes. Under **Your own X accounts**, give one account per line: its `auth_token` and `ct0` cookies from x.com (browser DevTools > Application > Cookies) as `auth_token:ct0`. The run then uses your accounts alone, never ours, with the same care: at most half of what X allows each 15 minutes, spread out, and a rest whenever X pushes back. Each account goes out through the **Proxy** setting, keeping to one IP, or through a proxy of its own written after it: `auth_token:ct0:http://user:pass@host:port`. The field is stored encrypted. The price per post is the same either way.

**Which posts can it get?**
Public posts: any search, any public account, public lists and conversations. Posts of protected (private) accounts are not visible.

**How far back can it go?**
For searches and handles, as far back as X's search goes, years for most accounts. Use **Start date** and **End date** for a window.

**Why is a run waiting?**
X limits what each account may read per 15 minutes. When the scraper's accounts have used that, the run waits for the window to reset. Profile links, lists and conversations are limited far less than searches.

**What's the difference between a handle and a profile link?**
A **handle** is searched (`from:apify`): every filter and the date range apply, and it can go back years. A **profile link** reads the account's own timeline: faster, newest first, with its pinned post.

**Do the filters apply to profile and list links?**
Yes: dates, language, minimum likes, media and the rest are checked on every post read from a profile, list or conversation. The location filters work in searches only. A link to a single post is always returned.

**Can I use my own proxies?**
Yes. Give their `http://` or `https://` URLs under **Proxy** and the run goes through them alone: it never switches to Apify Proxy and never sends a request without a proxy. Put `{session}` where your provider takes a session id (`http://user-session-{session}:pass@gate.example.com:7000`) and each of the scraper's accounts gets an IP of its own.

***

### Related scrapers

- **Google Search Scraper**: organic results for any query
- **Meta Ads Library Scraper**: the ads a business runs on Facebook and Instagram
- **Website Contact Scraper**: emails, phones and social profiles from websites
- **Trustpilot Reviews Scraper**: reviews and replies of any company on Trustpilot

# Actor input Schema

## `startUrls` (type: `array`):

X (Twitter) links, pasted from your browser: a profile (x.com/apify) for its posts, a profile's Replies tab (x.com/apify/with_replies), a post (x.com/apify/status/...), a search (x.com/search?q=...), a hashtag (x.com/hashtag/...) or a list (x.com/i/lists/...). twitter.com links and bare post ids work too.

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

What you would type into X's search, one per line. X's search operators work: "web scraping" lang:en, scraping from:apify, #python min_faves:100, (apify OR crawlee) -filter:replies. See https://github.com/igorbrigadir/twitter-advanced-search for the full list.

## `twitterHandles` (type: `array`):

Accounts whose posts you want, one per line (elonmusk, @apify, or a profile link). Each is searched as from:handle, so Sort By and every filter below apply. For an account's newest posts fast, paste its profile link into Start URLs instead.

## `conversationIds` (type: `array`):

Posts whose replies you want: the post's id or link, one per line. You get the post and its replies the way the post's page lists them.

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

Stop after this many unique posts across every search, handle and link. Caps both runtime and cost. Empty means every post found.

## `sort` (type: `string`):

For searches and handles. Latest goes back in time, newest first, as far as X has posts. Top is X's most relevant posts, a few hundred at most. Latest + Top runs both and drops the posts they share. A pasted search link keeps its own tab (Top or Latest).

## `tweetLanguage` (type: `string`):

Only posts X detected in this language (ISO 639-1 code: en, de, es...).

## `onlyVerifiedUsers` (type: `boolean`):

Only posts by verified accounts.

## `onlyTwitterBlue` (type: `boolean`):

Only posts by accounts with X Premium (the blue check).

## `onlyImage` (type: `boolean`):

Only posts with an image.

## `onlyVideo` (type: `boolean`):

Only posts with a video.

## `onlyQuote` (type: `boolean`):

Only posts that quote another post.

## `author` (type: `string`):

Only posts by this account (from:). A handle, with or without @.

## `inReplyTo` (type: `string`):

Only replies to this account (to:).

## `mentioning` (type: `string`):

Only posts mentioning this account (@handle).

## `geotaggedNear` (type: `string`):

Only posts geotagged near this place (near:), e.g. Prague. Few posts carry a location.

## `withinRadius` (type: `string`):

With Geotagged near: how far from it (within:), e.g. 15km or 10mi.

## `geocode` (type: `string`):

Only posts from within a radius of a point (geocode:latitude,longitude,radius), e.g. 37.7764685,-122.4172004,10km.

## `placeObjectId` (type: `string`):

Only posts tagged with this X place (place:), e.g. 96683cc9126741d1.

## `minimumRetweets` (type: `integer`):

Only posts with at least this many reposts (min_retweets:).

## `minimumFavorites` (type: `integer`):

Only posts with at least this many likes (min_faves:).

## `minimumReplies` (type: `integer`):

Only posts with at least this many replies (min_replies:).

## `start` (type: `string`):

Only posts from this day on (since:), YYYY-MM-DD. A date and time (2025-01-31T09:00:00Z) is honoured to the second.

## `end` (type: `string`):

Only posts up to and including this day (until:), YYYY-MM-DD. A date and time is honoured to the second.

## `includeSearchTerms` (type: `boolean`):

Add a search_term field to each post from a search or handle: the entry it was found with.

## `includeReposts` (type: `boolean`):

For profile links, also return the account's reposts (retweets). Without them a profile is read about eight times faster: X serves its own posts 35 at a time at five times the rate.

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

How many searches, handles and links are read side by side, 1 to 20. Each takes its turn at the scraper's X accounts, so Maximum items is spread across all of them.

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

Only for your own X accounts (below) that have no proxy of their own: each of them keeps to one session of this proxy, so it goes out from one IP the way a person's browser does. The scraper's own accounts always use their fixed IPs. Apify's datacenter proxy is the default and works; residential works too. Your own proxies work as well, and are then the only way out: no fallback to Apify Proxy, and never a request without a proxy. Give http or https URLs, with {session} where your provider takes a session id, such as http://user-session-{session}:pass@gate.example.com:7000, and each account gets an IP of its own; {session:8} makes the id 8 characters long. Plain URLs are given out in turn, one per account.

## `resume` (type: `boolean`):

Save progress every ~30s so a run that gets migrated or restarted by the platform picks up where it stopped, without repeating posts.

## `continueFromLastRun` (type: `boolean`):

If your previous run with the same input was interrupted - stopped at X's rate limits or the run timeout - scrape only what it missed. Posts already collected stay in THAT run's dataset.

## `ownAccounts` (type: `string`):

To scrape with your own X (Twitter) accounts instead of ours: one account per line, its auth_token and ct0 cookies from x.com (browser DevTools > Application > Cookies) as auth_token:ct0. A whole Cookie header works too. To give an account a proxy of its own, add it after a colon: auth_token:ct0:http://user:pass@host:port. Accounts without one go through the Proxy setting above, each keeping to one IP. The run then uses your accounts alone, never ours, with the same care for them: at most half of what X allows each 15 minutes, spread out, and a rest when X pushes back. Stored encrypted.

## Actor input object example

```json
{
  "startUrls": [
    "https://x.com/apify",
    "https://x.com/search?q=apify%20&src=typed_query",
    "https://x.com/i/lists/78783491"
  ],
  "searchTerms": [
    "web scraping",
    "scraping from:apify"
  ],
  "twitterHandles": [
    "apify"
  ],
  "maxItems": 100,
  "sort": "Latest",
  "includeSearchTerms": false,
  "includeReposts": false,
  "maxConcurrency": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "resume": true,
  "continueFromLastRun": false
}
```

# Actor output Schema

## `posts` (type: `string`):

One record per unique post.

## `summary` (type: `string`):

What each search, handle and link gave, the filters, rate-limit waits, and whether anything was not found.

# 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 = {
    "startUrls": [
        "https://x.com/apify",
        "https://x.com/search?q=apify%20&src=typed_query",
        "https://x.com/i/lists/78783491"
    ],
    "searchTerms": [
        "web scraping",
        "scraping from:apify"
    ],
    "twitterHandles": [
        "apify"
    ],
    "maxItems": 100,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("jmlp/x-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 = {
    "startUrls": [
        "https://x.com/apify",
        "https://x.com/search?q=apify%20&src=typed_query",
        "https://x.com/i/lists/78783491",
    ],
    "searchTerms": [
        "web scraping",
        "scraping from:apify",
    ],
    "twitterHandles": ["apify"],
    "maxItems": 100,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("jmlp/x-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 '{
  "startUrls": [
    "https://x.com/apify",
    "https://x.com/search?q=apify%20&src=typed_query",
    "https://x.com/i/lists/78783491"
  ],
  "searchTerms": [
    "web scraping",
    "scraping from:apify"
  ],
  "twitterHandles": [
    "apify"
  ],
  "maxItems": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call jmlp/x-twitter-scraper --silent --output-dataset

```

## MCP server setup

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