# Twitter Comments & Replies Scraper — X Thread Extractor (`codescraper/twitter-comments-replies-scraper`) Actor

Ultra-fast Twitter (X) comments and replies scraper at $0.20/1k replies. Extract all replies, nested conversation threads, author analytics, metrics, media attachments, and timestamps from any X/Twitter post URL or Tweet ID. Includes 1-click English translation.

- **URL**: https://apify.com/codescraper/twitter-comments-replies-scraper.md
- **Developed by:** [CodeScraper](https://apify.com/codescraper) (community)
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.17 / 1,000 comments

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?

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

## 💬 Twitter Comments & Replies Scraper — X Thread Extractor

Extract real-time comments, nested conversation threads, author analytics, engagement metrics, media attachments, and timestamps from any **X (formerly Twitter)** post URL or Tweet ID at scale. Powered by direct API ingestion and server-side rendering (SSR), **Twitter Comments & Replies Scraper** captures the complete discussion landscape without brittle browser automation or expensive compute surcharges.

Whether you need conversation data for **sentiment analysis, brand reputation tracking, community feedback, customer support insights, viral debate research, or AI/LLM model training**, this Actor delivers clean, structured, and deduplicated records in ready-to-use JSON, CSV, and Excel formats.

***

### 💰 Transparent Pay-Per-Event Pricing

This Actor uses Apify's **Pay-Per-Event** monetization model with **Platform Usage (Compute & Proxies) 100% INCLUDED**. You never pay for expensive hourly server compute or bandwidth — you only pay for the exact volume of comments and replies scraped.

#### Official Pricing Table

| Event / Resource | Free Tier (No discount) | Starter (Bronze) | Scale (Silver) | Business (Gold) | Description |
|---|---|---|---|---|---|
| **Comment / Reply Scraped** | **$0.20** / 1,000 ($0.00020) | **$0.19** / 1,000 ($0.00019) | **$0.18** / 1,000 ($0.00018) | **$0.17** / 1,000 ($0.00017) | Charged only when an authentic comment or reply with full metrics is extracted. |
| **Result (Dataset Record)** | **$0.15** / 1,000 ($0.00015) | **$0.15** / 1,000 ($0.00015) | **$0.15** / 1,000 ($0.00015) | **$0.15** / 1,000 ($0.00015) | Charged per delivered record stored in your Apify dataset. |
| **Actor Start** | **$0.0005** / run | **$0.0005** / run | **$0.0005** / run | **$0.0005** / run | Flat micro-charge to initialize the Actor container per crawl run. |
| **Platform Usage (Compute & Proxies)** | **FREE ($0.00)** | **FREE ($0.00)** | **FREE ($0.00)** | **FREE ($0.00)** | Cloud compute, memory, and automated rotating datacenter proxy rotation are included at zero cost. |

***

#### 🧮 Real-World Cost Examples

*You only pay for verified comments collected and saved to your dataset. Empty or invalid URLs cost $0.00.*

##### 🔹 500 Comments Run (e.g. Medium Thread or Announcement Feedback)

- **Actor Start:** $0.0005
- **Results (Dataset Records):** 500 records × $0.00015 = **$0.075**
- **Comments Scraped:** 500 comments × $0.00020 = **$0.100**
- **Compute & Proxies:** **FREE ($0.00)**
- 💵 **Total Cost:** **$0.175** *(Only ~17¢ for 500 comments! Starter: $0.170 | Scale: $0.165 | Business: $0.160)*

##### 🔹 1,000 Comments Run (e.g. Viral Post or Competitor Campaign Audit)

- **Actor Start:** $0.0005
- **Results (Dataset Records):** 1,000 records × $0.00015 = **$0.150**
- **Comments Scraped:** 1,000 comments × $0.00020 = **$0.200**
- **Compute & Proxies:** **FREE ($0.00)**
- 💵 **Total Cost:** **$0.35** *(Only 3.5¢ per 100 comments! Starter: $0.34 | Scale: $0.33 | Business: $0.32)*

##### 🔹 5,000 Comments Run (e.g. Massive Product Launch Discussion)

- **Actor Start:** $0.0005
- **Results (Dataset Records):** 5,000 records × $0.00015 = **$0.750**
- **Comments Scraped:** 5,000 comments × $0.00020 = **$1.000**
- **Compute & Proxies:** **FREE ($0.00)**
- 💵 **Total Cost:** **$1.75** *(Starter: $1.70 | Scale: $1.65 | Business: $1.60)*

##### 🔹 10,000 Comments Run (e.g. Deep AI Sentiment & Topic Research)

- **Actor Start:** $0.0005
- **Results (Dataset Records):** 10,000 records × $0.00015 = **$1.500**
- **Comments Scraped:** 10,000 comments × $0.00020 = **$2.000**
- **Compute & Proxies:** **FREE ($0.00)**
- 💵 **Total Cost:** **$3.50** *(Starter: $3.40 | Scale: $3.30 | Business: $3.20)*

##### 🔹 0 Comments Found (e.g. Invalid Status ID or Deleted Tweet)

- **Actor Start:** $0.0005
- **Results (Dataset Records):** 0 × $0.00015 = **$0.000**
- **Comments Scraped:** 0 × $0.00020 = **$0.000**
- 💵 **Total Cost:** **$0.0005** *(You never pay for comments that do not exist!)*

***

### ✨ Why Choose This Scraper?

| Capability | 💬 Twitter Comments Scraper | Conventional Browser Scrapers | Official X API v2 |
|---|---|---|---|
| **Cost per 10K Comments** | **$3.50** flat | $18.00 – $45.00 (heavy compute) | $100.00+ (Basic tier) |
| **Compute & Bandwidth Fees** | **100% Free** (Included in PPE) | Expensive ($0.30–$0.60/hr) | Monthly subscription |
| **Extraction Speed** | **60 – 100 comments/second** | 2 – 5 comments/second | Rate limited |
| **Parent-Child Thread Tree** | ✅ **Direct replies vs sub-threads** | ❌ Flat unorganized text | ⚠️ Complex hydration |
| **Media Attachments** | ✅ **Images, video MP4s & GIFs** | ⚠️ Often broken URLs | ⚠️ Limited metadata |
| **Author Profile Analytics** | ✅ **Follower ratio, age, verification** | ❌ Minimal | ⚠️ Requires extra calls |
| **Zero-Login Free Guest Mode**| ✅ **Works out of the box** | ❌ Requires login | ❌ Impossible |
| **Real-Time Data Streaming** | ✅ **Pushed per page batch** | ❌ All-or-nothing risk | ⚠️ Manual batching |

***

### 🎯 What Data Does It Extract?

Every scraped reply record includes comprehensive, enriched metadata:

- **💬 Comment Content:** Full unclipped reply text (supporting long-form Note Tweets), language code, and client source platform.
- **🌐 One-Click Translation:** Optional automatic translation to English (`translateToEnglish: true`). Saves translated text in `fullText` while preserving the original non-English comment in `originalText` with `isTranslated: true` and detected language code.
- **📈 Real-Time Engagement Metrics:** Exact Likes, Reposts, Replies, Quotes, Bookmarks, and impression Views.
- **🔗 Thread & Hierarchy Mapping:**
  - `replyId`: Unique status ID of the reply.
  - `replyUrl`: Direct permanent link to the comment on X.
  - `inReplyToPostId`: ID of the post or parent comment being answered.
  - `inReplyToUserHandle`: Handle of the user being replied to.
  - `conversationId`: Root conversation ID tying the entire thread together.
  - `isDirectReply`: `true` if replying directly to the original tweet, `false` if part of a sub-reply tree.
  - `isFocalPost`: Identifies the parent/original post if captured.
- **🖼️ Media Attachments:** Complete array of images, highest-bitrate MP4 direct video URLs, and GIFs with dimensions.
- **👤 Author Analytics:** Handle, display name, user ID, verified status, premium subscriber badge, follower count, following count, total post count, follower-to-following ratio, registration timestamp (`accountCreatedAt`), and exact account age in days (`accountAgeDays` via Twitter Snowflake ID decoding).
- **🏷️ Entities:** Extracted arrays of mentioned users (`@handle`), hashtags (`#topic`), and external destination URLs.

***

### 🔓 Guest Mode vs. Cookie Mode

This actor works **100% free without any login or cookies** for public threads. However, Twitter/X caps logged-out visitors to initial public preview replies:

| Feature | Free Guest Mode (No Login) | Cookie Mode (Unlocked) |
|---|---|---|
| **Initial Public Preview Replies** | ✅ Extracts all available preview comments | ✅ Extracts all available preview comments |
| **Original Focal Post Capture** | ✅ Full Data & Metrics | ✅ Full Data & Metrics |
| **Media & Author Analytics** | ✅ Included | ✅ Included |
| **Deep Reply Pagination (300+, 1K+, 10K+)** | ⚠️ Limited by X's logged-out wall | ✅ **Unlimited pagination across all replies** |

> \[!TIP]
> **When should you provide cookies?**
> If a tweet has **3 to 10 comments**, Free Guest Mode captures them immediately with zero setup! If a tweet has **500 or 10,000 comments**, adding your session cookies (`auth_token` & `ct0`) unlocks deep cursor pagination to extract the entire discussion.

***

### 🍪 How to Get Your Twitter / X Cookies (Step-by-Step Guide)

You only need two values: **`auth_token`** and **`ct0`**. Both methods take less than 60 seconds:

#### Method 1: Built-in Chrome DevTools (Application Tab — No Extensions Needed)

Works out of the box in **Google Chrome**, **Microsoft Edge**, and **Brave Browser**:

1. **Log In:** Open [x.com](https://x.com) in your browser and log into your account.
2. **Open Inspect:** Right-click anywhere on the page and select **Inspect** (or press `Ctrl+Shift+I` on Windows/Linux or `Cmd+Option+I` on Mac).
   *(Note: On many laptops, pressing `F12` controls screen brightness or volume. Right-clicking → Inspect always works!)*
3. **Open Application Tab:** In the top DevTools tab bar, click **`>>`** (overflow menu) to reveal hidden tabs, then click **Application**.
4. **Navigate to Cookies:** In the left sidebar: Expand **Storage** → **Cookies** → click **`https://x.com`**.
5. **Copy Tokens:** In the table, find:
   - **`auth_token`**: Double-click its `Value` to copy (40-character hex string).
   - **`ct0`**: Double-click its `Value` to copy (CSRF token string).

![Method 1: Extract Cookies via Application Tab](https://iili.io/nkz7NkB.png)

***

#### Method 2: Using the Free Cookie-Editor Chrome Extension (Fastest — 1 Click)

If you prefer a 1-click visual interface or want to export cookies as a clean JSON array:

1. **Install Extension:** Add the free [Cookie-Editor Extension from Chrome Web Store](https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm?hl=en).
2. **Open on X.com:** Navigate to [x.com](https://x.com) while logged in.
3. **Open Cookie-Editor:**
   - Click the Cookie-Editor icon in your browser's extensions toolbar, **OR**
   - Right-click anywhere → **Inspect** → click **`>>`** in the DevTools bar → select **Cookie-Editor**.
4. **Copy Tokens or Export JSON:**
   - **Option A (Individual Tokens):** Click on `auth_token` to expand and copy the `Value`. Do the same for `ct0`.
   - **Option B (1-Click JSON Export):** Click the **Export** button at the bottom of Cookie-Editor → choose **Export as JSON** → paste the entire JSON array directly into the **Twitter / X Cookies (JSON or String)** field in the actor!

![Method 2: Extract Cookies via Cookie-Editor Extension](https://iili.io/nkz2vWX.png)

***

### ⚙️ Input Configuration

Configure your extraction run using the input parameters below. You only need to provide at least one post URL or status ID.

#### Input Parameters Table

| Field | Type | Description | Default |
|---|---|---|---|
| `postUrls` | Array | **Required.** List of X/Twitter post URLs (e.g. `https://x.com/ZippoJeje/status/1905584213761351970`) or numeric Tweet IDs. | `["https://x.com/ZippoJeje/status/1905584213761351970"]` |
| `maxRepliesPerPost` | Integer | Maximum comments to extract per individual tweet. Leave empty or 0 for unlimited. | `200` |
| `resultLimit` | Integer | Total maximum comments across all posts combined. Leave empty for unlimited. | `500` |
| `includeFocalPost` | Boolean | When enabled, also saves the main original parent tweet in your dataset (marked with `isFocalPost: true`). | `true` |
| `sortOrder` | String | Preferred sorting order for replies (`Relevant`, `Latest`, or `Top`). | `"Relevant"` |
| `minLikes` | Integer | Only include replies with at least this many likes. | `0` |
| `minViews` | Integer | Only include replies with at least this many views/impressions. | `0` |
| `containsImages` | Boolean | When enabled, filters for replies with photo attachments. | `false` |
| `containsVideos` | Boolean | When enabled, filters for replies with video or GIF attachments. | `false` |
| `containsLinks` | Boolean | When enabled, filters for replies with outbound external links. | `false` |
| `verifiedAccountsOnly` | Boolean | When enabled, only extracts replies from verified or Premium commenters. | `false` |
| `contentLanguage` | String | Filter replies by ISO language code (e.g. `en`, `es`, `fr`, `ja`). | `""` (Any Language) |
| `translateToEnglish` | Boolean | Automatically translates foreign-language comments into English (matching X's "Translate post"). Original text is kept in `originalText` with `isTranslated: true`. | `false` |
| `includeUserAnalytics` | Boolean | Enrich each reply with account age in days, follower ratios, and badges. | `true` |
| `extractHashtags` | Boolean | Extract hashtags into a dedicated array field. | `true` |
| `extractMentions` | Boolean | Extract mentioned users into a dedicated array field. | `true` |
| `extractMediaUrls` | Boolean | Extract all media direct URLs into a dedicated array. | `true` |
| `outputTransformFunction`| String | Custom JavaScript function to reshape or filter output objects. | `""` |
| `twitterCookies` | String | Paste exported cookies (JSON array from Cookie-Editor, or `auth_token=...; ct0=...`). | `""` |
| `authToken` | String | Individual `auth_token` cookie value (overrides `twitterCookies` if provided). | `""` |
| `csrfToken` | String | Individual `ct0` CSRF token value. | `""` |

> \[!NOTE]
> **Zero Proxy Setup Required:** Apify rotating datacenter proxies are automatically configured and **100% free ($0.00)**. No manual proxy setup or external proxy subscriptions needed.

***

#### Sample Input Example

```json
{
  "postUrls": [
    "https://x.com/ZippoJeje/status/1905584213761351970"
  ],
  "maxRepliesPerPost": 200,
  "resultLimit": 500,
  "includeFocalPost": true,
  "sortOrder": "Relevant",
  "translateToEnglish": false,
  "minLikes": 0,
  "minViews": 0,
  "containsImages": false,
  "containsVideos": false,
  "containsLinks": false,
  "verifiedAccountsOnly": false,
  "contentLanguage": "",
  "includeUserAnalytics": true,
  "extractHashtags": true,
  "extractMentions": true,
  "extractMediaUrls": true
}
```

***

### 📤 Output Format & Sample Dataset

The actor stores clean, structured records directly in your default Apify dataset. You can download results in **JSON, CSV, Excel, XML, or HTML table** format.

#### Full Output Record Example (Comment Reply)

```json
{
  "entityType": "comment",
  "replyId": "1905692799187730784",
  "replyUrl": "https://x.com/MehdinaMehdi/status/1905692799187730784",
  "legacyReplyUrl": "https://twitter.com/MehdinaMehdi/status/1905692799187730784",
  "authorHandle": "MehdinaMehdi",
  "authorDisplayName": "Mehdi",
  "fullText": "@ZippoJeje Excellent with the title of MC hamer 😂🤣😅",
  "originalText": "@ZippoJeje Excellent avec le titre de MC hamer 😂🤣😅",
  "isTranslated": true,
  "detectedLanguage": "fr",
  "truncatedText": "none",
  "inReplyToPostId": "1905584213761351970",
  "inReplyToUserHandle": "ZippoJeje",
  "conversationId": "1905584213761351970",
  "isDirectReply": true,
  "isFocalPost": false,
  "repostsCount": 3,
  "repliesCount": 2,
  "likesCount": 42,
  "quotesCount": 1,
  "bookmarksCount": 8,
  "viewsCount": 3840,
  "publishedAt": "2025-03-27T16:22:10.000Z",
  "contentLanguage": "fr",
  "sourcePlatform": "Twitter for iPhone",
  "sensitiveContent": false,
  "hashtags": [
    "#humour",
    "#music"
  ],
  "mentionedUsers": [
    "@ZippoJeje"
  ],
  "externalLinks": [
    "https://open.spotify.com/track/12345"
  ],
  "mediaAttachments": [
    {
      "mediaType": "image",
      "mediaUrl": "https://pbs.twimg.com/media/GkxXYZ_WgAA1234.jpg",
      "thumbnailUrl": "https://pbs.twimg.com/media/GkxXYZ_WgAA1234.jpg",
      "width": 1280,
      "height": 720,
      "altText": "Reaction image"
    }
  ],
  "quotedPost": {
    "quotedPostId": "1905500000000000000",
    "quotedPostUrl": "https://x.com/MCHammer/status/1905500000000000000",
    "quotedAuthorHandle": "MCHammer",
    "quotedText": "Can't Touch This!"
  },
  "card": {
    "cardType": "summary_large_image",
    "title": "MC Hammer Greatest Hits",
    "description": "Stream classic tracks on Spotify",
    "linkUrl": "https://open.spotify.com/album/example",
    "thumbnailUrl": "https://pbs.twimg.com/card_img/12345/sample.jpg",
    "domain": "spotify.com"
  },
  "author": {
    "entityType": "author",
    "handle": "MehdinaMehdi",
    "profileUrl": "https://x.com/MehdinaMehdi",
    "legacyProfileUrl": "https://twitter.com/MehdinaMehdi",
    "userId": "987654321012345678",
    "displayName": "Mehdi",
    "isVerifiedAccount": true,
    "isPremiumSubscriber": true,
    "verificationCategory": "Standard",
    "avatarUrl": "https://pbs.twimg.com/profile_images/1732466643324817408/2TxLmVGt_normal.jpg",
    "bannerUrl": "https://pbs.twimg.com/profile_banners/987654321/header.jpg",
    "bioText": "Tech enthusiast, digital creative & music lover 🎧",
    "websiteUrl": "https://mehdina.dev",
    "location": "Paris, France",
    "followerCount": 14200,
    "followingCount": 680,
    "totalPostCount": 5120,
    "listedCount": 84,
    "accountCreatedAt": "2018-04-12T10:15:30.000Z",
    "isProtected": false,
    "followerToFollowingRatio": 20.88,
    "accountAgeDays": 2580
  },
  "engagementRate": 1.46,
  "extractedAt": "2026-11-12T10:20:00.000Z"
}
```

***

### 💡 Business Use Cases

- **📊 Sentiment & Public Reaction Analysis:** Gauge authentic audience reaction to product announcements, political speeches, and corporate crises.
- **🛡️ Brand Reputation & Crisis Management:** Monitor hostile or supportive reply threads in real time to catch emerging PR issues before they escalate.
- **🤝 Customer Support & Feature Discovery:** Aggregate user bug reports, complaint threads, and feature requests directly from product release tweets.
- **🧠 AI & LLM Training:** Extract natural conversational trees, debate dialogs, and question-and-answer pairs for fine-tuning conversational AI models.
- **🔍 Influencer & Creator Feedback:** Analyze audience engagement quality, top commenter profiles, and reaction sentiment on sponsored posts.

***

### ❓ Frequently Asked Questions (FAQ)

#### Can I scrape multiple post URLs in a single run?

Yes. Add as many URLs or Tweet IDs as you need to `postUrls`. The scraper processes them sequentially, distributing your `maxRepliesPerPost` and `resultLimit` gracefully.

#### Does this scraper support deep sub-replies (replies to replies)?

Yes. Conversation modules and nested tree replies are captured automatically with parent tracking (`inReplyToPostId` and `isDirectReply: false`).

#### What if a tweet has no comments yet?

If a post has zero replies, the actor simply logs that no comments were found and charges **$0.00** for replies. You only incur the base startup micro-charge ($0.0005).

#### Are proxies included in the price?

Yes! Automated Apify Datacenter Proxies and high-speed cloud compute are **100% included for free** with no hidden hourly or bandwidth fees.

***

### 🏷️ Tags & Categories

`twitter-comments`, `twitter-replies`, `x-comments-scraper`, `twitter-thread-extractor`, `tweet-replies`, `x-thread-scraper`, `social-media-sentiment`, `conversation-analysis`, `tweet-comments-downloader`, `twitter-scraper`, `x-scraper`

***

### 👨‍💻 Support & Developer Info

Developed and maintained with ❤️ by **codescraper**.

Need assistance, custom feature integrations, or enterprise volume handling?

- **Email:** <codescraper011@gmail.com>
- **Author Profile:** [Apify Store - codescraper](https://apify.com/codescraper)

# Actor input Schema

## `postUrls` (type: `array`):

List of X/Twitter post URLs or numeric IDs to scrape comments and conversation replies from.

## `maxRepliesPerPost` (type: `integer`):

Maximum number of comments to extract per individual post. Leave empty or set to 0 for unlimited.

## `resultLimit` (type: `integer`):

Total maximum comments/replies to extract across all posts combined. Leave empty for unlimited.

## `includeFocalPost` (type: `boolean`):

When enabled, also saves the main original parent tweet in your dataset (marked with isFocalPost: true) alongside its replies.

## `sortOrder` (type: `string`):

Preferred sorting order for conversation replies.

## `minLikes` (type: `integer`):

Only include replies with at least this many likes (favorites).

## `minViews` (type: `integer`):

Only include replies with at least this many views/impressions.

## `containsImages` (type: `boolean`):

When enabled, only extracts replies that include photo attachments.

## `containsVideos` (type: `boolean`):

When enabled, only extracts replies that include video or animated GIF attachments.

## `containsLinks` (type: `boolean`):

When enabled, only extracts replies that contain outbound links.

## `verifiedAccountsOnly` (type: `boolean`):

When enabled, only extracts replies from verified or Premium (X Blue) accounts.

## `contentLanguage` (type: `string`):

Filter replies by ISO 639-1 language code (e.g. 'en' for English, 'es' for Spanish, 'fr' for French, 'ja' for Japanese).

## `translateToEnglish` (type: `boolean`):

Automatically translates foreign-language comments and replies into English (matching the 'Translate post' feature on X). Preserves the original text in 'originalText' and marks 'isTranslated: true'.

## `includeUserAnalytics` (type: `boolean`):

When enabled, includes detailed commenter profile analytics (follower ratio, account age in days, verification category).

## `extractHashtags` (type: `boolean`):

When enabled, extracts all hashtags into a separate array field for easy analysis.

## `extractMentions` (type: `boolean`):

When enabled, extracts all mentioned users into a separate array field.

## `extractMediaUrls` (type: `boolean`):

When enabled, extracts all media (images, high-bitrate video MP4s, GIFs) into a clean array.

## `outputTransformFunction` (type: `string`):

Custom JavaScript function to transform each output object. The function receives the comment record and returns transformed data. Example: (item) => ({ text: item.fullText, author: item.authorHandle, likes: item.likesCount })

## `twitterCookies` (type: `string`):

Paste exported cookies from Cookie-Editor (JSON array) or raw header string ('auth_token=...; ct0=...').

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

Your 40-character Twitter auth_token from Application > Cookies.

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

Your Twitter ct0 CSRF token string from Application > Cookies.

## Actor input object example

```json
{
  "postUrls": [
    "https://x.com/ZippoJeje/status/1905584213761351970"
  ],
  "maxRepliesPerPost": 200,
  "resultLimit": 200,
  "includeFocalPost": true,
  "sortOrder": "Relevant",
  "containsImages": false,
  "containsVideos": false,
  "containsLinks": false,
  "verifiedAccountsOnly": false,
  "translateToEnglish": false,
  "includeUserAnalytics": true,
  "extractHashtags": true,
  "extractMentions": true,
  "extractMediaUrls": true
}
```

# Actor output Schema

## `results` (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 = {
    "postUrls": [
        "https://x.com/ZippoJeje/status/1905584213761351970"
    ],
    "maxRepliesPerPost": 200,
    "resultLimit": 200
};

// Run the Actor and wait for it to finish
const run = await client.actor("codescraper/twitter-comments-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 = {
    "postUrls": ["https://x.com/ZippoJeje/status/1905584213761351970"],
    "maxRepliesPerPost": 200,
    "resultLimit": 200,
}

# Run the Actor and wait for it to finish
run = client.actor("codescraper/twitter-comments-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 '{
  "postUrls": [
    "https://x.com/ZippoJeje/status/1905584213761351970"
  ],
  "maxRepliesPerPost": 200,
  "resultLimit": 200
}' |
apify call codescraper/twitter-comments-replies-scraper --silent --output-dataset

```

## MCP server setup

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