# TikTok Comments Scraper (`automation-lab/tiktok-comments-scraper`) Actor

Scrape comments from TikTok videos. Extract comment text, author info, likes, replies, and timestamps.

- **URL**: https://apify.com/automation-lab/tiktok-comments-scraper.md
- **Developed by:** [Automation Lab](https://apify.com/automation-lab) (community)
- **Categories:** Social media, Lead generation
- **Features:** Limited permissions
- **Stats:** 274 total users, 12 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.95 / 1,000 comment scrapeds

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

### What does TikTok Comments Scraper do?

**TikTok Comments Scraper** extracts comments from any [TikTok](https://www.tiktok.com) video — no TikTok API key, no login, and no coding required. Paste one or more video URLs, set your limits, and the scraper returns structured comment data including **author details, like counts, timestamps, and optional reply threads**.

The actor uses TikTok's public comment endpoints directly for fast extraction and automatically falls back to a headless browser when TikTok requires a browser session. Every comment is returned as a clean JSON record ready to export to CSV, Google Sheets, or any downstream system. Start scraping with the prefilled example in under a minute.

Unlike browser extensions that break with every TikTok update, this cloud-based scraper runs 24/7 with no local setup. All platform costs — compute, proxy, storage — are included in the pay-per-comment price.

***

### Who is it for?

**📣 Social media managers and brand teams**

- Monitor brand mentions and sentiment across viral TikTok videos
- Track campaign hashtag performance and measure audience reactions in real time
- Spot negative comments early and manage reputation before they spread

**📊 Market researchers and data analysts**

- Collect large comment datasets for sentiment analysis and NLP models
- Compare audience reactions across competitor content and creators
- Build ground-truth datasets for social media research papers and academic studies

**🎨 Content creators and influencers**

- Understand which video topics generate the most engagement and replies
- Identify your most active community members by likes and reply activity
- Benchmark your comment volume and quality against similar creators in your niche

**🔬 Researchers and journalists**

- Study discourse patterns on short-form video platforms at scale
- Archive public comments from newsworthy TikTok videos before they are deleted
- Analyze trends in user language, sentiment shifts, and emerging cultural topics

***

### Why use TikTok Comments Scraper?

- ✅ **No TikTok API key or login required** — scrapes public data directly from TikTok pages
- ✅ **Fast direct extraction** — uses TikTok's public comment endpoints without waiting for full page rendering
- ✅ **Automatic browser fallback** — establishes a browser session only when direct extraction is unavailable
- ✅ **Reply thread support** — optionally fetch nested replies with `includeReplies` enabled
- ✅ **Clickable source links** — open each comment or author profile directly from the dataset
- ✅ **Pay-per-event pricing** — pay only for comments actually extracted, not idle compute time
- ✅ **Runs in the cloud** — no local setup, no browser management, no maintenance required
- ✅ **Schedule and automate** — set recurring runs to monitor the same videos over time
- ✅ **Export anywhere** — JSON, CSV, Excel, Google Sheets, or push via API and webhook
- ✅ **Batch processing** — scrape multiple videos in a single run with one dataset output

***

### What data can you extract?

| 💬 Comment data | Field | Description |
|---|---|---|
| Comment text | `text` | The full comment body |
| Unique comment ID | `commentId` | TikTok's internal comment identifier (`id` remains as a legacy alias) |
| Like count | `likes` | Number of likes the comment received |
| Reply count | `replies` | Number of replies under the comment |
| Posted timestamp | `createdAt` | ISO 8601 datetime when the comment was posted |
| Reply flag | `isReply` | `true` if this is a reply to another comment |
| Parent comment ID | `parentCommentId` | Links replies to their parent comment |
| Comment URL | `commentUrl` | Clickable TikTok source link for the exact comment or reply |

| 👤 Author data | Field | Description |
|---|---|---|
| Display name | `author` | The author's TikTok display name |
| Unique author ID | `authorId` | The author's TikTok username or fallback user ID |
| Author profile URL | `authorProfileUrl` | Clickable TikTok profile link when a username is available |
| Avatar image URL | `authorAvatarUrl` | Direct link to the author's profile avatar |

| 🎬 Video context | Field | Description |
|---|---|---|
| Video ID | `videoId` | TikTok's internal video identifier |
| Source video URL | `videoUrl` | The original URL you passed as input |
| Scrape timestamp | `scrapedAt` | ISO 8601 datetime when the data was collected |

**16 fields total** per comment record, including the backward-compatible `id` alias. `authorProfileUrl` is `null` only when TikTok does not return a username; `commentUrl` is `null` only when a comment or video ID is unavailable.

***

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

This actor uses **pay-per-event** pricing — you pay only for comments actually scraped. No monthly subscription. All platform costs including proxy and compute are included.

| Event price (USD) | FREE | BRONZE | SILVER | GOLD | PLATINUM | DIAMOND |
|---|---:|---:|---:|---:|---:|---:|
| **Run start** | $0.005 | $0.00475 | $0.00425 | $0.00375 | $0.003 | $0.0025 |
| **Per comment** | $0.003 | $0.0027 | $0.0024 | $0.00195 | $0.0015 | $0.0012 |

Estimate a run's event charge as the applicable run-start price plus the applicable per-comment price multiplied by the number of comments scraped.

**Real-world cost examples:**

| Task | Comments | Estimated cost |
|---|---|---|
| Quick sample: top 20 comments from 1 video | 20 | ~$0.07 |
| Campaign check: 100 comments from 5 videos | 500 | ~$1.51 |
| Monitoring run: 10 videos × 200 comments | 2,000 | ~$6.01 |
| Research dataset: 50 videos × 500 comments | 25,000 | ~$75.01 |

At FREE-tier event prices, $5 of platform credit covers approximately **1,665 comment events plus one run start**, before any other account charges.

***

### How to scrape TikTok comments

1. Open [TikTok Comments Scraper](https://apify.com/automation-lab/tiktok-comments-scraper) on Apify Store
2. Click **Try for free** — sign in or create a free Apify account
3. Paste one or more TikTok video URLs into the **Video URLs** field
4. Set **Max comments per video** (default: 100 — adjust it for smaller samples or larger datasets)
5. Toggle **Include replies** if you want nested reply threads
6. Click **Save & Start**
7. Wait for the run to finish (direct requests are usually fast; browser fallback can take longer)
8. Click **Export** to download your data as JSON, CSV, or Excel

**Example inputs for different scenarios:**

Single video, top comments only:

```json
{
  "videoUrls": ["https://www.tiktok.com/@khaby.lame/video/7623088450576633119"],
  "maxCommentsPerVideo": 50,
  "includeReplies": false
}
```

Multiple videos with reply threads:

```json
{
  "videoUrls": [
    "https://www.tiktok.com/@charlidamelio/video/7234567890123456789",
    "https://www.tiktok.com/@khaby.lame/video/7234567890123456780"
  ],
  "maxCommentsPerVideo": 100,
  "includeReplies": true,
  "maxRepliesPerComment": 10
}
```

Minimal test run (fast, cheap):

```json
{
  "videoUrls": ["https://www.tiktok.com/@khaby.lame/video/7623088450576633119"],
  "maxCommentsPerVideo": 5,
  "includeReplies": false
}
```

***

### Input parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `videoUrls` | array of strings | — | TikTok video URLs to scrape. Each must be a full `https://www.tiktok.com/@username/video/ID` link. |
| `maxCommentsPerVideo` | integer | 100 | Maximum number of top-level comments to extract per video. |
| `includeReplies` | boolean | false | When enabled, also fetches reply comments nested under each top-level comment. |
| `maxRepliesPerComment` | integer | 20 | Maximum replies per top-level comment. Only applies when `includeReplies` is true. |

***

### Output examples

Each comment is saved as one record in the dataset. Example top-level comment:

```json
{
  "id": "7606987654321098765",
  "commentId": "7606987654321098765",
  "text": "This is actually insane, I can't stop watching 😂",
  "author": "cooluser99",
  "authorId": "cooluser99",
  "authorProfileUrl": "https://www.tiktok.com/@cooluser99",
  "authorAvatarUrl": "https://p16-sign.tiktokcdn-us.com/tos-useast5-avt-0068-tx/avatar~c5_100x100.jpeg",
  "likes": 1482,
  "replies": 23,
  "createdAt": "2024-11-12T14:33:00.000Z",
  "videoId": "7623088450576633119",
  "videoUrl": "https://www.tiktok.com/@khaby.lame/video/7623088450576633119",
  "commentUrl": "https://www.tiktok.com/@khaby.lame/video/7623088450576633119?comment_id=7606987654321098765",
  "isReply": false,
  "parentCommentId": null,
  "scrapedAt": "2026-03-23T10:15:42.000Z"
}
```

Example reply comment (when `includeReplies: true`):

```json
{
  "id": "7607012345678901234",
  "commentId": "7607012345678901234",
  "text": "@cooluser99 same, I watched it 10 times already",
  "author": "tiktok_fan_2024",
  "authorId": "tiktok_fan_2024",
  "authorProfileUrl": "https://www.tiktok.com/@tiktok_fan_2024",
  "authorAvatarUrl": "https://p16-sign.tiktokcdn-us.com/tos-useast5-avt-0068-tx/avatar2~c5_100x100.jpeg",
  "likes": 47,
  "replies": 0,
  "createdAt": "2024-11-12T15:01:00.000Z",
  "videoId": "7623088450576633119",
  "videoUrl": "https://www.tiktok.com/@khaby.lame/video/7623088450576633119",
  "commentUrl": "https://www.tiktok.com/@khaby.lame/video/7623088450576633119?comment_id=7607012345678901234",
  "isReply": true,
  "parentCommentId": "7606987654321098765",
  "scrapedAt": "2026-03-23T10:15:45.000Z"
}
```

Reply records include `isReply: true` and a `parentCommentId` so you can reconstruct the full conversation thread. Both top-level comments and replies include their own `commentUrl`, while `authorProfileUrl` lets you open the author profile without constructing a URL yourself.

***

### Tips for best results

- 🟢 **Start small**: Run with `maxCommentsPerVideo: 20` first to validate your URL format and check output quality before scaling up.
- 🔗 **Use full video URLs**: The actor requires complete `https://www.tiktok.com/@username/video/VIDEOID` format. Short links like `vm.tiktok.com/...` are not supported.
- 💬 **Reply threads are optional**: Enabling `includeReplies` can multiply your comment count significantly on popular videos. Only enable it when you need nested conversation data.
- 📅 **Schedule recurring runs**: Use Apify's built-in scheduler to monitor the same video URLs weekly and track comment volume and sentiment over time.
- 📦 **Batch your videos**: Pass multiple URLs in a single run — the actor processes them sequentially and writes all results to one dataset.
- ⏱️ **Fast by default**: Direct comment requests usually finish in seconds. If TikTok requires a browser session, the automatic fallback can take longer.
- 🔄 **Re-run to catch new comments**: TikTok comments accumulate on trending videos. Re-run periodically to capture the latest activity without duplicating old records (use `createdAt` to filter).
- 💡 **Filter by `isReply`**: Post-process your dataset to separate top-level comments from replies for cleaner analysis.

***

### Integrations

TikTok Comments Scraper connects with 5,000+ apps through Apify's built-in integration layer.

**📊 TikTok Comments → Google Sheets**
Automatically export every new run's comments into a shared spreadsheet. Use Apify's native Google Sheets integration to append rows in real time — ideal for social media teams tracking multiple campaigns in one dashboard without touching a spreadsheet manually.

**💬 TikTok Comments → Slack alerts**
Connect via Make or Zapier: when a run finishes, post a summary (video URL, comment count, top liked comment) to your Slack channel. Get instant visibility the moment monitoring data refreshes.

**⚡ TikTok Comments → Make / Zapier workflows**
Feed scraped comment text directly into sentiment analysis APIs (OpenAI, MonkeyLearn), CRM systems, or reporting dashboards. Trigger the workflow on a schedule or via webhook after each actor run completes.

**🔁 Scheduled monitoring**
Set Apify to run TikTok Comments Scraper daily on a fixed list of competitor or brand videos. Build a time-series dataset to track engagement trends automatically — no manual work after the initial setup.

**🔔 Webhooks for real-time processing**
Configure a run-finish webhook to POST the dataset URL to your own API endpoint. Your backend receives fresh comment data the moment the scraper completes — no polling, no delay.

***

### API usage

Run TikTok Comments Scraper programmatically from any language or CI/CD pipeline.

**Node.js**

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

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

const run = await client.actor('automation-lab/tiktok-comments-scraper').call({
  videoUrls: ['https://www.tiktok.com/@khaby.lame/video/7623088450576633119'],
  maxCommentsPerVideo: 50,
  includeReplies: false,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Scraped ${items.length} comments`);
console.log(items[0]);
```

**Python**

```python
from apify_client import ApifyClient

client = ApifyClient(token='YOUR_API_TOKEN')

run = client.actor('automation-lab/tiktok-comments-scraper').call(run_input={
    'videoUrls': ['https://www.tiktok.com/@khaby.lame/video/7623088450576633119'],
    'maxCommentsPerVideo': 50,
    'includeReplies': False,
})

items = list(client.dataset(run['defaultDatasetId']).iterate_items())
print(f"Scraped {len(items)} comments")
print(items[0])
```

**cURL**

```bash
curl -X POST "https://api.apify.com/v2/acts/automation-lab~tiktok-comments-scraper/runs?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "videoUrls": ["https://www.tiktok.com/@khaby.lame/video/7623088450576633119"],
    "maxCommentsPerVideo": 50,
    "includeReplies": false
  }'
```

Fetch results after the run completes:

```bash
curl "https://api.apify.com/v2/datasets/DATASET_ID/items?token=YOUR_API_TOKEN&format=json"
```

Find your API token at [apify.com/account/integrations](https://apify.com/account/integrations). See the full [Apify API documentation](https://docs.apify.com/api/v2) for webhooks, scheduling, and pagination.

***

### Use with AI agents via MCP

TikTok Comments Scraper is available as a tool for AI assistants that support the [Model Context Protocol (MCP)](https://docs.apify.com/platform/integrations/mcp).

Add the Apify MCP server to your AI client — this gives you access to all Apify actors, including this one:

#### Setup for Claude Code

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=automation-lab/tiktok-comments-scraper"
```

#### Setup for Claude Desktop, Cursor, or VS Code

Add this to your MCP config file:

```json
{
    "mcpServers": {
        "apify": {
            "url": "https://mcp.apify.com?tools=automation-lab/tiktok-comments-scraper"
        }
    }
}
```

Your AI assistant will use OAuth to authenticate with your Apify account on first use.

#### Example prompts

Once connected, try asking your AI assistant:

- "Use automation-lab/tiktok-comments-scraper to scrape the top 100 comments from this TikTok video and summarize what people are saying: https://www.tiktok.com/@khaby.lame/video/7623088450576633119"
- "Scrape comments from these 3 competitor TikTok videos and identify the most common complaints and praise points"
- "Pull TikTok comments from this viral video with replies included, then group them by sentiment and list the top 5 most-liked negative comments"

Learn more in the [Apify MCP documentation](https://docs.apify.com/platform/integrations/mcp).

***

### Error reporting

Failed operations send sanitized diagnostic input, exceptions and Actor, build and run IDs to our private GlitchTip service so we can repair them. Secret fields and URL queries are removed, and reports are retained for 30 days.

### Is it legal to scrape TikTok comments?

TikTok comments are **public data** — they are visible to anyone visiting TikTok without logging in. Scraping publicly accessible information is generally considered legal, as affirmed by the 2022 *hiQ Labs v. LinkedIn* ruling in the United States, which established that scraping public data does not violate the Computer Fraud and Abuse Act.

Automation Lab's actors are built for **ethical, responsible data collection**:

- Only public, non-login-protected content is accessed
- No CAPTCHAs are bypassed; optional user-configured proxies can be used for regional or rate-limit issues
- No private messages, account credentials, or non-public content is ever extracted

**You are responsible for how you use the data.** Before using scraped TikTok comments for commercial purposes, publishing, or research, review:

- [TikTok's Terms of Service](https://www.tiktok.com/legal/page/us/terms-of-service/en)
- GDPR requirements if processing data about EU residents
- Your jurisdiction's laws on automated data collection

For academic research and personal use, scraping public TikTok comments is broadly accepted practice. For commercial applications at scale, consult a lawyer familiar with your jurisdiction. See Apify's blog post on [web scraping legality](https://blog.apify.com/is-web-scraping-legal/) for a broader overview.

***

### FAQ

**How many comments can I scrape per run?**
There is no hard cap per run — set `maxCommentsPerVideo` as high as needed. TikTok loads comments in batches and very popular videos may have thousands of accessible comments. Most use cases work well with 100–500 comments per video. Very large jobs (500+ comments across many videos) may need the timeout increased beyond the default 5-minute window.

**How much does it cost to scrape 1,000 TikTok comments?**
Approximately $3.01 total: $0.005 for the run start fee plus $3.00 for 1,000 comments at $0.003 each. The free Apify plan includes $5 in credits — enough for roughly 1,650 comments at no cost.

**How is this different from the official TikTok API?**
TikTok's official Content Posting API does not expose public comments from arbitrary videos — it only gives brands access to their own content metrics. This actor scrapes public comment data from any video URL without requiring a developer account, API approval process, or official API access.

**Why are some comments missing or fewer than the video's displayed count?**
TikTok applies server-side content filters — spam detection, regional restrictions, shadow banning — that hide certain comments even from public view. The scraper extracts all comments TikTok makes publicly available. If the run completed without errors and returned fewer results than the displayed count, TikTok is filtering those comments before returning them.

**Can I scrape replies to comments?**
Yes. Enable `includeReplies: true` and set `maxRepliesPerComment` to control how many replies per comment are fetched. Reply records include `isReply: true` and a `parentCommentId` so you can reconstruct the full thread structure in your analysis.

**Why did my run fail or time out?**
TikTok's anti-bot systems occasionally block requests; the actor automatically retries through its browser-session fallback. If you see consistent failures on specific video URLs, confirm the video is still public and accessible from a regular browser. For large runs across many videos, consider splitting them into smaller batches of 5–10 videos per run to stay within the default timeout.

***

### Related scrapers

Looking for more social data tools? Explore other actors from Automation Lab:

**Other TikTok tools**

- [TikTok Scraper](https://apify.com/automation-lab/tiktok-scraper) — scrape TikTok profiles, video metadata, views, likes, shares, and descriptions

**YouTube tools**

- [YouTube Comments Scraper](https://apify.com/automation-lab/youtube-comments-scraper) — extract comments from YouTube videos with the same pay-per-comment pricing model
- [YouTube Scraper](https://apify.com/automation-lab/youtube-scraper) — scrape YouTube channels, videos, and comments in a single actor
- [YouTube Shorts Scraper](https://apify.com/automation-lab/youtube-shorts-scraper) — extract Shorts metadata and engagement data
- [YouTube Transcript Scraper](https://apify.com/automation-lab/youtube-transcript) — download video transcripts and captions

**Instagram and Twitter/X**

- [Instagram Scraper](https://apify.com/automation-lab/instagram-scraper) — scrape Instagram posts, profiles, comments, and hashtags
- [Twitter/X Scraper](https://apify.com/automation-lab/twitter-scraper) — extract tweets, replies, and profile data from Twitter/X

**Reddit**

- [Reddit Scraper](https://apify.com/automation-lab/reddit-scraper) — scrape Reddit posts and comments by subreddit, keyword, or URL

**Review platforms**

- [Trustpilot Reviews Scraper](https://apify.com/automation-lab/trustpilot) — extract customer reviews from any Trustpilot business page
- [Google Maps Reviews Scraper](https://apify.com/automation-lab/google-maps-reviews-scraper) — scrape Google Maps reviews for any business location

# Changelog

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

# Actor input Schema

## `videoUrls` (type: `array`):

List of TikTok video URLs to scrape comments from. Supports full URLs, short URLs (vm.tiktok.com), and direct video IDs.

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

Maximum number of top-level comments to extract per video. Set to 0 for unlimited.

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

Whether to also scrape reply comments under each top-level comment.

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

Maximum number of replies to extract per top-level comment. Only used when Include replies is enabled.

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

Optional proxy. By default the scraper runs without a proxy — TikTok's comment API is accessible directly. Enable proxy only if you run into rate limits or regional blocks.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.tiktok.com/@khaby.lame/video/7623088450576633119"
  ],
  "maxCommentsPerVideo": 20,
  "includeReplies": false,
  "maxRepliesPerComment": 20
}
```

# Actor output Schema

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

Dataset containing comment text, authors, engagement, timestamps, and reply context.

# 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 = {
    "videoUrls": [
        "https://www.tiktok.com/@khaby.lame/video/7623088450576633119"
    ],
    "maxCommentsPerVideo": 20,
    "includeReplies": false,
    "maxRepliesPerComment": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/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 = {
    "videoUrls": ["https://www.tiktok.com/@khaby.lame/video/7623088450576633119"],
    "maxCommentsPerVideo": 20,
    "includeReplies": False,
    "maxRepliesPerComment": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/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 '{
  "videoUrls": [
    "https://www.tiktok.com/@khaby.lame/video/7623088450576633119"
  ],
  "maxCommentsPerVideo": 20,
  "includeReplies": false,
  "maxRepliesPerComment": 20
}' |
apify call automation-lab/tiktok-comments-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automation-lab/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/jRNIZfBNoXBbhi6eq/builds/29Pa8Ao2dNtbTPZaE/openapi.json
