Twitter (X) Comment Scraper avatar
Twitter (X) Comment Scraper

Pricing

$14.99/month + usage

Go to Apify Store
Twitter (X) Comment Scraper

Twitter (X) Comment Scraper

This Apify actor scrapes comments from a given tweet and collects detailed information such as user profiles, engagement metrics and media content. It includes data such as username, number of followers, tweet content, number of likes and retweets. Media types and durations are also included.

Pricing

$14.99/month + usage

Rating

5.0

(3)

Developer

Muhammet Akkurt

Muhammet Akkurt

Maintained by Community

Actor stats

10

Bookmarked

360

Total users

7

Monthly active users

1 hours

Issues response

16 days ago

Last modified

Share

Twitter (X) Comment Scraper

Twitter (X) Comment Scraper

This Apify actor is designed to scrape comments from a specific tweet.

Features

This actor provides comprehensive data collection capabilities from Twitter comments. It scrapes comments from a specific tweet and extracts detailed information including user profiles, engagement metrics, and media content. The collected data encompasses user details such as username, follower counts, and verification status, along with tweet-specific information including content, timestamps, and engagement statistics. For media-rich tweets, it captures various media types including images, videos, and GIFs, along with their associated metadata. The actor offers flexible comment sorting options, allowing users to sort comments by relevance, newest, or most liked to better suit their data collection needs.

The scraper is designed to handle Twitter's modern interface and can collect data such as:

  • Comprehensive user profile information including bio, location, tweet counts, and Twitter Blue verification status
  • Complete tweet content with engagement metrics (likes, retweets, replies, quotes)
  • Advanced statistics like bookmark counts and view counts
  • Detailed media information including video quality and duration
  • Tweet metadata such as creation time, language, source application, and entities (hashtags, mentions)
  • Conversation details like reply-to and conversation IDs
  • Flexible comment sorting options (relevance, newest, most liked)

You can use the Cookie Editor extension to obtain Twitter cookie information. Follow these steps:

  1. Add the Cookie Editor extension to your Chrome browser.
  2. Log in to Twitter.
  3. Click on the Cookie Editor icon in the top right corner of your browser.
  4. Click the "Export" button to export your cookie information in JSON format.
  5. Use this JSON string as the cookieJson input.

Note: You can validate with a tool like JSONLint to make sure your JSON input is correct.

Note: If you encounter errors or if 0 comments are processed, ensure that your account is functioning normally and log in again to obtain new cookies to use as input.

Usage

  1. Run this actor in the Apify console.
  2. Provide the desired inputs:
  • tweetUrl: The URL of the tweet you want to scrape comments from.
  • cookieJson: A JSON string containing your Twitter account's cookie information.
  • maxDepth: Maximum comment depth (0 = unlimited).
  • sortBy: Sort comments by relevance (default), newest, or most liked.
  • onlyDirectReplies: Show only replies to the tweet owner (default: true).

Output

The scraped comments are saved to the Apify dataset. The output data includes:

User Information

  • user.id: Unique user ID
  • user.name: Username
  • user.screen_name: User tag
  • user.account_created_at: Account creation date
  • user.description: User's biography
  • user.location: User's location
  • user.followers_count: Number of followers
  • user.following_count: Number of following
  • user.favourites_count: Number of likes by the user
  • user.tweet_count: Total number of tweets by the user
  • user.media_count: Number of media items uploaded by the user
  • user.lists_count: Number of lists the user is on
  • user.profile_image: Profile image URL
  • user.profile_banner: Profile banner URL
  • user.profile_image_shape: Profile image shape (Circle, Square, etc.)
  • user.is_blue_verified: Twitter Blue verification status
  • user.is_verified: Legacy verification status
  • user.is_protected: Whether the account is protected
  • user.default_profile: Whether user has default profile settings
  • user.default_profile_image: Whether user has default profile image
  • user.pinned_tweet_ids: Array of pinned tweet IDs
  • user.profile_url: User's website URL
  • user.professional_info: Professional account details (if available)
  • user.tipjar_settings: Tip jar configuration (if available)

Tweet Information

  • tweet_id: Unique ID of the tweet/comment
  • tweet_url: Direct URL to the tweet
  • conversation_id: ID of the main conversation thread
  • in_reply_to_tweet_id: ID of the tweet being replied to
  • is_quote_tweet: Whether the tweet is a quote tweet
  • quoted_tweet: Quoted tweet data (if applicable)
  • text: Tweet content
  • entities: Hashtags, mentions, and URLs within the tweet
  • reply_to_username: Username being replied to
  • reply_to_user_id: User ID being replied to
  • favorite_count: Number of likes
  • reply_count: Number of replies
  • retweet_count: Number of retweets
  • quote_count: Number of quotes
  • bookmark_count: Number of bookmarks
  • views_count: Number of views
  • created_at: Creation timestamp
  • lang: Tweet language
  • source: Tweet source
  • has_community_notes: Whether tweet has community notes
  • is_edited: Whether tweet has been edited
  • edits_remaining: Number of edits remaining
  • is_translatable: Whether tweet can be translated
  • possibly_sensitive: Whether content may be sensitive

Media Information

  • media: Media content (images, videos, GIFs)
    • type: Media type
    • thumb_url: Thumbnail URL
    • url: Media URL
    • video_url: Video URL (if applicable)
    • duration_ms: Video duration (if applicable)

Example Output

{
"tweet_id": "2000650156405072211",
"tweet_url": "https://x.com/ClownWorld/status/2000650156405072211",
"conversation_id": "2000645900549685307",
"in_reply_to_tweet_id": "2000645900549685307",
"is_quote_tweet": false,
"quoted_tweet": null,
"user": {
"id": "1446932149148344320",
"name": "Clown World ™ 🤡",
"screen_name": "ClownWorld",
"account_created_at": "Sat Oct 09 20:14:52 +0000 2021",
"followers_count": 3105744,
"following_count": 1143,
"favourites_count": 32242,
"description": "ClownWorld™ 🤡🌎 The circus never stops. Uploads daily. DM for credit 📩 | removal ❌ | collabs/biz 🤝",
"location": "DM Submissions 📧 ",
"profile_image": "https://pbs.twimg.com/profile_images/1964008612118016000/eYXgsXb-_normal.jpg",
"profile_banner": "https://pbs.twimg.com/profile_banners/1446932149148344320/1756384799",
"profile_image_shape": "Circle",
"is_blue_verified": true,
"is_verified": false,
"is_protected": false,
"default_profile": true,
"default_profile_image": false,
"tweet_count": 35667,
"lists_count": 6805,
"media_count": 13797,
"pinned_tweet_ids": [
"2001858480119181533"
],
"profile_url": "https://t.co/VJQg8zeTP7",
"professional_info": {
"category": [
{
"icon_name": "IconBriefcaseStroke",
"id": 1009,
"name": "Community"
}
],
"professional_type": "Creator",
"rest_id": "1593277157630824448"
},
"tipjar_settings": {
"is_enabled": false,
"bitcoin_handle": "3NgkgtsnmNjvnKoh4iey8k1Lqt5fVdfXML",
"ethereum_handle": "0xc60F1A98A63096Ea772184F81046077cF7A03a02"
}
},
"text": "@elonmusk Haters will say this is AI https://t.co/djLDxhqJlw",
"entities": {
"hashtags": [],
"media": [
{
"additional_media_info": {
"monetizable": false
},
"display_url": "pic.x.com/djLDxhqJlw",
"expanded_url": "https://x.com/ClownWorld/status/2000650156405072211/video/1",
"ext_media_availability": {
"status": "Available"
},
"grok_post_id": "dbfa29f6-9553-4ea6-9d39-10cd28bcbe81",
"id_str": "2000650105603686400",
"indices": [37, 60],
"media_key": "13_2000650105603686400",
"media_results": {
"result": {
"media_key": "13_2000650105603686400"
}
},
"media_url_https": "https://pbs.twimg.com/amplify_video_thumb/2000650105603686400/img/R4soCzawh48AMneU.jpg",
"original_info": {
"focus_rects": [],
"height": 688,
"width": 464
},
"sizes": {
"large": {
"h": 688,
"resize": "fit",
"w": 464
},
"medium": {
"h": 688,
"resize": "fit",
"w": 464
},
"small": {
"h": 680,
"resize": "fit",
"w": 459
},
"thumb": {
"h": 150,
"resize": "crop",
"w": 150
}
},
"type": "video",
"url": "https://t.co/djLDxhqJlw",
"video_info": {
"aspect_ratio": [29, 43],
"duration_millis": 6041,
"variants": [
{
"content_type": "application/x-mpegURL",
"url": "https://video.twimg.com/amplify_video/2000650105603686400/pl/wUXfX9O1Oz48cgqg.m3u8?tag=23"
},
{
"bitrate": 5184000,
"content_type": "video/mp4",
"url": "https://video.twimg.com/amplify_video/2000650105603686400/vid/avc1/464x688/HobG6DrrCTZ3n-T8.mp4?tag=23"
}
]
}
}
],
"symbols": [],
"timestamps": [],
"urls": [],
"user_mentions": [
{
"id_str": "44196397",
"indices": [0, 9],
"name": "Elon Musk",
"screen_name": "elonmusk"
}
]
},
"reply_to_username": "elonmusk",
"reply_to_user_id": "44196397",
"favorite_count": 4515,
"reply_count": 758,
"retweet_count": 821,
"quote_count": 48,
"bookmark_count": 180,
"views_count": "788827",
"created_at": "Mon Dec 15 19:32:22 +0000 2025",
"lang": "en",
"source": "Twitter for iPhone",
"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
}
],
"has_community_notes": false,
"is_edited": false,
"edits_remaining": "5",
"is_translatable": false,
"possibly_sensitive": false
}

This example output shows the structure of a single comment. The actual output will be a list of similar objects for all scraped comments.

Notes

  • It is designed to scrape comments visible on the tweet screen. Therefore, it cannot process nested comments and can retrieve a maximum of 200 comments due to limitations.
  • The collected data is stored in Apify’s default data store.