# Twitter Comment Scraper (`mikolabs/twitter-comment-scraper`) Actor

Extract Twitter/X comments & replies from any tweet in seconds. 🔓 No login, no API keys. 📊 Get author profiles, engagement stats, media, hashtags & metadata as structured JSON. Sort by relevance, recency, or likes. 💰 At $5 per 1,000 results.

- **URL**: https://apify.com/mikolabs/twitter-comment-scraper.md
- **Developed by:** [Mikolabs](https://apify.com/mikolabs) (community)
- **Categories:** Social media, Lead generation, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $5.00 / 1,000 results

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/platform/actors/running/actors-in-store#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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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 (X) Comment Scraper

> **Extract comments, replies & engagement data from any tweet at scale — no login, no API keys, no tokens.**

**Twitter (X) Comment Scraper** is a lightning-fast, cookieless Apify actor that extracts comments and replies from any public tweet — **20+ comments in under 2 seconds**, no login required. It captures full author profiles, engagement stats (likes, retweets, quotes, bookmarks, views), media attachments (images, videos, GIFs), hashtags, mentions, and conversation metadata. Sort replies by relevance, recency, or likes. Filter by minimum engagement. Batch-scrape multiple tweets in a single run. Returns clean, structured JSON ready for sentiment analysis, lead generation, brand monitoring, competitive research, and influencer vetting — at just **$5 per 1,000 results**.

#### 🔓 No Login · No API Keys · No Tokens · Unlimited Scraping

| | |
|---|---|
| 🚫 **Zero Authentication** | No Twitter account, no developer tokens, no API keys — just paste a tweet URL and go. |
| ♾️ **Unlimited Scraping** | No daily quotas or artificial caps. Scrape as many tweets and comments as you need. |
| 💰 **$5 per 1,000 Results** | Transparent, predictable pricing. Pay only for what you use — no subscriptions, no hidden fees. |
| ⚡ **Instant Results** | Get structured JSON data in seconds. Export as JSON, CSV, or Excel with one click. |

---

### 📑 Table of Contents

- [Key Features](#-key-features)
- [Pricing](#-pricing)
- [Use Cases](#-use-cases)
- [Getting Started](#-getting-started)
- [Input Parameters](#-input-parameters)
- [Output Data Schema](#-output-data-schema)
- [Example Output](#-example-output)
- [Exporting & Integrating Data](#-exporting--integrating-data)
- [Tips & Best Practices](#-tips--best-practices)
- [Limitations](#-limitations)
- [FAQ](#-frequently-asked-questions)
- [Related Actors](#-related-actors)
- [Support & Feedback](#-support--feedback)

---

### ✨ Key Features

| Feature | Description |
|---|---|
| 🔓 **No Login Required** | Completely cookieless — no Twitter account, no API keys, no developer tokens needed. Just paste a tweet URL. |
| ♾️ **Unlimited Scraping** | No daily limits, no quotas. Scrape as many tweets and comments as your workflow demands. |
| 💰 **$5 / 1,000 Results** | Simple, transparent pay-per-use pricing with no subscriptions or hidden fees. |
| **Batch Tweet Scraping** | Provide multiple tweet URLs in a single run and scrape comments from all of them. |
| **Flexible Sorting** | Sort replies by **Relevance**, **Recency**, or **Likes** to surface the data you care about. |
| **Engagement Filtering** | Set a **minimum likes** threshold to filter out low-engagement noise. |
| **Rich User Profiles** | Capture author username, display name, bio, location, follower / following counts, verification status, and more. |
| **Full Engagement Metrics** | Likes, retweets, replies, quotes, bookmarks, and view counts for every comment. |
| **Media Extraction** | Images, videos, and GIFs — including thumbnail URLs, video URLs, and duration. |
| **Commenter Stats** | Optionally fetch full stats (followers, following, tweet count, etc.) for each commenter. |
| **Conversation Metadata** | Conversation IDs, reply-to IDs, edit history, language, source app, and more. |
| **Scalable & Cloud-Ready** | Runs on the Apify platform with automatic retries, proxy support, and dataset storage. |

---

### 💰 Pricing

| Volume | Cost | Per Result |
|---|---|---|
| 1,000 results | **$5.00** | $0.005 |
| 5,000 results | **$25.00** | $0.005 |
| 10,000 results | **$50.00** | $0.005 |
| 50,000 results | **$250.00** | $0.005 |

> **Flat rate. No subscriptions. No hidden fees.** You pay only for the results you scrape. Pricing is based on Apify platform compute usage at approximately **$5 per 1,000 comment results**.

---

### 🎯 Use Cases

- **Sentiment Analysis** — Gauge public opinion on viral tweets, product launches, or brand mentions.
- **Lead Generation** — Identify potential customers engaging with competitor content.
- **Brand Monitoring** — Track replies to your brand's tweets and surface complaints or praise.
- **Competitive Research** — Analyze engagement patterns on competitor posts.
- **Market Research** — Understand audience reactions to industry trends and announcements.
- **Content Strategy** — Discover which reply styles generate the most engagement.
- **Influencer Vetting** — Review comment quality and engagement on an influencer's posts.
- **Journalism & OSINT** — Collect public discourse around breaking news events.

---

### 🚀 Getting Started

#### Prerequisites

- An [Apify](https://apify.com) account (free tier available).
- That's it — **no Twitter account, no API keys, no tokens required**.

#### Quick Start (3 Steps)

1. **Open** the [Twitter (X) Comment Scraper](https://apify.com/mikolabs/twitter-comment-scraper) actor page on Apify.
2. **Paste** one or more tweet URLs — configure sorting, filters, and limits as needed.
3. **Run** and download your data as JSON, CSV, or Excel. Done.

> 💡 **No login, no cookies, no authentication of any kind.** Just provide tweet URLs and start scraping instantly.

---

### ⚙️ Input Parameters

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `tweetUrls` | `string[]` | ✅ Yes | `[]` | One or more Twitter/X tweet URLs to scrape comments from. Format: `https://x.com/username/status/123456789` |
| `sortReplies` | `string` | No | `Relevance` | How to sort replies. Options: `Relevance`, `Recency`, `Likes` |
| `minLikes` | `integer` | No | `0` | Minimum number of likes a comment must have to be included. Set to `0` to include all comments. |
| `includeCommenterStats` | `boolean` | No | `false` | Fetch full profile stats (followers, following, tweet count, etc.) for each commenter. **Note:** Enabling this significantly slows down scraping as it requires an additional request per comment. |
| `maxComments` | `integer` | No | `0` | Maximum number of comments to extract per tweet. Set to `0` for unlimited. |

#### Example Input

```json
{
  "tweetUrls": [
    "https://x.com/elonmusk/status/2000645900549685307",
    "https://x.com/OpenAI/status/1234567890123456789"
  ],
  "sortReplies": "Likes",
  "minLikes": 10,
  "includeCommenterStats": false,
  "maxComments": 100
}
````

***

### 📦 Output Data Schema

Each scraped comment is stored as a JSON object in the Apify dataset. Below is a detailed breakdown of every field.

#### Comment Fields

| Field | Type | Description |
|---|---|---|
| `replying_to_tweet` | `string` | URL of the original tweet this comment replies to |
| `tweet_url` | `string` | Direct URL to this comment |
| `text` | `string` | Full text content of the comment |
| `date` | `string` | ISO timestamp of when the comment was posted |
| `conversation_id` | `string` | ID of the main conversation thread |
| `in_reply_to_tweet_id` | `string` | ID of the tweet this comment is replying to |
| `is_quote_tweet` | `boolean` | Whether this comment is a quote tweet |
| `quoted_tweet` | `object\|null` | Quoted tweet data (if applicable) |
| `lang` | `string` | Language code of the comment (e.g., `en`, `es`, `ja`) |
| `source` | `string` | Client used to post (e.g., `Twitter for iPhone`) |
| `is_edited` | `boolean` | Whether the comment has been edited |
| `edits_remaining` | `string` | Number of edits remaining |
| `possibly_sensitive` | `boolean` | Whether the content may be sensitive |
| `has_community_notes` | `boolean` | Whether the comment has community notes |

#### Author Information (`author`)

| Field | Type | Description |
|---|---|---|
| `author.id` | `string` | Unique Twitter user ID |
| `author.name` | `string` | Display name |
| `author.screen_name` | `string` | Username / handle (without `@`) |
| `author.avatar` | `string` | Profile image URL |
| `author.is_verified` | `boolean` | Twitter Blue verification status |

#### Author Information with `includeCommenterStats: true`

When `includeCommenterStats` is enabled, the `author` object is enriched with additional profile data:

| Field | Type | Description |
|---|---|---|
| `author.description` | `string` | User bio |
| `author.location` | `string` | User location |
| `author.followers_count` | `integer` | Number of followers |
| `author.following_count` | `integer` | Number of accounts followed |
| `author.tweet_count` | `integer` | Total tweets posted |
| `author.favourites_count` | `integer` | Total likes given |
| `author.media_count` | `integer` | Media items uploaded |
| `author.lists_count` | `integer` | Lists the user is a member of |
| `author.account_created_at` | `string` | Account creation date |
| `author.profile_banner` | `string` | Banner image URL |
| `author.is_protected` | `boolean` | Whether the account is private |
| `author.pinned_tweet_ids` | `string[]` | IDs of pinned tweets |
| `author.profile_url` | `string` | Website URL |
| `author.professional_info` | `object\|null` | Professional account category and type |

#### Engagement Metrics (`stats`)

| Field | Type | Description |
|---|---|---|
| `stats.likes` | `integer` | Number of likes |
| `stats.replies` | `integer` | Number of replies |
| `stats.retweets` | `integer` | Number of retweets |
| `stats.quotes` | `integer` | Number of quote tweets |
| `stats.bookmarks` | `integer` | Number of bookmarks |
| `stats.views` | `string` | Number of views |

#### Entities

| Field | Type | Description |
|---|---|---|
| `entities.hashtags` | `array` | Hashtags used in the comment |
| `entities.user_mentions` | `array` | Users mentioned in the comment |
| `entities.urls` | `array` | URLs included in the comment |
| `entities.media` | `array` | Media attachments with metadata |

#### Media Attachments (`media`)

| Field | Type | Description |
|---|---|---|
| `media[].type` | `string` | Media type: `photo`, `video`, or `animated_gif` |
| `media[].thumb_url` | `string` | Thumbnail image URL |
| `media[].url` | `string` | Media page URL |
| `media[].video_url` | `string\|null` | Direct video file URL (videos only) |
| `media[].duration_ms` | `integer\|null` | Video duration in milliseconds (videos only) |

***

### 📋 Example Output

```json
{
  "replying_to_tweet": "https://x.com/elonmusk/status/2000645900549685307",
  "tweet_url": "https://x.com/ClownWorld/status/2000650156405072211",
  "conversation_id": "2000645900549685307",
  "in_reply_to_tweet_id": "2000645900549685307",
  "is_quote_tweet": false,
  "quoted_tweet": null,
  "author": {
    "id": "1446932149148344320",
    "name": "Clown World ™ 🤡",
    "screen_name": "ClownWorld",
    "avatar": "https://pbs.twimg.com/profile_images/2007190860690046977/ZAITQvgd_normal.jpg",
    "is_verified": true
  },
  "text": "@elonmusk Haters will say this is AI https://t.co/djLDxhqJlw",
  "date": "Mon Dec 15 19:32:22 +0000 2025",
  "stats": {
    "likes": 4430,
    "replies": 748,
    "retweets": 575,
    "quotes": 49,
    "bookmarks": 175,
    "views": "812441"
  },
  "entities": {
    "hashtags": [],
    "urls": [],
    "user_mentions": [
      {
        "id_str": "44196397",
        "name": "Elon Musk",
        "screen_name": "elonmusk"
      }
    ]
  },
  "media": [
    {
      "type": "video",
      "thumb_url": "https://pbs.twimg.com/amplify_video_thumb/2000650105603686400/img/R4soCzawh48AMneU.jpg",
      "url": "https://x.com/ClownWorld/status/2000650156405072211/video/1",
      "video_url": "https://video.twimg.com/amplify_video/2000650105603686400/vid/avc1/464x688/HobG6DrrCTZ3n-T8.mp4?tag=23",
      "duration_ms": 6041
    }
  ],
  "lang": "en",
  "source": "Twitter for iPhone",
  "has_community_notes": false,
  "is_edited": false,
  "edits_remaining": "5",
  "is_translatable": false,
  "possibly_sensitive": false
}
```

> **Note:** The above is a single comment object. A full run returns an array of these objects — one per scraped comment.

***

### 📤 Exporting & Integrating Data

Apify makes it easy to consume your scraped data:

| Format | Method |
|---|---|
| **JSON / CSV / Excel** | Download directly from the Apify dataset UI |
| **REST API** | Access data programmatically via the [Apify API](https://docs.apify.com/api/v2) |
| **Webhooks** | Trigger notifications or downstream pipelines on run completion |
| **Integrations** | Connect to Google Sheets, Slack, Zapier, Make, and more via [Apify Integrations](https://apify.com/integrations) |

#### API Access Example

```bash
## Fetch results as JSON
curl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<YOUR_API_TOKEN>"

## Fetch results as CSV
curl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?format=csv&token=<YOUR_API_TOKEN>"
```

#### Python Integration

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")

run_input = {
    "tweetUrls": ["https://x.com/elonmusk/status/2000645900549685307"],
    "sortReplies": "Likes",
    "minLikes": 5,
    "maxComments": 50
}

run = client.actor("your-actor-id").call(run_input=run_input)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f"@{item['author']['screen_name']}: {item['text']}")
    print(f"  ❤️ {item['stats']['likes']}  🔁 {item['stats']['retweets']}")
```

#### JavaScript / Node.js Integration

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });

const run = await client.actor('your-actor-id').call({
    tweetUrls: ['https://x.com/elonmusk/status/2000645900549685307'],
    sortReplies: 'Likes',
    minLikes: 5,
    maxComments: 50,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach(item => {
    console.log(`@${item.author.screen_name}: ${item.text}`);
    console.log(`  ❤️ ${item.stats.likes}  🔁 ${item.stats.retweets}`);
});
```

***

### 💡 Tips & Best Practices

1. **Zero setup** — No accounts, tokens, or cookies needed. Just paste tweet URLs and run.
2. **Start small** — Test with a small `maxComments` value (e.g., `20`) before running large-scale scrapes to validate your setup.
3. **Use `minLikes` to reduce noise** — High-engagement comments are typically more relevant for analysis.
4. **Sort by `Likes`** for research — The most-liked comments surface the strongest community consensus.
5. **Sort by `Recency`** for monitoring — Get the freshest replies for real-time brand monitoring.
6. **Enable `includeCommenterStats` selectively** — This adds an extra HTTP request per comment and significantly increases run time. Only enable it when you need detailed profile data.
7. **Batch multiple tweets** — Provide multiple URLs in a single run to save on actor start-up overhead.
8. **Schedule recurring runs** — Use Apify's scheduling feature to monitor tweet replies over time.

***

### ⚠️ Limitations

- **Pagination limits** — Due to Twitter's interface constraints, the actor can retrieve a maximum of approximately **200 comments per tweet** in a single run.
- **No nested replies** — The scraper collects top-level replies visible on the tweet screen. Deeply nested conversation threads are not expanded.
- **Rate limiting** — Excessive scraping may trigger Twitter's rate limiting. Space out large runs accordingly.
- **Public tweets only** — The actor can only scrape comments on publicly visible tweets.

***

### ❓ Frequently Asked Questions

<details>
<summary><strong>Do I need a Twitter account, API key, or any login?</strong></summary>

**No.** This actor is completely cookieless and requires zero authentication. No Twitter account, no developer tokens, no API keys — just paste a tweet URL and run.

</details>

<details>
<summary><strong>How much does it cost?</strong></summary>

Approximately **$5 per 1,000 results**. Pricing is based on Apify platform compute usage — no subscriptions, no hidden fees. You pay only for what you scrape.

</details>

<details>
<summary><strong>Is there a limit on how many comments I can scrape?</strong></summary>

**No artificial limits.** You can scrape as many tweets and comments as you need. Each individual tweet can return up to ~200 top-level comments due to Twitter's interface, but you can batch unlimited tweet URLs in a single run.

</details>

<details>
<summary><strong>Why am I getting 0 results?</strong></summary>

Make sure the tweet URL is correct and the tweet is publicly visible. If the tweet is from a protected account or has been deleted, no comments can be retrieved.

</details>

<details>
<summary><strong>Can I scrape comments from protected / private accounts?</strong></summary>

No. The actor works without authentication, so it can only access publicly visible tweets and their replies.

</details>

<details>
<summary><strong>What is the `includeCommenterStats` option?</strong></summary>

When enabled, the actor makes an additional request for each commenter to fetch their full profile data (followers, following, bio, etc.). This provides richer data but increases run time.

</details>

<details>
<summary><strong>Can I filter comments by date?</strong></summary>

The actor does not currently support date-based filtering. However, you can sort by `Recency` and set a `maxComments` limit to approximate recent-only scraping, or post-process the results using the `date` field.

</details>

<details>
<summary><strong>Is there a free trial?</strong></summary>

Yes! Apify offers a free tier with a monthly allowance of compute units — enough to test the actor and run small scraping jobs at no cost.

</details>

***

### 🔗 More from Mikolabs — Twitter / X Scraping Suite

This actor is part of the **Mikolabs Twitter / X Scraping Suite** on Apify. Check out our other actors:

| Actor | Description | Link |
|---|---|---|
| 🔍 **X (Twitter) Advanced Search Tweet Scraper** | Scrape tweets using Twitter's powerful advanced search operators — by keyword, hashtag, user, date range, engagement, and more. | [**Try it →**](https://apify.com/mikolabs/x-twitter-advanced-search-tweet-scraper) |
| 📥 **X (Twitter) Media Downloader** | Download images, videos, and GIFs from any tweet or user timeline. Bulk export media at scale. | [**Try it →**](https://apify.com/mikolabs/x-twitter-media-downloader) |
| 🐦 **Twitter / X Scraper — Complete Suite** | The all-in-one Twitter scraper — extract tweets, profiles, followers, search results, and more in a single actor. | [**Try it →**](https://apify.com/mikolabs/tweets-scraper) |
| 💬 **Twitter (X) Comment Scraper** | *(You are here)* Extract comments & replies from any tweet with engagement data. | [**Try it →**](https://apify.com/mikolabs/twitter-comment-scraper) |

***

### 🤝 Support & Feedback

- **⭐ Leave a review** — If you found this actor useful, [drop us a review](https://console.apify.com/actors/P7D4V821Hh3rg3WQO/reviews) — it helps a lot!
- **🐛 Issues or bugs?** — [Report an issue](https://console.apify.com/actors/P7D4V821Hh3rg3WQO/issues) on the Apify actor page.
- **💡 Feature requests?** — Submit via [Apify Issues](https://console.apify.com/actors/P7D4V821Hh3rg3WQO/issues) or contact us on [Apify](https://apify.com/mikolabs).
- **❓ Questions?** — Reach out through the Apify actor's discussion section.
- **⚡ Direct API Access & Tools** — Check out our full suite of APIs at [mikolabs.xyz/apis](https://mikolabs.xyz/apis/).
- **📦 More actors?** — Browse all Mikolabs actors at [apify.com/mikolabs](https://apify.com/mikolabs).

***

<p align="center">
  Built with ❤️ by <a href="https://apify.com/mikolabs">Mikolabs</a> · Powered by <a href="https://apify.com">Apify</a>
</p>

# Actor input Schema

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

Paste one or more Twitter/X tweet URLs to scrape comments from. Supports batch scraping — add as many URLs as you need in a single run.

Format: <code>https://x.com/username/status/123456789</code>

## `maxComments` (type: `integer`):

Maximum number of comments to extract from each tweet URL. Set to <b>0</b> for unlimited (scrapes all available comments).

<b>💡 Tip:</b> Start with a small number (e.g. 20) to test, then scale up. Each tweet can yield up to ~200 top-level replies.

## `sortReplies` (type: `string`):

Choose how to sort the scraped replies:
• <b>Relevant</b> — Twitter's default algorithm ranking (best for general analysis)
• <b>Recent</b> — Newest comments first (best for real-time monitoring)
• <b>Liked</b> — Most liked comments first (best for finding top reactions)

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

Only include comments that have at least this many likes. Great for filtering out noise and surfacing high-quality, high-engagement replies.

Set to <b>0</b> to include all comments regardless of likes.

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

Apify proxy configuration (requires paid plan)

## `includeCommenterStats` (type: `boolean`):

Enrich each comment with the author's full profile data — followers, following, tweet count, bio, location, account age, and more.

<b>⚠️ Note:</b> This makes an extra request per comment and will significantly increase run time. Enable only when you need detailed commenter analytics (e.g., influencer vetting, lead scoring).

## Actor input object example

```json
{
  "tweetUrls": [
    "https://x.com/JensenHuang/status/2080643682408321103"
  ],
  "maxComments": 10,
  "sortReplies": "Relevance",
  "minLikes": 0,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "includeCommenterStats": false
}
```

# 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 = {
    "tweetUrls": [
        "https://x.com/JensenHuang/status/2080643682408321103"
    ],
    "maxComments": 10,
    "minLikes": 0
};

// Run the Actor and wait for it to finish
const run = await client.actor("mikolabs/twitter-comment-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 = {
    "tweetUrls": ["https://x.com/JensenHuang/status/2080643682408321103"],
    "maxComments": 10,
    "minLikes": 0,
}

# Run the Actor and wait for it to finish
run = client.actor("mikolabs/twitter-comment-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "tweetUrls": [
    "https://x.com/JensenHuang/status/2080643682408321103"
  ],
  "maxComments": 10,
  "minLikes": 0
}' |
apify call mikolabs/twitter-comment-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=mikolabs/twitter-comment-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Twitter Comment Scraper",
        "description": "Extract Twitter/X comments & replies from any tweet in seconds. 🔓 No login, no API keys. 📊 Get author profiles, engagement stats, media, hashtags & metadata as structured JSON. Sort by relevance, recency, or likes. 💰 At $5 per 1,000 results.",
        "version": "0.0",
        "x-build-id": "KD0fNUCmHhwkqfEp7"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/mikolabs~twitter-comment-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-mikolabs-twitter-comment-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/mikolabs~twitter-comment-scraper/runs": {
            "post": {
                "operationId": "runs-sync-mikolabs-twitter-comment-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/mikolabs~twitter-comment-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-mikolabs-twitter-comment-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "tweetUrls"
                ],
                "properties": {
                    "tweetUrls": {
                        "title": "🔗 Tweet URLs",
                        "type": "array",
                        "description": "Paste one or more Twitter/X tweet URLs to scrape comments from. Supports batch scraping — add as many URLs as you need in a single run.\n\nFormat: <code>https://x.com/username/status/123456789</code>",
                        "default": [
                            "https://x.com/JensenHuang/status/2080643682408321103"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxComments": {
                        "title": "🔢 Max Comments per Tweet",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum number of comments to extract from each tweet URL. Set to <b>0</b> for unlimited (scrapes all available comments).\n\n<b>💡 Tip:</b> Start with a small number (e.g. 20) to test, then scale up. Each tweet can yield up to ~200 top-level replies.",
                        "default": 10
                    },
                    "sortReplies": {
                        "title": "📊 Sort Replies By",
                        "enum": [
                            "Relevance",
                            "Recency",
                            "Likes"
                        ],
                        "type": "string",
                        "description": "Choose how to sort the scraped replies:\n• <b>Relevant</b> — Twitter's default algorithm ranking (best for general analysis)\n• <b>Recent</b> — Newest comments first (best for real-time monitoring)\n• <b>Liked</b> — Most liked comments first (best for finding top reactions)",
                        "default": "Relevance"
                    },
                    "minLikes": {
                        "title": "❤️ Minimum Likes Filter",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Only include comments that have at least this many likes. Great for filtering out noise and surfacing high-quality, high-engagement replies.\n\nSet to <b>0</b> to include all comments regardless of likes.",
                        "default": 0
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Apify proxy configuration (requires paid plan)",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ]
                        }
                    },
                    "includeCommenterStats": {
                        "title": "👤 Include Commenter Profile Stats",
                        "type": "boolean",
                        "description": "Enrich each comment with the author's full profile data — followers, following, tweet count, bio, location, account age, and more.\n\n<b>⚠️ Note:</b> This makes an extra request per comment and will significantly increase run time. Enable only when you need detailed commenter analytics (e.g., influencer vetting, lead scoring).",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
