# TikTok Comments Scraper: Replies, Likes & Monitoring (`stratumics/tiktok-comments-scraper`) Actor

Export TikTok comments and replies from any video or photo post: text, date, likes, reply count, commenter, pinned and creator-liked flags, plus video stats. Monitoring returns only new comments.

- **URL**: https://apify.com/stratumics/tiktok-comments-scraper.md
- **Developed by:** [Stratum ICS](https://apify.com/stratumics) (community)
- **Categories:** Social media, Videos
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.30 / 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

**TikTok Comments Scraper** exports the comments and replies of any TikTok video or photo post: comment text, date, likes, reply count, the commenter's username and display name, and whether the creator **pinned** or **liked** the comment. Paste video links, short share links or video ids and get one clean row per comment, with the video's description, author, play count and comment count on every row, so it works as a **TikTok comments API** without a TikTok account.

It reads public comments only and never logs in.

### What does TikTok Comments Scraper do?

Give it TikTok links (`https://www.tiktok.com/@duolingo/video/7031193165658950917`), short share links (`https://vm.tiktok.com/...` or `https://vt.tiktok.com/...`) or plain video ids, and it returns:

- **Comments**: full text, exact date in UTC, likes, number of replies and the language TikTok detected.
- **Replies**: turn them on and every reply becomes a row of its own, linked to its parent comment, including the creator's own answers.
- **Creator signals**: whether the creator pinned the comment, and whether the creator liked it (TikTok's "Liked by creator" badge).
- **Commenters**: the public username, display name, user id, profile link and avatar link shown next to each comment.
- **Video context on every row**: the video's description, author, play count and comment count, so a spreadsheet of comments from many videos still makes sense.
- **Monitoring**: run it on a schedule and get only the comments that are new since the last run.

### Why use this TikTok comments scraper?

- **Deep lists.** TikTok serves comments 50 at a time; the scraper keeps paging past TikTok's own "no more" signals, which can appear in the middle of long lists. In one test run it read 2,100 comments from each of four videos, and 2,500 from one video in another.
- **Complete reply threads.** TikTok often answers the first request for a thread with one or a few replies and "no more", and holds the rest on later pages. The scraper follows the comment's reply count instead, so a thread of 268 replies gives you 203 readable replies, not 31.
- **Checked against the live page.** In testing, 19 of 19 comments shown on a video's page in Chrome had the same text, display name, username, date, like count and "Liked by creator" badge in the scraper's output.
- **Monitoring mode.** Turn on "Only new comments" and schedule the run. Each run returns only comments and replies posted since you started monitoring the video and not delivered before, so you never pay twice for the same comment. Built for brands and agencies following their own posts.
- **No limits on the free plan.** Free plan users get the same depth and features as everyone else.
- **You pay for results only.** Comments outside your date range, comments already delivered in monitoring mode, deleted videos and errors are never charged.
- **Restart-safe.** If the platform moves a run to another server, it continues where it stopped and never stores or charges a comment twice.

On top of that you get the Apify platform: scheduled runs, an API, webhooks, run history, and exports to JSON, CSV, Excel and more.

### What data can you extract from TikTok comments?

| Field                                          | What it holds                                             | Example                            |
| ---------------------------------------------- | --------------------------------------------------------- | ---------------------------------- |
| `commentId`                                    | TikTok's id of the comment                                | `7031194189065372421`              |
| `text`                                         | Full comment text (null for sticker-only comments)        | `We saw the pants … are we safe`   |
| `createdAt`                                    | Posting time, ISO 8601 in UTC                             | `2021-11-16T15:44:33.000Z`         |
| `likesCount`                                   | Likes on the comment                                      | `70150`                            |
| `replyCount`                                   | Replies TikTok counts under the comment (null on replies) | `50`                               |
| `isReply`, `parentCommentId`                   | Whether the row is a reply, and the comment it answers    | `true`, `7031194189065372421`      |
| `isPinned`                                     | The creator pinned the comment to the top                 | `true`                             |
| `isAuthorLiked`                                | The creator liked the comment                             | `true`                             |
| `language`                                     | Language code TikTok detected, or null                    | `en`                               |
| `authorUsername`, `authorNickname`             | Commenter's username and display name                     | `duolingo`, `Duolingo`             |
| `authorId`, `authorProfileUrl`, `authorAvatar` | Commenter's user id, profile link and avatar link         | `https://www.tiktok.com/@duolingo` |
| `videoId`, `videoUrl`                          | The video the comment belongs to                          | `7031193165658950917`              |
| `videoDescription`, `videoAuthor`              | The video's caption and author                            | `duolingo`                         |
| `videoPlayCount`, `videoCommentCount`          | The video's plays and comments                            | `3300000`, `5177`                  |
| `scrapedAt`                                    | When the row was collected                                | `2026-10-18T04:32:49.977Z`         |

The full list, with descriptions, is on the Dataset tab of the output.

### How to scrape TikTok comments

1. Open TikTok Comments Scraper in Apify Console and click **Try for free**.
2. In **Videos**, paste TikTok video links, short share links or video ids, one per line. Photo posts work the same way.
3. Set **Max comments per video**. The default is 100.
4. Optionally turn on **Include replies** and set **Max replies per comment**.
5. Optionally set **Only comments newer than**, or turn on monitoring.
6. Click **Start**. When the run finishes, download the data as JSON, CSV or Excel, or read it through the API.

### How much does it cost to scrape TikTok comments?

The scraper uses pay-per-event pricing: you pay for each comment or reply saved to your dataset, plus a start fee of $0.0005 per run.

| Apify plan       | Price per 1,000 comments or replies |
| ---------------- | ----------------------------------- |
| Free and Starter | $0.50 ($0.0005 each)                |
| Scale            | $0.40                               |
| Business         | $0.30                               |

The **Pricing** tab always shows the current prices.

Worked examples on the Free or Starter plan:

- **1,000 comments from one video** cost 1,000 × $0.0005 = **$0.50**.
- **5 videos, 1,000 comments each, with up to 5 replies per comment**: 5,000 comments plus, say, 3,000 replies are 8,000 rows, so **$4.00**.
- **A daily monitor of 10 of your own videos** that finds 150 new comments a day saves about 4,500 rows a month: **about $2.27 a month**, start fees included.

Set **Maximum cost per run** in the run options to cap your spend. The scraper stops cleanly at that amount and keeps everything collected so far.

### Input

See the **Input** tab for every option. A typical input:

```json
{
    "videos": [
        "https://www.tiktok.com/@duolingo/video/7031193165658950917",
        "https://www.tiktok.com/@scout2015/video/6718335390845095173",
        "7050551461734042926"
    ],
    "maxCommentsPerVideo": 500,
    "includeReplies": true,
    "maxRepliesPerComment": 10,
    "newerThan": "30 days"
}
```

- **Videos**: full links (`/@user/video/<id>` or `/@user/photo/<id>`), short links from the share button, embed links, or 15 to 21 digit video ids. Profile, hashtag, music and search links are rejected with a message in the log and the run summary.
- **Max comments per video**: counts top-level comments only. Replies come on top when they are on.
- **Only comments newer than**: a date (`2026-10-01`), an ISO date-time in UTC, or a relative value such as `7 days` or `12 hours`. TikTok does not sort comments by date, so the scraper reads further down the list to find enough matches (up to 20 times your comment limit, at least 2,000 comments).
- **Monitoring**: turn on **Only new comments** and give each schedule its own **Monitor name**.
- **Proxy**: none by default. If TikTok starts refusing requests, the scraper switches to Apify datacenter proxy by itself.

### Output

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel. Three rows from a real run (private commenters' names and ids replaced, avatar links shortened). The second row is the creator's own reply to the first, which the creator pinned and liked:

```json
[
    {
        "videoId": "7031193165658950917",
        "videoUrl": "https://www.tiktok.com/@duolingo/video/7031193165658950917",
        "commentId": "7031194189065372421",
        "text": "We saw the pants … are we safe",
        "createdAt": "2021-11-16T15:44:33.000Z",
        "likesCount": 70150,
        "replyCount": 50,
        "isReply": false,
        "parentCommentId": null,
        "authorUsername": "commenter-one",
        "authorNickname": "Commenter One",
        "authorId": "7000000000000000001",
        "authorProfileUrl": "https://www.tiktok.com/@commenter-one",
        "authorAvatar": "https://p19-common-sign.tiktokcdn-us.com/tos-useast5-avt-0068-tx/...~tplv-tiktokx-cropcenter:100:100.jpg?x-expires=1792382400&...",
        "isPinned": true,
        "isAuthorLiked": true,
        "language": "en",
        "videoDescription": "still don’t see a problem with what i do - don’t come for my beak!!! #Duolingo #comedy #avatarthelastairbander #trend #DuaLipa #elements #brandtok",
        "videoAuthor": "duolingo",
        "videoPlayCount": 3300000,
        "videoCommentCount": 5177,
        "scrapedAt": "2026-10-18T04:32:49.977Z"
    },
    {
        "videoId": "7031193165658950917",
        "videoUrl": "https://www.tiktok.com/@duolingo/video/7031193165658950917",
        "commentId": "7031196197935678214",
        "text": "it’s winter my skeleton gets cold",
        "createdAt": "2021-11-16T15:52:21.000Z",
        "likesCount": 70578,
        "replyCount": null,
        "isReply": true,
        "parentCommentId": "7031194189065372421",
        "authorUsername": "duolingo",
        "authorNickname": "Duolingo",
        "authorId": "6917704832925746181",
        "authorProfileUrl": "https://www.tiktok.com/@duolingo",
        "authorAvatar": "https://p19-common-sign.tiktokcdn-us.com/tos-useast5-avt-0068-tx/...~tplv-tiktokx-cropcenter:100:100.jpg?x-expires=1792382400&...",
        "isPinned": false,
        "isAuthorLiked": false,
        "language": "en",
        "videoDescription": "still don’t see a problem with what i do - don’t come for my beak!!! #Duolingo #comedy #avatarthelastairbander #trend #DuaLipa #elements #brandtok",
        "videoAuthor": "duolingo",
        "videoPlayCount": 3300000,
        "videoCommentCount": 5177,
        "scrapedAt": "2026-10-18T04:32:50.531Z"
    },
    {
        "videoId": "7050551461734042926",
        "videoUrl": "https://www.tiktok.com/@billieeilish/video/7050551461734042926",
        "commentId": "7050586777781994246",
        "text": "No sabía que también era pintora la Billie 😍",
        "createdAt": "2022-01-07T21:57:41.000Z",
        "likesCount": 71474,
        "replyCount": 36,
        "isReply": false,
        "parentCommentId": null,
        "authorUsername": "commenter-two",
        "authorNickname": "Commenter Two",
        "authorId": "7000000000000000002",
        "authorProfileUrl": "https://www.tiktok.com/@commenter-two",
        "authorAvatar": "https://p16-common-sign.tiktokcdn-us.com/tos-alisg-avt-0068/...~tplv-tiktokx-cropcenter:100:100.jpg?x-expires=1792382400&...",
        "isPinned": false,
        "isAuthorLiked": false,
        "language": "es",
        "videoDescription": "can’t be good at everything",
        "videoAuthor": "billieeilish",
        "videoPlayCount": 204800000,
        "videoCommentCount": 197000,
        "scrapedAt": "2026-10-18T04:32:51.229Z"
    }
]
```

Each run also saves a **SUMMARY** record in its key-value store with, for every video, the status, comments and replies saved, comments read, pages read, why reading stopped, and any problem.

### Monitoring new comments on your videos

1. Turn on **Only new comments (monitoring mode)** and enter a **Monitor name**, for example `brand-posts`.
2. Run it once. This first run sets the starting point and returns comments like a normal run.
3. Schedule the same input (hourly, daily or weekly). Each later run returns only comments and replies posted since monitoring of each video began that it has not delivered before. When there is nothing new, the run ends with "No new comments since the last run" and saves no rows.

How it finds them: TikTok shows comments by relevance, not by date, but new comments appear near the top (in testing, 32 of the 33 comments from the last 30 days on a video with about 200,000 comments were among the first 500). Each monitoring run reads at least the first 2,000 comments of every video. With replies on, it also notices when a comment's reply count grows and reads that thread for the new replies.

The memory is a key-value store in your account named `tiktok-comments-monitor-<name>`. Comments older than 30 days stop counting as new, which keeps the memory small. Use a different monitor name for each schedule.

### Tips for scraping TikTok comments

- **Find what the creator rated highly.** Filter on `isPinned` and `isAuthorLiked` to see the comments the creator pinned or liked.
- **Want the conversation, not only the top level?** Turn on replies and keep **Max replies per comment** low (5 to 20) to cover many threads cheaply.
- **Following a campaign?** Use monitoring rather than a date filter: a date filter has to read down TikTok's relevance order every time, while monitoring remembers what you already have.
- **Need the avatars?** Download them right after the run: TikTok signs avatar links and they stop working after about a day.
- **Mixing many videos?** Every row carries the video's caption, author, plays and comment count, so you can group and filter in one sheet.

### Integrations and API

- **API**: start runs and read results over HTTP from any language. See the **API** tab for ready-made requests.
- **JavaScript**:

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('stratumics/tiktok-comments-scraper').call({
    videos: ['https://www.tiktok.com/@duolingo/video/7031193165658950917'],
    maxCommentsPerVideo: 500,
    includeReplies: true,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.filter((item) => item.isAuthorLiked).map((item) => item.text));
```

- **Python**:

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("stratumics/tiktok-comments-scraper").call(
    run_input={"videos": ["7050551461734042926"], "maxCommentsPerVideo": 1000}
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["createdAt"], item["likesCount"], (item["text"] or "")[:80])
```

- **No-code tools**: connect runs to Zapier, Make, n8n, Google Sheets, Slack or your own webhook from the **Integrations** tab, for example to post every new comment on your latest video into a team channel.
- **AI agents**: add the Actor to any agent or chat app that supports the Model Context Protocol through the Apify MCP server at `https://mcp.apify.com?tools=stratumics/tiktok-comments-scraper`, then ask in plain words, such as "get the 500 top comments of this TikTok video and sum up what people complain about".

### FAQ

#### How many comments can I get from one video?

As many as TikTok serves for it, up to 100,000 top-level comments per video, plus replies. In testing the scraper read 2,500 comments from one video and 2,100 from each of four videos in a single run. The list TikTok serves can be shorter than the count under the video, because that count includes replies and comments that were deleted or are hidden.

#### Why do like or reply counts differ from what I see in the app?

The counts are TikTok's own numbers, and TikTok shows somewhat different numbers to visitors from different countries and at different times. In testing, the same comment showed 42 replies to a visitor in one country and 50 to the scraper on Apify's servers in the US. The comments themselves are the same.

#### Can it scrape all videos of a profile, a hashtag or search results?

No. This scraper works from video links. TikTok's profile video lists and search need signed requests, so they are not supported; paste the links of the videos you want instead.

#### Does it need a TikTok account, cookies or a proxy?

No account and no cookies. No proxy by default: TikTok's comment pages answered Apify's servers without one in testing (3,213 requests in one run, none refused). If TikTok starts refusing, the scraper switches to Apify datacenter proxy by itself, and you can pick your own proxy in the input.

#### Does it work for photo posts and slideshows?

Yes. Photo post links (`/@user/photo/<id>`) and short links that lead to photo posts work like video links.

#### What happens with deleted or private videos?

The video is skipped with a clear message in the log and the run summary, and nothing is charged for it. Other videos in the same run carry on.

#### Is it legal to scrape TikTok comments?

Our Actors are ethical and do not extract any private user data, such as email addresses, gender, or location. They only extract what the user has chosen to share publicly. We therefore believe that our Actors, when used for ethical purposes by Apify users, are safe. However, you should be aware that your results could contain personal data. Personal data is protected by the GDPR in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers.

The personal data in the output is what TikTok shows publicly next to each comment: the commenter's username, display name, user id, profile link and avatar link. No bios, follower counts, contact details or other profile data are collected. TikTok is a trademark of its owner, and this tool is not affiliated with or endorsed by TikTok.

#### Something looks wrong. Where do I report it?

Open an issue on the **Issues** tab with the run link and the video. Most problems can be reproduced and fixed quickly.

### Other tools from Stratum ICS

- [Airbnb Scraper](https://apify.com/stratumics/airbnb-scraper): Get every Airbnb listing in a city or from listing links: price per night, rating, reviews, guests, bedrooms, host and Superhost status.
- [App Store Reviews Scraper](https://apify.com/stratumics/app-store-reviews-scraper): Get Apple App Store reviews with star ratings, titles, text, app versions, helpful votes and developer replies, well past Apple's 500-review limit, for any country, plus app ratings.
- [Bilibili Scraper](https://apify.com/stratumics/bilibili-scraper): Scrape Bilibili videos by search, link or uploader without logging in: views, likes, coins, tags, uploader profiles, comments with replies and danmaku, in clean rows.
- [Facebook Ads Library Scraper](https://apify.com/stratumics/facebook-ads-library-scraper): Get ads from the Meta (Facebook) Ad Library by keyword, advertiser page or library link: texts, images, videos, dates, platforms and versions, plus spend for political ads.
- [Facebook Posts Scraper](https://apify.com/stratumics/facebook-posts-scraper): Get posts from public Facebook pages: text, reactions by type, comments, shares, views and media, plus page details with followers, contacts, rating and creation date.
- [Google Ads Transparency Scraper](https://apify.com/stratumics/google-ads-transparency-scraper): Get the ads any advertiser runs on Google Search, YouTube, Shopping, Maps and Play, from the Ads Transparency Center: images, formats, dates, regions and EU reach.
- [Google Maps Reviews Scraper](https://apify.com/stratumics/google-maps-reviews-scraper): Get the Google Maps reviews of any place: rating, full text, exact date, photos, owner reply, reviewer details and food or service scores.
- [Google Maps Scraper](https://apify.com/stratumics/google-maps-scraper): Get the businesses on Google Maps for any search and area: name, address, phone, website, rating, review count, opening hours, plus emails and social profiles.
- [Google News Scraper](https://apify.com/stratumics/google-news-scraper): Get Google News articles with real publisher URLs (not Google redirects), source, date, image, author and optional full text.
- [Google Play Reviews Scraper](https://apify.com/stratumics/google-play-reviews-scraper): Get Google Play reviews with star ratings, text, app versions, thumbs-up counts, developer replies and feature ratings in any language, plus app details with installs and star histogram.
- [Google Trends Scraper](https://apify.com/stratumics/google-trends-scraper): Get Google Trends data as JSON, CSV or Excel: interest over time, interest by region and city, related queries, and trending searches by country.
- [Instagram Scraper](https://apify.com/stratumics/instagram-scraper): Scrape public Instagram profiles, posts, reels and comments without logging in: followers, bio, posts count, captions, likes, video views, media links, tags and music.
- [LinkedIn Jobs Scraper](https://apify.com/stratumics/linkedin-jobs-scraper): Scrape LinkedIn jobs with full descriptions, salary ranges, seniority, job type and applicant counts.
- [Reddit Scraper](https://apify.com/stratumics/reddit-scraper): Get Reddit posts and full comment threads from subreddits, searches, user profiles and post links: titles, text, scores, flair, media and replies.
- [Telegram Channel Scraper](https://apify.com/stratumics/telegram-channel-scraper): Get messages from public Telegram channels with views, dates, media, reactions, polls and forwards, plus channel info with exact subscriber counts.
- [Threads Scraper](https://apify.com/stratumics/threads-scraper): Scrape Threads profiles, posts, replies and keyword search: followers, bio, post text, likes, replies, reposts, quotes, media and links.
- [TikTok Scraper](https://apify.com/stratumics/tiktok-scraper): Scrape TikTok profiles and videos: followers, likes, bio, the latest 10 to 12 videos of each profile, and full stats for any video link.
- [Website Contact Scraper](https://apify.com/stratumics/website-contact-scraper): Turn a list of websites into one row per company with verified emails, formatted phone numbers, social profiles (LinkedIn, Facebook, Instagram, X), address and contact page.
- [YouTube Scraper](https://apify.com/stratumics/youtube-scraper): Get YouTube videos from searches, channels, playlists and links with exact views, likes, comment counts, dates and tags, plus channel profiles and comments.
- [YouTube Transcript Scraper](https://apify.com/stratumics/youtube-transcript-scraper): Get YouTube transcripts and captions as plain text, timed segments, SRT or WebVTT, from video links, whole channels or playlists, in any language YouTube offers.

# Actor input Schema

## `videos` (type: `array`):

TikTok videos or photo posts to scrape. Paste links (https://www.tiktok.com/@duolingo/video/7031193165658950917), short share links (https://vm.tiktok.com/..., https://vt.tiktok.com/...) or video ids. One per line. Profile, hashtag and search links are not supported.

## `maxCommentsPerVideo` (type: `integer`):

The most top-level comments to collect from each video, in the order TikTok shows them (most relevant first). Replies come on top of this when you turn them on.

## `includeReplies` (type: `boolean`):

Also collect the replies under each comment. Each reply is a row of its own, with the parent comment's id. Replies are charged like comments.

## `maxRepliesPerComment` (type: `integer`):

The most replies to collect under each comment when replies are on.

## `newerThan` (type: `string`):

Keep comments and replies posted on or after this date. Use a date (2026-10-01), an ISO date-time in UTC (2026-10-01T12:00:00Z), or a relative value such as "7 days" or "12 hours". TikTok does not sort comments by date, so the scraper reads further to find enough matches (up to 20 times your comment limit, at least 2,000 comments). Leave empty for no limit.

## `onlyNewComments` (type: `boolean`):

Remember what was delivered for each video and, on later runs, return only comments (and, with replies on, replies) posted since monitoring of the video began and not delivered yet. The first run returns comments like a normal run. Each later run reads at least the first 2,000 comments in TikTok's order, where new comments appear. Run it on a schedule to follow your own posts.

## `monitorName` (type: `string`):

Name of the memory used by monitoring mode, kept in a key-value store of your account. Runs with the same name share it, so use one name per schedule. Letters, digits and hyphens only.

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

TikTok's comment pages answer without a proxy, so none is used by default. If TikTok starts refusing requests, the scraper switches to Apify datacenter proxy by itself. Choose a proxy here to use it for every request.

## Actor input object example

```json
{
  "videos": [
    "https://www.tiktok.com/@duolingo/video/7031193165658950917",
    "6718335390845095173"
  ],
  "maxCommentsPerVideo": 20,
  "includeReplies": false,
  "maxRepliesPerComment": 20,
  "newerThan": "",
  "onlyNewComments": false,
  "monitorName": "default",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `comments` (type: `string`):

One record per comment or reply, with a few video fields on every row.

## `summary` (type: `string`):

Status, comment and reply counts and any problem for each video.

# 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 = {
    "videos": [
        "https://www.tiktok.com/@duolingo/video/7031193165658950917"
    ],
    "maxCommentsPerVideo": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("stratumics/tiktok-comments-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 = {
    "videos": ["https://www.tiktok.com/@duolingo/video/7031193165658950917"],
    "maxCommentsPerVideo": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("stratumics/tiktok-comments-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 '{
  "videos": [
    "https://www.tiktok.com/@duolingo/video/7031193165658950917"
  ],
  "maxCommentsPerVideo": 20
}' |
apify call stratumics/tiktok-comments-scraper --silent --output-dataset

```

## MCP server setup

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