# X (Twitter) User Posts & Replies Scraper (`korado_labs/x-twitter-user-replies-scraper`) Actor

Scrape any X/Twitter user's posts & replies as enriched records: full engagement (likes, reposts, quotes, replies, bookmarks, views), media, entities, reply/conversation linkage & author profile. No login needed. Export data, run via API, schedule runs, or integrate with other tools.

- **URL**: https://apify.com/korado\_labs/x-twitter-user-replies-scraper.md
- **Developed by:** [Korado Labs](https://apify.com/korado_labs) (community)
- **Categories:** Social media, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $9.60 / 1,000 post / reply records

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

Learn more: https://docs.apify.com/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) User Posts & Replies Scraper

Scrape **any X / Twitter user's posts and replies** and get them back as clean,
**enriched records** — not raw JSON dumps. Every record carries the full
engagement metrics, media, entities, reply/conversation threading **and the
author's full profile**.

Give it one or more usernames. It works **with no login** out of the box, and
an optional `auth_token` cookie unlocks the **full Replies tab** (replies to
*other* accounts) plus deep history.

***

### What you get per record

| Field | Description |
|---|---|
| `tweetId`, `url`, `text` | Post id, canonical URL, full text (t.co links **expanded**, long posts **un-truncated**) |
| `createdAt`, `lang` | ISO-8601 UTC timestamp, language |
| `isReply`, `isSelfReply`, `isQuote`, `isRetweet` | Content-type flags |
| `inReplyToTweetId`, `inReplyToUsername`, `inReplyToUserId` | What/who this reply targets |
| `conversationId` | Thread root — group replies into their conversation |
| `likeCount`, `retweetCount`, `quoteCount`, `replyCount`, `bookmarkCount`, `viewCount` | Full engagement metrics |
| `media[]` | Photos & videos with direct URLs (best-bitrate **mp4** for video), alt text |
| `entities` | `hashtags`, `mentions` (`{username, userId}`), expanded `urls`, `symbols` |
| `quotedTweet` | The quoted post (id, text, author, url), when present |
| `author` | Full author profile: bio, follower/following/tweet counts, verification, account age, avatar & banner |
| `isPinned`, `possiblySensitive` | Extra flags |

Turn on **Include raw tweet object** to also get X's untouched GraphQL object
under `raw`.

***

### Input

```json
{
  "screenNames": ["naval", "paulg"],
  "contentType": "all",
  "maxResults": 200
}
```

| Field | Type | Notes |
|---|---|---|
| `screenNames` | array | Usernames (with/without `@`, or profile URLs). Each scraped up to `maxResults`. |
| `contentType` | select | `all` · `replies_only` · `posts_only` |
| `maxResults` | integer | Per user, newest first (default 100). |
| `authToken` | secret | **Optional.** Unlocks the full Replies tab & deep history (see below). |
| `csrfToken` | secret | Optional `ct0`; derived automatically if omitted. |
| `includeRaw` | boolean | Attach the raw tweet object. |
| `proxy` | proxy | Residential recommended when using `authToken`. |

### Two access modes

- **No login (default).** Reads the **Posts tab** — the user's own posts and
  **self-thread replies** — cookielessly. Great for timelines and content
  review. Note: X caps guest access to roughly the latest **~100 posts** per
  account.
- **With an `auth_token` cookie.** Reads the **full Replies tab**, including
  **replies to other accounts**, and paginates **deep**. In 2026 X restricts
  reply history to logged-in sessions, so this is the only way to get a user's
  replies to *others*.

#### How to get your `auth_token` (30 seconds)

1. Log in to **x.com** in your browser (use a secondary/burner account — the
   actor reads as that account).
2. Open **DevTools → Application → Cookies → `https://x.com`**.
3. Copy the value of the **`auth_token`** cookie into the **X auth\_token
   cookie** field.

***

### Pricing

**Pay-per-result: $0.012 per delivered record.** You are charged once per unique
post/reply actually returned — **failed or blocked runs cost nothing**, and
there is **no per-run start fee**.

- 1,000 records = **$12.00**
- 200 records = **$2.40**

### Why this scraper

- **Enriched, not raw** — expanded links, un-truncated long posts, best-bitrate
  video URLs, parsed entities, quoted-post linkage, and the author profile on
  every row.
- **Reply-aware** — `isReply` / `isSelfReply` / `conversationId` /
  `inReplyTo*` let you reconstruct threads and separate real replies from
  self-threads.
- **Works with zero setup** — cookieless Posts mode; add a cookie only when you
  need replies-to-others or deep history.
- **Multi-user batch** — pass many handles in one run.
- **Fair billing** — per delivered record, only on success, no start fee.

### Notes & limits

- Protected/private accounts return nothing unless your `auth_token` follows
  them.
- Guest (no-login) mode is limited to the latest ~100 posts and the Posts tab;
  use an `auth_token` for the full Replies tab and deep history.
- Respect X's Terms and applicable laws; scrape only public data.

# Actor input Schema

## `screenNames` (type: `array`):

One or more X usernames (handles) whose posts & replies you want. Enter with or without the leading @, or paste profile URLs. Each is scraped up to 'Max results'.

## `contentType` (type: `string`):

Filter the timeline. 'All' = posts + replies + reposts. 'Replies only' returns just replies (needs an auth\_token to capture replies to OTHER accounts; without it you only get self-thread replies). 'Posts only' excludes replies and reposts.

## `maxResults` (type: `integer`):

Stop after collecting this many records per username (newest first). Note: without an auth\_token, X caps guest access to roughly the latest ~100 posts.

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

Optional but recommended. The user's REPLIES to OTHER accounts, and deep history beyond ~100 posts, are login-only on X in 2026. Log in to x.com, open DevTools → Application → Cookies → https://x.com, and copy the 'auth\_token' value. Use a secondary/burner account — this reads as that account. Leave empty to run cookieless (Posts tab: posts + self-replies).

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

Optional. The 'ct0' cookie from the same x.com session. Leave empty and the actor derives it automatically from your auth\_token.

## `includeRaw` (type: `boolean`):

Also attach X's full raw GraphQL tweet object to each record under 'raw'. Off by default for compact output.

## `proxy` (type: `object`):

Proxy used to reach X. Residential proxies are recommended when using an auth\_token for best stability.

## Actor input object example

```json
{
  "screenNames": [
    "naval",
    "paulg"
  ],
  "contentType": "all",
  "maxResults": 100,
  "includeRaw": false,
  "proxy": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

One enriched record per post/reply, newest first, with full engagement metrics, media, entities, reply/conversation linkage and author profile.

# 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 = {
    "screenNames": [
        "naval"
    ],
    "proxy": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("korado_labs/x-twitter-user-replies-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 = {
    "screenNames": ["naval"],
    "proxy": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("korado_labs/x-twitter-user-replies-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 '{
  "screenNames": [
    "naval"
  ],
  "proxy": {
    "useApifyProxy": true
  }
}' |
apify call korado_labs/x-twitter-user-replies-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,korado_labs/x-twitter-user-replies-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/NUFi2kCntgLGfGGyT/builds/FUHnQdOCAe6fZ0YBO/openapi.json
