# TikTok Comment (Replies) Scraper (`xtdata/tiktok-comment-scraper`) Actor

TikTok Comment Scraper: Fasest and Stablest. Retrieve TikTok comments, replies with speed and efficiency. No Proxy Needed.

- **URL**: https://apify.com/xtdata/tiktok-comment-scraper.md
- **Developed by:** [xtdata](https://apify.com/xtdata) (community)
- **Categories:** Social media, Videos, Lead generation
- **Features:** Limited permissions
- **Stats:** 697 total users, 45 monthly users, 100.0% runs succeeded, 17 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $0.25 / 1,000 each 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

### Introduction to TikTok Comment Scraper

**Super Fast TikTok Comment Scraper**. Real-time, authentic data. No pre-built databases. Retrieve valuable TikTok data with ease. Input a TikTok URL and instantly access
comments, likes, and metadata. Automate your data collection through API access and scheduled runs.
Export your data in various formats and monitor scraping progress. Integrate with other applications for a streamlined
workflow.

Only need 0.0001 USD to get 200 results. **You don't need to pay for proxy because we use our own.**

https://www.youtube.com/watch?v=gB339uxw9-s

### Bugs, fixes, updates and changelog

This scraper is under active development. If you have any feature requests you can create an issue from here.
Enhanced to crawling 100 items with only 128MB memory.

### Note: During free trial period:

- ✅ Result limit of 10 per query.
- ✅ Number of URLs is limited to 1.

**Upgrade: [https://apify.com/pricing](https://apify.com/pricing?fpr=7hce1m)**

### Input Parameters

The input of this scraper should be JSON containing the list of pages on TikTok Comment Scraper that should be visited.
Required fields are:

| urls                | array    | URLs/Video IDs of TikTok videos. You can also provide just the video ID.                                                     |
| maxItems            | integer  | Maximum number of comments to scrape per video.                                                                             |
| shouldScrapeReplies | boolean  | If enabled, the actor will also scrape replies for each comment.                                                            |
| shouldScrapeAll     | boolean  | If enabled, the actor will scrape all comments, disregarding the maxItems limit.                                           |

### Compute Unit Consumption

The actor optimized to run blazing fast and scrape many as listings as possible. Therefore, it forefronts all listing
detail requests. If actor doesn't block very often it'll scrape 100 listings in 30 seconds with ~0.001 compute
units.

### TikTok Comment Scraper Input example

```json
{
  "urls": [
    "https://www.tiktok.com/@ladygaga/video/7482895727757102382"
  ],
  "maxItems": 100,
  "shouldScrapeReplies": true,
  "shouldScrapeAll": false
}
```

### During the Run

During the run, the actor will output messages letting you know what is going on. Each message always contains a short
label specifying which page from the provided list is currently specified. When items are loaded from the page, you
should see a message about this event with a loaded item count and total item count for each page.

If you provide incorrect input to the actor, it will immediately stop with failure state and output an explanation of
what is wrong.

### TikTok Comment Scraper Export

During the run, the actor stores results into a dataset. Each item is a separate item in the dataset.

You can manage the results in any language (Python, PHP, Node JS/NPM). See the FAQ or our API references to learn more
about getting results from this TikTok Comment Scraper actor.

#### Item Detail

```json
[
  {
    "author_pin": false,
    "aweme_id": "7211250685902359850",
    "cid": "7217494551149101851",
    "collect_stat": 0,
    "comment_language": "en",
    "create_time": 1680453949,
    "digg_count": 23,
    "is_author_digged": false,
    "label_list": null,
    "no_show": false,
    "reply_comment": null,
    "reply_comment_total": 5,
    "reply_id": "0",
    "reply_to_reply_id": "0",
    "share_info": {
      "acl": {
        "code": 0,
        "extra": "{}"
      },
      "desc": "🇵🇱 Kasia 🇮🇸's comment: Look it for @Marika Christman . She is doing the best outfits for you. Check it out.",
      "title": "The rehearsal no one saw. Love you all, thanks for being so supportive of a song that means so much to me ❤️",
      "url": "https://www.tiktok.com/@ladygaga/video/7211250685902359850?_d=e80jjb2j1hfl54&_r=1&comment_author_id=7046867863550247941&preview_pb=0&share_comment_id=7217494551149101851&share_item_id=7211250685902359850&sharer_language=en&source=h5_m&u_code=0"
    },
    "status": 1,
    "stick_position": 0,
    "text": "Look it for @Marika Christman . She is doing the best outfits for you. Check it out.",
    "text_extra": [
      {
        "end": 29,
        "hashtag_id": "",
        "hashtag_name": "",
        "sec_uid": "MS4wLjABAAAArXhs1fvcchkAbFNXpJZcD4BSJv7EmPFYcLpK2llb0Fq-K5BFkijKYQlDnHoKL1F6",
        "start": 12,
        "user_id": "7038949358691910662"
      }
    ],
    "trans_btn_style": 0,
    "user": {
      "accept_private_policy": false,
      "account_labels": null,
      "account_region": "",
      "ad_cover_url": null,
      "advance_feature_item_order": null,
      "advanced_feature_info": null,
      "apple_account": 0,
      "authority_status": 0,
      "avatar_168x168": {
        "height": 720,
        "uri": "168x168/tos-maliva-avt-0068/7818f08ae60f5417edede76314c0baa7",
        "url_list": [
          "https://p16-amd-va.tiktokcdn.com/tos-maliva-avt-0068/7818f08ae60f5417edede76314c0baa7~tplv-tiktok-shrink:64:64.webp?s=COMMENT_LIST&se=false&sh=64_64&sc=avatar&l=20230514065113FFB5EBB0D8A8D784DD18",
          "https://p16-amd-va.tiktokcdn.com/img/tos-maliva-avt-0068/7818f08ae60f5417edede76314c0baa7~c5_168x168.webp?s=COMMENT_LIST&se=false&sh=&sc=avatar&l=20230514065113FFB5EBB0D8A8D784DD18",
          "https://p16-amd-va.tiktokcdn.com/img/tos-maliva-avt-0068/7818f08ae60f5417edede76314c0baa7~c5_168x168.jpeg?s=COMMENT_LIST&se=false&sh=&sc=avatar&l=20230514065113FFB5EBB0D8A8D784DD18"
        ],
        "width": 720
      },
      "avatar_300x300": {
        "height": 720,
        "uri": "300x300/tos-maliva-avt-0068/7818f08ae60f5417edede76314c0baa7",
        "url_list": [
          "https://p16-amd-va.tiktokcdn.com/tos-maliva-avt-0068/7818f08ae60f5417edede76314c0baa7~tplv-tiktok-shrink:64:64.webp?s=COMMENT_LIST&se=false&sh=64_64&sc=avatar&l=20230514065113FFB5EBB0D8A8D784DD18",
          "https://p16-amd-va.tiktokcdn.com/img/tos-maliva-avt-0068/7818f08ae60f5417edede76314c0baa7~c5_300x300.webp?s=COMMENT_LIST&se=false&sh=&sc=avatar&l=20230514065113FFB5EBB0D8A8D784DD18",
          "https://p16-amd-va.tiktokcdn.com/img/tos-maliva-avt-0068/7818f08ae60f5417edede76314c0baa7~c5_300x300.jpeg?s=COMMENT_LIST&se=false&sh=&sc=avatar&l=20230514065113FFB5EBB0D8A8D784DD18"
        ],
        "width": 720
      },
      "avatar_larger": {
        "height": 720,
        "uri": "1080x1080/tos-maliva-avt-0068/7818f08ae60f5417edede76314c0baa7",
        "url_list": [
          "https://p16-amd-va.tiktokcdn.com/img/tos-maliva-avt-0068/7818f08ae60f5417edede76314c0baa7~c5_1080x1080.webp?s=COMMENT_LIST&se=false&sh=&sc=avatar&l=20230514065113FFB5EBB0D8A8D784DD18",
          "https://p16-amd-va.tiktokcdn.com/img/tos-maliva-avt-0068/7818f08ae60f5417edede76314c0baa7~c5_1080x1080.jpeg?s=COMMENT_LIST&se=false&sh=&sc=avatar&l=20230514065113FFB5EBB0D8A8D784DD18"
        ],
        "width": 720
      },
      "avatar_medium": {
        "height": 720,
        "uri": "720x720/tos-maliva-avt-0068/7818f08ae60f5417edede76314c0baa7",
        "url_list": [
          "https://p16-amd-va.tiktokcdn.com/tos-maliva-avt-0068/7818f08ae60f5417edede76314c0baa7~tplv-tiktok-shrink:64:64.webp?s=COMMENT_LIST&se=false&sh=64_64&sc=avatar&l=20230514065113FFB5EBB0D8A8D784DD18",
          "https://p16-amd-va.tiktokcdn.com/img/tos-maliva-avt-0068/7818f08ae60f5417edede76314c0baa7~c5_720x720.webp?s=COMMENT_LIST&se=false&sh=&sc=avatar&l=20230514065113FFB5EBB0D8A8D784DD18",
          "https://p16-amd-va.tiktokcdn.com/img/tos-maliva-avt-0068/7818f08ae60f5417edede76314c0baa7~c5_720x720.jpeg?s=COMMENT_LIST&se=false&sh=&sc=avatar&l=20230514065113FFB5EBB0D8A8D784DD18"
        ],
        "width": 720
      },
      "avatar_thumb": {
        "height": 720,
        "uri": "100x100/tos-maliva-avt-0068/7818f08ae60f5417edede76314c0baa7",
        "url_list": [
          "https://p16-amd-va.tiktokcdn.com/tos-maliva-avt-0068/7818f08ae60f5417edede76314c0baa7~tplv-tiktok-shrink:64:64.webp?s=COMMENT_LIST&se=false&sh=64_64&sc=avatar&l=20230514065113FFB5EBB0D8A8D784DD18",
          "https://p16-amd-va.tiktokcdn.com/img/tos-maliva-avt-0068/7818f08ae60f5417edede76314c0baa7~c5_100x100.webp?s=COMMENT_LIST&se=false&sh=&sc=avatar&l=20230514065113FFB5EBB0D8A8D784DD18",
          "https://p16-amd-va.tiktokcdn.com/img/tos-maliva-avt-0068/7818f08ae60f5417edede76314c0baa7~c5_100x100.jpeg?s=COMMENT_LIST&se=false&sh=&sc=avatar&l=20230514065113FFB5EBB0D8A8D784DD18"
        ],
        "width": 720
      },
      "avatar_uri": "tos-maliva-avt-0068/7818f08ae60f5417edede76314c0baa7",
      "aweme_count": 0,
      "bind_phone": "",
      "bold_fields": null,
      "can_message_follow_status_list": null,
      "can_set_geofencing": null,
      "cha_list": null,
      "comment_filter_status": 0,
      "comment_setting": 0,
      "commerce_user_level": 0,
      "cover_url": [
        {
          "height": 720,
          "uri": "musically-maliva-obj/1612555907887110",
          "url_list": [
            "https://p16-amd-va.tiktokcdn.com/obj/musically-maliva-obj/1612555907887110"
          ],
          "width": 720
        }
      ],
      "create_time": 0,
      "custom_verify": "",
      "cv_level": "",
      "download_prompt_ts": 1641158568,
      "download_setting": 0,
      "duet_setting": 0,
      "enterprise_verify_reason": "",
      "events": null,
      "favoriting_count": 0,
      "fb_expire_time": 0,
      "follow_status": 0,
      "follower_count": 0,
      "follower_status": 0,
      "followers_detail": null,
      "following_count": 0,
      "friends_status": 0,
      "geofencing": null,
      "google_account": "",
      "has_email": false,
      "has_facebook_token": false,
      "has_insights": false,
      "has_orders": false,
      "has_twitter_token": false,
      "has_youtube_token": false,
      "hide_search": false,
      "homepage_bottom_toast": null,
      "ins_id": "katarzyna.krupinska82",
      "is_ad_fake": false,
      "is_block": false,
      "is_discipline_member": false,
      "is_phone_binded": false,
      "is_star": false,
      "item_list": null,
      "language": "pl",
      "live_agreement": 0,
      "live_commerce": false,
      "live_verify": 0,
      "matched_friend_available": false,
      "mention_status": 1,
      "mutual_relation_avatars": null,
      "need_points": null,
      "need_recommend": 0,
      "nickname": "🇵🇱 Kasia 🇮🇸",
      "platform_sync_info": null,
      "prevent_download": false,
      "react_setting": 0,
      "region": "IS",
      "relative_users": null,
      "room_id": 0,
      "search_highlight": null,
      "sec_uid": "MS4wLjABAAAAZl-oKhIJ9Odmr5H0Nw0rAxgPJgZ16uWIm5pZYxxiJiWcDpPmzOTOu4NbYkgzj9p7",
      "secret": 0,
      "shield_comment_notice": 0,
      "shield_digg_notice": 0,
      "shield_edit_field_info": null,
      "shield_follow_notice": 0,
      "short_id": "0",
      "show_image_bubble": false,
      "signature": "🇵🇱\n🇮🇸",
      "special_account": {
        "special_account_list": null
      },
      "special_lock": 1,
      "status": 1,
      "stitch_setting": 0,
      "total_favorited": 0,
      "tw_expire_time": 0,
      "twitter_id": "",
      "twitter_name": "",
      "type_label": null,
      "uid": "7046867863550247941",
      "unique_id": "katie.kru",
      "unique_id_modify_time": 1684047073,
      "user_canceled": false,
      "user_mode": 1,
      "user_period": 0,
      "user_profile_guide": null,
      "user_rate": 1,
      "user_tags": null,
      "verification_type": 0,
      "verify_info": "",
      "video_icon": {
        "height": 720,
        "uri": "",
        "url_list": [],
        "width": 720
      },
      "white_cover_url": null,
      "with_commerce_entry": false,
      "with_shop_entry": false,
      "youtube_channel_id": "",
      "youtube_channel_title": "",
      "youtube_expire_time": 0
    },
    "user_buried": false,
    "user_digged": 0
  }
]
```

### Scrape any TikTok data you need with dedicated scrapers

If you want to get specific data from TikTok, you can use the scrapers below. Each scraper is made to help you get
different kinds of TikTok data, like hashtags, search results, profiles, or everything at once. You can look at them to
see which one you need.

| [🎹️ Fast TikTok API](https://apify.com/novi/fast-tiktok-api?fpr=7hce1m)            | [📹️ TikTok Trend API](https://apify.com/novi/tiktok-trend-api?fpr=7hce1m)         | [🔍️ TikTok Search API](https://apify.com/novi/tiktok-search-api?fpr=7hce1m)             |
|:-------------------------------------------------------------------------|:------------------------------------------------------------------------|:------------------------------------------------------------------------------|
| [🧛️ TikTok User API](https://apify.com/novi/tiktok-user-api?fpr=7hce1m)            | [🧛️ TikTok User Info API](https://apify.com/novi/tiktok-user-info-api?fpr=7hce1m) | [#️ TikTok Hashtag API](https://apify.com/novi/tiktok-hashtag-api?fpr=7hce1m)            |
| [🛍️ TikTok Shop API](https://apify.com/novi/tiktok-shop-scraper?fpr=7hce1m)        | [👤️ TikTok Followers API](https://apify.com/novi/tiktok-followers-api?fpr=7hce1m) | [⚡️ TikTok Scraper (pay-per-result)](https://apify.com/xtdata/tiktok-scraper?fpr=7hce1m) |
| [💬 TikTok Comment API](https://apify.com/novi/tiktok-comment-api?fpr=7hce1m)       | [🎶 TikTok Music API](https://apify.com/novi/tiktok-sound-api?fpr=7hce1m)          | [🎶 TikTok Music Trend API](https://apify.com/novi/tiktok-music-trend-api?fpr=7hce1m)    |
| [🐦 Twitter - X.com Scraper](https://apify.com/xtdata/twitter-x-scraper?fpr=7hce1m) |                                                                         |                                                                               |

# Changelog

This Actor's version history is a separate document: https://apify.com/xtdata/tiktok-comment-scraper/changelog.md

# Actor input Schema

## `urls` (type: `array`):

Add the URLs of posted video you want to scrape. You can enter URL one by one. You can even just entering video ID

## `shouldScrapeReplies` (type: `boolean`):

If enabled, the actor will also scrape replies for each comment.

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

Maximum number of comments to scrape per post. Note: Scraping thousands of comments may be slow.

## `shouldScrapeAll` (type: `boolean`):

If enabled, the actor will attempt to scrape all comments for the given videos, ignoring the maxItems limit.

## Actor input object example

```json
{
  "urls": [
    "https://www.tiktok.com/@ladygaga/video/7211250685902359850"
  ],
  "shouldScrapeReplies": false,
  "maxItems": 50,
  "shouldScrapeAll": 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 = {
    "urls": [
        "https://www.tiktok.com/@ladygaga/video/7211250685902359850"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtdata/tiktok-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 = { "urls": ["https://www.tiktok.com/@ladygaga/video/7211250685902359850"] }

# Run the Actor and wait for it to finish
run = client.actor("xtdata/tiktok-comment-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 '{
  "urls": [
    "https://www.tiktok.com/@ladygaga/video/7211250685902359850"
  ]
}' |
apify call xtdata/tiktok-comment-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,xtdata/tiktok-comment-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/HfEIcgAoILZfOaDML/builds/e1Du7CBq0oXcAJyuh/openapi.json
