Apify TikTok Comment Scraper
/install apify-tiktok-comments
TikTok Comment Scraper with Apify
Extract comments and replies from TikTok video and photo posts. Supports both top-level comments and threaded replies. No login required.
Actor: futurizerush/tiktok-comment-scraper
Prerequisites
Set APIFY_API_TOKEN in environment. Get a token at console.apify.com/account/integrations.
Execution Flow
Apify runs are asynchronous. Every request follows 3 steps:
- Start a run -- POST to the actor API, receive a run ID and dataset ID
- Poll until done -- GET the run status, wait for
SUCCEEDED - Fetch results -- GET the dataset items (returns a JSON array)
Typical run time: 15-60 seconds depending on comment count.
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
videoUrls |
array of strings | Yes | TikTok post URLs (video, photo, or short links). Max 50, must be unique. |
maxCommentsPerVideo |
integer | No | Max top-level comments per post. Default: 100. Min: 1, Max: 5000 |
includeReplies |
boolean | No | Collect threaded replies. Default: true |
maxRepliesPerComment |
integer | No | Max replies per comment. Default: 50. Min: 1, Max: 500 |
Complete Example (Python)
import requests, os, time
TOKEN = os.environ["APIFY_API_TOKEN"]
BASE = "https://api.apify.com/v2"
# Step 1: Start the run
response = requests.post(
f"{BASE}/acts/futurizerush~tiktok-comment-scraper/runs?token={TOKEN}",
json={
"videoUrls": [
"https://www.tiktok.com/@bellapoarch/video/6862153058223197445"
],
"maxCommentsPerVideo": 20,
"includeReplies": True,
"maxRepliesPerComment": 10,
},
)
response.raise_for_status()
run = response.json()["data"]
run_id = run["id"]
dataset_id = run["defaultDatasetId"]
# Step 2: Poll until done
while True:
status = requests.get(
f"{BASE}/actor-runs/{run_id}?token={TOKEN}"
).json()["data"]["status"]
if status == "SUCCEEDED":
break
if status in ("FAILED", "ABORTED", "TIMED-OUT"):
raise RuntimeError(f"Run failed: {status}")
time.sleep(5)
# Step 3: Fetch results (JSON array)
items = requests.get(
f"{BASE}/datasets/{dataset_id}/items?token={TOKEN}"
).json()
# Separate comments from replies
for item in items:
prefix = " Reply" if item["isReply"] else "Comment"
print(f"{prefix} by @{item['username']}: {item['text'][:80]}")
print(f" likes={item['likeCount']} replies={item['replyCount']}")
Multiple videos
requests.post(
f"{BASE}/acts/futurizerush~tiktok-comment-scraper/runs?token={TOKEN}",
json={
"videoUrls": [
"https://www.tiktok.com/@bellapoarch/video/6862153058223197445",
"https://www.tiktok.com/@charlidamelio/video/EXAMPLE123",
],
"maxCommentsPerVideo": 50,
},
)
Complete Example (bash)
# Step 1: Start the run
RUN_RESPONSE=$(curl -s -X POST \
"https://api.apify.com/v2/acts/futurizerush~tiktok-comment-scraper/runs?token=$APIFY_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"videoUrls": ["https://www.tiktok.com/@bellapoarch/video/6862153058223197445"], "maxCommentsPerVideo": 20, "includeReplies": true}')
RUN_ID=$(echo "$RUN_RESPONSE" | jq -r '.data.id')
DATASET_ID=$(echo "$RUN_RESPONSE" | jq -r '.data.defaultDatasetId')
# Step 2: Poll until done
while true; do
STATUS=$(curl -s "https://api.apify.com/v2/actor-runs/$RUN_ID?token=$APIFY_API_TOKEN" \
| jq -r '.data.status')
[ "$STATUS" = "SUCCEEDED" ] && break
[ "$STATUS" = "FAILED" ] || [ "$STATUS" = "ABORTED" ] && echo "Failed: $STATUS" && exit 1
sleep 5
done
# Step 3: Fetch results
curl -s "https://api.apify.com/v2/datasets/$DATASET_ID/items?token=$APIFY_API_TOKEN" | jq '.'
Output Format
Each item in the results array (field names verified from real API output on 2026-04-11):
Comment item:
{
"commentId": "7604380245148189453",
"text": "It happened, Leah Healton got more likes.",
"createTime": "2026-02-08T06:39:49.000Z",
"likeCount": 160671,
"replyCount": 0,
"isPinned": false,
"isAuthorLiked": false,
"userId": "7189081523688309806",
"username": "kdarr1013",
"nickname": "レイヴン",
"avatarUrl": "https://p16-common-sign.tiktokcdn-us.com/...",
"profileUrl": "https://www.tiktok.com/@kdarr1013",
"isVerified": false,
"parentCommentId": null,
"isReply": false,
"videoId": "6862153058223197445",
"videoUrl": "https://www.tiktok.com/@bellapoarch/video/6862153058223197445",
"collectedAt": "2026-04-11T06:07:23.985Z"
}
Reply item (same fields, different values):
{
"commentId": "7192662943740297989",
"text": "Hi! I'm from 2023",
"parentCommentId": "6941063376386686982",
"isReply": true,
"likeCount": 1182,
"replyCount": 0
}
Note: Field names use camelCase. Distinguish comments from replies using isReply. Replies have a non-null parentCommentId linking them to the parent comment.
Error Handling
| Error | Cause | Fix |
|---|---|---|
| 401 Unauthorized | Invalid or missing API token | Check APIFY_API_TOKEN |
FAILED: "post(s) appear unavailable or private" |
Video is private or deleted | Verify the video URL is public |
| No results | Video has comments disabled | Try a different video |
Tips
- Use
isReply: falseto filter top-level comments only. - Use
parentCommentIdto reconstruct comment threads. - Use
isPinned: trueto find creator-pinned comments. - Use
isAuthorLiked: trueto find comments the creator liked. - Supports video posts, photo posts, and short links (vm.tiktok.com).
- URLs must be unique (no duplicates allowed).
- No login or session ID required.
Links
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install apify-tiktok-comments - 安装完成后,直接呼叫该 Skill 的名称或使用
/apify-tiktok-comments触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Apify TikTok Comment Scraper 是什么?
This skill should be used when the user asks to "scrape TikTok comments", "get TikTok post comments", "extract comments from a TikTok video", "get TikTok rep... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 100 次。
如何安装 Apify TikTok Comment Scraper?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install apify-tiktok-comments」即可一键安装,无需额外配置。
Apify TikTok Comment Scraper 是免费的吗?
是的,Apify TikTok Comment Scraper 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Apify TikTok Comment Scraper 支持哪些平台?
Apify TikTok Comment Scraper 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Apify TikTok Comment Scraper?
由 Futurize Rush(@futurizerush)开发并维护,当前版本 v0.1.0。