# YouTube & TikTok Comments API – Sentiment Analysis & Moments (`tubetext/youtube-tiktok-comments-api`) Actor

YouTube, TikTok and Bilibili comments with sentiment from video links. Returns up to 1,000 comments, the moments viewers react to (most-replayed peaks, danmaku bursts, timestamped comments) and like-weighted sentiment and themes. $0.30 per video; videos with no reaction data are free. · by TubeText

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

## Pricing

from $230.00 / 1,000 video analysed (up to 1,000 comments)s

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

## YouTube & TikTok Comments API – Sentiment Analysis & Moments

> **TubeText** · Video & ad analysis · Pay per result. No login. Ready for AI agents. [All tools](https://apify.com/tubetext)

### Quick start (no coding)

1. Click **Try for free** at the top of this page. A free Apify account is enough – it includes monthly credit.
2. In **Video links**, paste one public video link per line – YouTube video or Short, TikTok, or Bilibili.
3. Click **Start**. Usually 1–2 minutes per video; up to 5 videos run in parallel.
4. When it says **Succeeded**, open the **Output** tab and click **Export** → **Excel** (or CSV). One summary row per video (themes, like-weighted sentiment, top-liked and controversial comments) and, for long YouTube and Bilibili videos, one row per moment viewers react to.

**Cost:** $0.30 per video including up to 1,000 comments – 10 videos ≈ $3. Videos with no comments and no replay or danmaku data are free.

**Common mistakes**

- Want the raw comments too → turn on **Include comment rows**.
- A Short or TikTok shows no timeline moments → that's expected: they have no replay heatmap, so read the themes and sentiment in the summary row.
- An Instagram link → not supported (it needs a login); you get a free error row.

**Questions or problems?** [Open an issue](https://apify.com/tubetext/youtube-tiktok-comments-api/issues) (we read every one). **Need a custom version?** Ask in an issue or [email us](mailto:tubettext@gmail.com) – we build it as a private Actor on Apify.

### Use from Claude, Cursor or any MCP client

Add `https://mcp.apify.com?tools=tubetext/youtube-tiktok-comments-api` as a remote MCP server and sign in to Apify (Claude: **Settings → Connectors → Add custom connector**). Claude Code:

```bash
claude mcp add --transport http tubetext "https://mcp.apify.com?tools=tubetext/youtube-tiktok-comments-api"
```

Then ask, for example: *"Get the top comments on this YouTube video and tell me what viewers liked and disliked: \[link]"* or *"Which moments of this Bilibili video got the most danmaku, and what was on screen?"*

🆓 **Free to try:** Apify's free plan includes $5 of usage every month, no credit card needed – enough for about 16 videos with up to 1,000 comments each with this tool.

**What you get** – real output from a test run, shortened. One summary row per video (themes, top-liked and controversial comments in more columns), plus one row per moment on long YouTube and Bilibili videos:

| Video | Platform | Read as | Comments | Mood (like-weighted) | Top theme |
|---|---|---|---|---|---|
| bilibili献给新一代的演讲《后浪》 | bilibili | moments | 3 | danmaku 88% positive |  |
| hi. | youtube | moments | 1000 | 13% positive, 73% negative | Mocking the apology |
| (TikTok video) | tiktok | themes + sentiment | 191 | 90% positive, 2% negative | product metaphor parenting |

### YouTube and TikTok comments API with sentiment

Call it from your back end with the Apify API. One request runs the Actor and returns the rows as JSON:

```bash
curl -X POST "https://api.apify.com/v2/acts/tubetext~youtube-tiktok-comments-api/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H 'Content-Type: application/json' -d '{"urls":["https://www.tiktok.com/@okc.dad/video/7682492258666515726"],"maxComments":500,"includeComments":true}'
```

- **Big batches:** A video takes about 1–2 minutes and the sync endpoint waits up to 5 minutes, so keep sync calls to 1–3 videos. For more, start the run with `POST /v2/acts/tubetext~youtube-tiktok-comments-api/runs` and a webhook, then fetch the dataset.
- **Monitoring:** Brand or creator monitoring: schedule the run with your video links and compare `likeWeightedSentiment` and `themes` between runs. Add an Apify webhook to get notified when each run finishes.
- **Cost at volume:** 300 videos a month ≈ $90 at the free-plan price ($0.30 per video including 1,000 comments; +$0.10 per extra 1,000). Videos with nothing to read are free.
- **Stable output:** field names don't change between runs. Failed or empty items come back as status rows that aren't billed, and every row has `charged: true/false`.
- **Why not the official API:** The official YouTube and TikTok APIs need keys and quotas and return raw comments only. This returns comments plus like-weighted sentiment, themes and, for long videos, the moments viewers react to.

### What does the Comments API do?

Paste any public **YouTube, TikTok or Bilibili** video and get its **comments with sentiment analysis**, plus a read of how the audience reacted, in one call. No login and no API key.

- **Long YouTube videos and Bilibili: the moments viewers react to.** It finds the seconds people rewatch (YouTube's "most replayed" peaks), flood with danmaku (弹幕) or name in comments ("10:51 🔥"). For each moment it describes what's on screen, explains why viewers react, and quotes the comments about it word for word.
- **YouTube Shorts and TikTok: what people say and how they feel.** Themes with counts, **like-weighted sentiment**, the top-liked comments, controversial threads and the creator's replies.

Up to 1,000 comments per video for $0.30. Usernames are never collected.

### Real results

- **Kendrick Lamar's Super Bowl halftime show (YouTube):** the moments at 10:01, 10:51 and 11:13 match YouTube's own "most replayed" labels. The top comment (385K likes, Samuel L. Jackson as Uncle Sam) is linked to 10:01, "hey Drake" (352K) to 10:51 and "A Minor" (197K) to 11:13.
- **Colleen Ballinger, "hi." (YouTube):** a raw count shows comments split 43% positive / 43% negative, but **like-weighted they're 73% negative**. The comments people agree with most are far more critical than the average one.
- **《后浪》 (Bilibili):** danmaku bursts at 3:31 and 3:42 ("奔涌吧，后浪"), with 88% positive danmaku.

### Who it's for

- **Creators and agencies**: which second made people comment, rewatch or flood the danmaku, and what they said about it.
- **Brands and product teams**: what viewers like and complain about in reviews and unboxings, weighted by what the audience agrees with.
- **Researchers and data teams**: a clean comments dataset with sentiment and themes, ready for a spreadsheet, BI or an LLM.
- **AI agents**: one call returns comments plus a structured audience read (see "Use from Claude").

### What data can you get?

- 📍 **Moment rows** (long YouTube, Bilibili): `timecode`, `peakSeconds`, which signals found it (`signalSources`: heatmap, danmaku, timestampComments), `signalStrength`, `onScreen`, `whyViewersReact`, `emotion`, `sentiment`, `likeWeightedSentiment`, and the `topComments` and `danmakuSample` about it. Each linked comment says how it was linked (`alignment`: timestamp, text_mention or semantic).
- 🧭 **Summary row** (every video): `sentimentSplit` and `likeWeightedSentiment`, `themes` (count, share of likes, sentiment, example), `topLikedComments`, `controversialComments` (many replies, split reactions), `creatorAndPinned` and `creatorReplies`, `consensus` or `split`, the strongest positive and negative moments, `uniqueCommenters`, and a `coverageNote` that says exactly what was read ("heatmap: no · comments: 191 of 221 (top-ranked, replies not sampled)").
- 💬 **Comment rows** (turn on `includeComments`): text, likes, replies, date, pinned and creator flags, timestamps mentioned, sentiment, and the moment it belongs to. With this on, it's also a cheap comments scraper.
- 🔒 **No usernames**: each author gets an anonymous `authorKey` (a salted hash, new per run), only so unique commenters can be counted.

### YouTube comments API

Long videos get timeline moments from the "most replayed" heatmap and timestamped comments. YouTube Shorts get themes and like-weighted sentiment. 1,000 comments take about 60–150 seconds. On very large videos the 150-second fetch limit can stop at about 950 comments, and the summary says "partial".

### TikTok comments API

Top-ranked comments with like-weighted sentiment, themes, top-liked comments and creator replies. 1,000 comments take about 30–60 seconds. Replies aren't sampled on TikTok. Example: on an @okc.dad TikTok, 191 of 221 comments were read; 93% were positive and the top theme, a "product edition" joke, carried 86% of all likes.

### Bilibili comments and danmaku (弹幕)

Danmaku bursts become moments, with quotes kept in the original Chinese and the analysis in your output language. Bilibili is read logged out, so you get the top comment threads (about 3) and a danmaku sample (the newest 1,200, or the timeline history when it's reachable), not every comment.

### Input

- **Video links** (`urls`): YouTube videos and Shorts, TikTok, Bilibili. Instagram isn't supported (it needs a login).
- **Max comments per video** (`maxComments`): 20–5,000, default 1,000.
- **Max moments** (`maxMoments`): 1–10, default 5.
- **Top-liked comments** (`topLikedComments`): default 10.
- **Include comment rows** (`includeComments`): off by default.
- **Output language** (`outputLanguage`): default English. Quotes stay in the original language.
- **Max video length** (`maxVideoMinutes`): default 120. Longer videos are skipped, free.

### Output

A real moment row (Kendrick Lamar's halftime show), shortened:

```json
{
  "rowType": "moment", "platform": "youtube", "momentIndex": 1, "timecode": "10:01",
  "signalSources": ["heatmap", "timestampComments"], "signalStrength": 0.762,
  "onScreen": "Samuel L. Jackson dressed as Uncle Sam is speaking to the camera.",
  "whyViewersReact": "Viewers recognize the start of the song 'Not Like Us' and express excitement for the climax of the performance.",
  "emotion": "anticipation", "sentiment": 0.9, "sentimentLabel": "positive",
  "topComments": [{"text": "Samuel L Jackson as Uncle Sam was genius!!", "likes": 385000, "replyCount": 704,
                   "creatorLiked": true, "authorKey": "71dbb0f74fe6", "alignment": "text_mention"}]
}
```

A real summary row (Colleen Ballinger, "hi."), shortened:

```json
{
  "rowType": "summary", "platform": "youtube", "momentMethod": "timeline peaks", "commentsFetched": 1000,
  "sentimentSplit": {"positive": 0.434, "neutral": 0.135, "negative": 0.431},
  "likeWeightedSentiment": {"positive": 0.133, "neutral": 0.137, "negative": 0.73},
  "oneSided": "negative",
  "coverageNote": "heatmap: yes (100 buckets) · comments: 1,000 of ? (top-ranked, replies sampled on the 7 most-replied threads)"
}
```

### How honest is it?

- A comment is linked to a moment only when it names a timestamp, clearly mentions what's on screen then, or (for semantic beats) passes a confidence check. Every link carries its `alignment`.
- "No heatmap" is stated when YouTube doesn't publish one. It's never guessed.
- Below 5 reactions, a moment gets no sentiment score, just a `sentimentNote` ("too few reactions").
- Replay peaks at the very start and end of a video, and check-in danmaku walls ("打卡"), are listed under `notes` as not counted, so they don't pose as moments.
- In New markets' 5-video review the analysis scored 4.0/5 overall (sentiment 4.4, on-screen descriptions 4.2).

### How much does it cost?

**$0.30 per video, including up to 1,000 comments**, plus **$0.10 per started extra 1,000 comments**, at the Apify free-plan price (cheaper on higher plans).

**When you're not charged at all**

- The video has no comments and no heatmap or danmaku at all (you get one free `no_signals` row).
- The link is wrong, private or deleted, or the video is longer than **Max video length**.
- Something fails on our side, for example our AI provider is overloaded.
- Your **Maximum cost per run** is below the price of the next video (you get a free explanation row).

**The one partial charge: `processing-fee`, $0.02 per video.** It applies only when the AI analysis already ran on your video and returned nothing usable. Every row has `charged` and `costCase`, so you can see which rule applied.

Need the shots behind those moments? [Shot-by-Shot Video Analysis Pro](https://apify.com/tubetext/shot-by-shot-video-analysis) analyzes every shot like a director would. Need hooks and scripts for many videos? [Video Breakdown AI](https://apify.com/tubetext/video-breakdown-ai).

### Ready-made examples

- [YouTube Comment Sentiment Analysis](https://apify.com/tubetext/youtube-tiktok-comments-api/examples/youtube-comment-sentiment-analysis)
- [TikTok Comments API with Sentiment](https://apify.com/tubetext/youtube-tiktok-comments-api/examples/tiktok-comments-api-with-sentiment)
- [Bilibili Danmaku Analysis (弹幕分析)](https://apify.com/tubetext/youtube-tiktok-comments-api/examples/bilibili-danmaku-analysis)

### TubeText Labs tools

**TubeText Labs** builds 33 pay-per-result Apify Actors for video, social and e-commerce data – no login, JSON/CSV/Excel output, and ready for ChatGPT and Claude (Apify MCP), n8n, Make and Zapier. All tools: [apify.com/tubetext](https://apify.com/tubetext)

**Transcripts**

- [YouTube Transcript Scraper](https://apify.com/tubetext/youtube-transcript-fast) – videos, Shorts, playlists and whole channels to text; Whisper AI when there are no captions
- [TikTok Transcript Scraper](https://apify.com/tubetext/tiktok-transcript) – TikTok captions plus Whisper AI, SRT and timestamps
- [Instagram Reels Transcript](https://apify.com/tubetext/instagram-reels-transcript) – reel links or @usernames to text with Whisper AI
- [Podcast & Video Transcript](https://apify.com/tubetext/any-video-podcast-transcript) – podcast RSS / Apple Podcasts, X, Facebook, Loom, Twitch and audio files to text
- [Facebook Video Transcript](https://apify.com/tubetext/facebook-video-transcript) – public Facebook videos and Reels to text with Whisper AI
- [X (Twitter) Video Transcript](https://apify.com/tubetext/twitter-x-video-transcript) – X/Twitter video posts to text with Whisper AI
- [Reddit Video Transcript](https://apify.com/tubetext/reddit-video-transcript) – videos in public Reddit posts (v.redd.it) to text with Whisper AI, with SRT and timestamps
- [Bilibili Video Transcript](https://apify.com/tubetext/bilibili-video-transcript) – Bilibili (B站) videos to text with Whisper AI, plus optional English summaries
- [Podcast Transcript](https://apify.com/tubetext/podcast-transcript) – podcast RSS feeds and Apple Podcasts episodes to text with Whisper AI

**Video & ad analysis**

- [Video Breakdown AI](https://apify.com/tubetext/video-breakdown-ai) – hook analysis, shot list, cut pacing, products shown and script of any TikTok, Reel or YouTube video
- [Shot-by-Shot Video Analysis Pro](https://apify.com/tubetext/shot-by-shot-video-analysis) – director-level storyboard of any video: framing, camera move, emotion and why each shot works, plus replay peaks, danmaku and comments tied to shots
- [YouTube & TikTok Comments API](https://apify.com/tubetext/youtube-tiktok-comments-api) *(this tool)* – comments with like-weighted sentiment and themes, plus the moments viewers react to on long YouTube and Bilibili videos
- [Video Ad Analyzer](https://apify.com/tubetext/video-ad-analyzer) – competitors' YouTube video ads by brand or domain (Google Ads Transparency), torn down by AI
- [Meta Ad Library Scraper](https://apify.com/tubetext/meta-ad-library-videos) – Facebook and Instagram ads by brand or keyword: video URLs, images, ad copy, CTA and landing page

**Social, apps & trends**

- [YouTube Channel Analytics](https://apify.com/tubetext/youtube-channel-analytics) – subscribers, recent video performance, Social Blade grade, ranks and estimated earnings
- [Bilibili Scraper](https://apify.com/tubetext/bilibili-scraper) – Bilibili (B站) keyword search, popular board, top-100 ranking, video stats, danmaku text and creator (UP主) followers – no login
- [China Trending Topics](https://apify.com/tubetext/china-trending-topics) – Douyin, Weibo, Baidu, Toutiao and Bilibili hot-search boards in one run, in English – plus an optional AI briefing on why topics trend
- [WeChat Article Scraper](https://apify.com/tubetext/wechat-articles-scraper) – WeChat 公众号 articles by keyword or link: full text, English titles and optional English summaries
- [Google Play Reviews + AI Insights](https://apify.com/tubetext/google-play-reviews-ai) – Android app reviews by star rating, country and language, plus an AI report of complaints and praise
- [Steam Reviews Scraper + AI Insights](https://apify.com/tubetext/steam-reviews-scraper) – Steam game reviews with hours played and votes, review score and current players, plus an AI report of top complaints, praise and feature requests
- [Social Blade Scraper](https://apify.com/tubetext/socialblade-scraper) – Social Blade stats for YouTube, TikTok, Instagram and Twitch creators – grade, ranks, 2-week growth, daily history, earnings estimates and top-100 lists
- [Spotify Play Count Scraper](https://apify.com/tubetext/spotify-play-count-scraper) – play counts for every track of an album, artist or playlist (incl. Top 50 charts), plus monthly listeners, followers, world rank and top cities

**E-commerce & travel**

- [TikTok Shop Product Scraper](https://apify.com/tubetext/tiktok-shop-product-scraper) – US TikTok Shop prices, items sold, stock per SKU and shop stats
- [AliExpress Search Scraper](https://apify.com/tubetext/aliexpress-search-scraper) – AliExpress search results by keyword: price, items sold, rating, shipping, badges
- [Google Hotels Scraper](https://apify.com/tubetext/google-hotels-scraper) – hotel prices for any destination and dates, per booking site and as a 90-day price calendar
- [Taobao & Tmall Product Scraper](https://apify.com/tubetext/taobao-tmall-scraper) – Taobao/Tmall products by Chinese or English keyword, category or URL: CNY prices, shops and seller scores
- [Alibaba & Yiwu Supplier Finder by Image](https://apify.com/tubetext/alibaba-yiwu-image-search) – product photo in, similar Alibaba.com and Yiwu wholesale listings out: price, MOQ, supplier, country and rating
- [Amazon Product Search Scraper](https://apify.com/tubetext/amazon-product-search-scraper) – Amazon search results, Best Sellers lists and product pages: price, rating, reviews, monthly sales signal, badges and specs
- [Google Flights Scraper](https://apify.com/tubetext/google-flights-scraper) – flight prices for any route or multi-city trip, a cheapest-day calendar, price insights and booking options per site
- [Agoda & Booking.com Hotel Reviews + AI](https://apify.com/tubetext/agoda-reviews-scraper) – Agoda hotel reviews plus verified Booking.com reviews shown on Agoda, hotel scores and sub-scores, and an AI report of complaints, praise and action items
- [Gas Prices Scraper (US & Canada)](https://apify.com/tubetext/gas-prices-scraper) – live gas station prices by ZIP, city or coordinates – regular, premium, diesel, E85 – with an area summary of the cheapest stations
- [Idealo Price Scraper](https://apify.com/tubetext/idealo-price-scraper) – every shop offer for a product on idealo – price, shipping, delivery, shop rating – in Germany, Austria, France, Italy, Spain and the UK, with a summary per market

**Esports & sports data**

- [Esports Match Timeline](https://apify.com/tubetext/esports-match-timeline) – Valorant and CS2 round-by-round scores, winners and VOD timestamps read from broadcast VODs

**Questions or problems?** [Open an issue](https://apify.com/tubetext/youtube-tiktok-comments-api/issues) (we read every one). **Need a custom version?** Ask in an issue or [email us](mailto:tubettext@gmail.com) – we build it as a private Actor on Apify.

Found it useful? A short review on this page helps others find it.

Built by **TubeText Labs** · Pay per result. No login. Ready for AI agents.

### FAQ

**How long does a video take?** Usually 60–120 seconds, and about 10 seconds for a video with nothing to read. Up to 5 videos run in parallel (`maxConcurrency`).

**Why are Shorts and TikTok different from long videos?** They have no replay heatmap, and comments rarely name a second, so "moments" there are short semantic beats with few linked comments. For those videos the useful output is themes, like-weighted sentiment and the top-liked comments, and that's what the summary leads with (`momentMethod: "semantic beats"`).

**Do you collect usernames?** No. Comments come without names or handles. To count unique commenters we keep only an anonymous `authorKey` (a salted hash, new per run) that can't be turned back into a name.

**Does it get every comment?** Up to your `maxComments` of the top-ranked comments on YouTube and TikTok. Replies are sampled on YouTube's most-replied threads and not on TikTok. Bilibili gives the top threads and a danmaku sample. Some Shorts have comments turned off or show featured comments only. `coverageNote` always says what was read.

**Is it legal?** The Actor reads public comments and public video signals without logging in, and outputs no usernames. You're responsible for using the data in line with the platforms' terms and your local law; for unusual uses, ask a lawyer.

**Cost telemetry:** when a run ends unusually (for example it cost more than it earned), the Actor sends us a small anonymous summary via a webhook: run ID, duration, memory, compute and AI cost, whether the account is on a free or paid plan, and counts of free rows. We use it to keep prices fair. Your inputs, links and results are never sent.

### 中文说明

**视频评论 / 弹幕分析 API**：粘贴 YouTube、TikTok 或 B站公开视频链接，获取评论与情感分析（按点赞加权）。长视频和 B站：找出观众反复观看、弹幕刷屏或在评论里点名的时刻，说明画面内容和观众反应的原因，并原文引用相关评论和弹幕。Shorts 和 TikTok：主题统计、点赞加权情感、高赞评论、争议讨论和作者回复。每条视频 $0.30（含 1,000 条评论），无评论也无弹幕/热度数据时免费。不收集用户名。暂不支持 Instagram（需要登录）。

### Support

Found a bug, or need a platform or field? [Open an issue](https://apify.com/tubetext/youtube-tiktok-comments-api/issues) – we read every one. **Need a custom version?** Ask in an issue or [email us](mailto:tubettext@gmail.com) – we build it as a private Actor on Apify.

# Actor input Schema

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

YouTube, TikTok or Bilibili video links.

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

Top comments read per video (YouTube/TikTok). Bilibili shows only its top threads without login; danmaku carry the timeline there.

## `maxMoments` (type: `integer`):

Reaction peaks to describe per video.

## `topLikedComments` (type: `integer`):

How many of the most-liked comments to list, each mapped to a moment when it refers to one.

## `outputLanguage` (type: `string`):

Language of the analysis; quotes stay in their original language.

## `includeComments` (type: `boolean`):

Also output every comment read (text, likes, replies, sentiment).

## `maxVideoMinutes` (type: `integer`):

Longer videos are skipped (not charged).

## `maxConcurrency` (type: `integer`):

Videos processed at the same time.

## Actor input object example

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "maxComments": 1000,
  "maxMoments": 5,
  "topLikedComments": 10,
  "outputLanguage": "English",
  "includeComments": false,
  "maxVideoMinutes": 120,
  "maxConcurrency": 3
}
```

# Actor output Schema

## `videos` (type: `string`):

No description

## `moments` (type: `string`):

No description

## `comments` (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.youtube.com/watch?v=dQw4w9WgXcQ"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("tubetext/youtube-tiktok-comments-api").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.youtube.com/watch?v=dQw4w9WgXcQ"] }

# Run the Actor and wait for it to finish
run = client.actor("tubetext/youtube-tiktok-comments-api").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.youtube.com/watch?v=dQw4w9WgXcQ"
  ]
}' |
apify call tubetext/youtube-tiktok-comments-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,tubetext/youtube-tiktok-comments-api"
        }
    }
}
```

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/M333S7PkaJEID2kcQ/builds/ZhhRvKlD3Zesjy6SQ/openapi.json
