# TikTok Video & Comments Scraper (`devcake/tiktok-search-video-comments`) Actor

Search TikTok videos by keyword and extract public comments in one solution. Use engagement metrics, and comment data for trend analysis, product research, and competitor insights. Export to CSV, Excel, or JSON.

- **URL**: https://apify.com/devcake/tiktok-search-video-comments.md
- **Developed by:** [devcake](https://apify.com/devcake) (community)
- **Categories:** Lead generation, Social media, SEO tools
- **Stats:** 3 total users, 2 monthly users, 88.9% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.60 / 1,000 results

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## 🎵 TikTok Video Search & Comments

Find public TikTok videos by keyword and optionally collect their comments. This **TikTok keyword search scraper** gives you clear tables of videos and comments that you can review, download, or use in your regular work.

Add the topics you want to find, choose how many results you need, and start the run. The Actor handles the rest. You do not need a TikTok account, cookies, or technical setup.

### 🔎 What can you do with this combined solution?

- 🔍 **Find relevant TikTok videos:** Search by keywords, phrases, creator names, products, or campaign terms.
- 🔗 **Research videos and comments together:** Collect video details and up to 1,000 public comments per video in the same run.
- 📊 **Compare public engagement:** Review views, likes, comments, shares, and saves across the videos you find.
- 💬 **Explore audience reactions:** Read comments alongside their source videos to understand the context behind public responses.
- 🧪 **Investigate products and competitors:** Gather source data for trend analysis, product research, competitor insights, and audience research.
- 🗂️ **Keep results organized:** Remove repeated videos while preserving every search phrase and result position that found them.
- 📁 **Create research-ready datasets:** Use separate Videos and Comments tables for analysis, content planning, and reporting.
- 📤 **Export and repeat your research:** Download results for spreadsheets or schedule future runs through Apify.

Together, the **TikTok video data scraper** and **TikTok comment scraper** provide one connected source of video, engagement, and comment data.

### 👥 Who is it for?

- 📈 **Trend researchers** comparing videos, public engagement, and comments around emerging topics.
- 🛍️ **Product teams** investigating how products appear in videos and how viewers respond to them.
- 🎯 **Marketing teams** gathering source data for campaigns and social media competitor analysis.
- 🤝 **Brand and community teams** reviewing public reactions without separating video research from comment research.
- 📊 **Analysts** building a social media engagement dataset across multiple keyword searches.

### 🚀 How to search TikTok videos by keyword

1. Add one or more topics under **Search queries**.
2. Choose the maximum number of videos you want for each search.
3. Turn on **Scrape video comments** if you also need comments.
4. Choose the maximum number of comments per video.
5. Click **Start**.
6. Open the **Videos** or **Comments** table when the run finishes.

#### 🧩 Example search

| Setting | Example |
| --- | --- |
| Search queries | `running shoes`, `marathon training` |
| Maximum videos per query | `100` |
| Scrape video comments | Yes |
| Maximum comments per video | `200` |

Each search has its own video limit. Comment collection is off by default because it takes longer and uses more resources.

The Actor automatically reuses a short-lived TikTok search session inside each run. This avoids downloading the same TikTok search page and signing program again for every query. The session is not a user login and is never reused between Actor runs.

### 📊 What TikTok data will you receive?

The **Videos** table contains one entry for each unique video. If the same video appears in more than one search, it is saved once and all matching searches are kept.

| Information | What is included |
| --- | --- |
| Search details | Search phrase, position in results, and other matching searches |
| Video details | Caption, video link, publish date, length, cover image, and playback link |
| Creator | Username, display name, and verified status |
| Public activity | Views, likes, comments, shares, and saves |
| Comment progress | Number of comments found and whether more were available |

When comment collection is turned on, the **Comments** table shows one comment per entry.

| Comment information | What is included |
| --- | --- |
| Comment | Text and publish date |
| Commenter | Username, display name, and verified status |
| Public activity | Likes, reply count, and pinned status |
| Language | Language reported by TikTok |
| Source video | Video link and video ID |

#### 🎬 Example video result

For the example search `running shoes`, the **Videos** table could contain:

| Information | Example value |
| --- | --- |
| Search phrase | `running shoes` |
| Position in results | `1` |
| Matching searches | `running shoes`, `marathon training` |
| Caption | `Daily training shoe rotation` |
| Creator | `example_runner` |
| Published | `August 18, 2026` |
| Video length | `27 seconds` |
| Views | `125,000` |
| Likes | `9,200` |
| Comments on TikTok | `238` |
| Shares | `410` |
| Saves | `1,250` |
| Video | `https://www.tiktok.com/@example_runner/video/7412345678901234567` |

#### 💬 Example comment result

If comment collection is turned on, the **Comments** table could contain:

| Information | Example value |
| --- | --- |
| Search phrase | `running shoes` |
| Source video | `https://www.tiktok.com/@example_runner/video/7412345678901234567` |
| Comment | `These helped me choose my next training pair.` |
| Commenter | `sample_viewer` |
| Posted | `August 18, 2026` |
| Likes | `84` |
| Replies | `3` |
| Language | `en` |
| Pinned | `No` |

These values are illustrative. Actual results depend on the public videos and comments TikTok returns for your searches.

### ⚙️ Input settings

| Setting | Default | Allowed values | What it does |
| --- | --- | --- | --- |
| Search queries (`searchQueries`) | Required | 1-50 searches | Words or phrases to find on TikTok. |
| Maximum videos per query (`maxVideosPerQuery`) | `20` | 1-1,000 | Sets the requested number of videos for each search. Results may stop earlier if TikTok has no more videos to show. |
| Scrape video comments (`scrapeComments`) | Off | On or off | Collects public comments from each video found. |
| Maximum comments per video (`maxComments`) | `100` | 1-1,000 | Sets the requested number of comments for each video. |

#### Reduce residential proxy traffic

Traffic optimization happens automatically. The Actor requests only the number of search results still needed, reuses its search bootstrap and live TikTok signing program, skips comment requests for videos that report zero comments, and tries the lightweight comments API before loading a video page. Failed work is retried with a fresh session only when needed.

### 📤 Export TikTok videos and comments

Download the results as CSV or Excel for spreadsheets, or choose JSON and other formats when needed. The **Videos** table is best for content and activity research. The **Comments** table is best when you want to export social media comments for review.

You can also schedule repeat runs and connect results to other tools supported by Apify.

### 💳 Pricing

You pay for saved results. Each unique video is counted once, even if several searches find it. Comments are counted only when they are successfully saved. Repeated videos, failed comment attempts, and unavailable comments are not charged as results.

See the Actor's **Pricing** tab for current prices. Start with a small number of videos and leave comment collection off for your first test run.

### ❓ Frequently asked questions

#### Is it possible to scrape data from TikTok?

Yes. This Actor collects public TikTok videos that match your searches and can also collect their public comments. It does not access private profiles, private comments, direct messages, or other account-only information. You do not need to provide TikTok login details.

#### How can I extract data from TikTok?

Enter your topics, choose how many videos you need, and start the Actor. Open the Videos table when the run finishes. Turn on comment collection if you also need public comments, then open the Comments table. You can download either table for further work.

#### How to analyze competitor social media?

Search for competitor names, products, campaigns, and shared category terms in the same run. Compare which videos appear, their search positions, publish dates, and public activity. The Actor gathers the source information for your research; it does not create scores, judge sentiment, or make recommendations.

# Actor input Schema

## `searchQueries` (type: `array`):

Enter keywords or phrases exactly as you would search them on TikTok. Each query receives its own result limit.

## `maxVideosPerQuery` (type: `integer`):

Set the maximum number of videos to save for each query. Keep this low for your first run.

## `scrapeComments` (type: `boolean`):

Fetch public top-level comments for every video found by the search. Comments are saved inside each video row and are also available through the Comments dataset view.

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

Set the maximum number of public top-level comments to fetch for each discovered video. This value is used only when Scrape video comments is enabled.

## Actor input object example

```json
{
  "searchQueries": [
    "funny cats"
  ],
  "maxVideosPerQuery": 20,
  "scrapeComments": false,
  "maxComments": 50
}
```

# Actor output Schema

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

All normalized TikTok video search results.

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

One table row per scraped comment, with its source video and search query.

## `runSummary` (type: `string`):

Scrape totals, charged video/comment event counts, charge-limit status, and per-query failures for this run.

# 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 = {
    "searchQueries": [
        "funny cats"
    ],
    "maxVideosPerQuery": 20,
    "maxComments": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("devcake/tiktok-search-video-comments").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 = {
    "searchQueries": ["funny cats"],
    "maxVideosPerQuery": 20,
    "maxComments": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("devcake/tiktok-search-video-comments").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 '{
  "searchQueries": [
    "funny cats"
  ],
  "maxVideosPerQuery": 20,
  "maxComments": 50
}' |
apify call devcake/tiktok-search-video-comments --silent --output-dataset

```

## MCP server setup

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

```

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/2bLRdPmBL6qRmfWnq/builds/zU6s7aZqoKHnKpTze/openapi.json
