What a TikTok comment scraper does
A TikTok comment scraper collects the comments under a video, with who wrote them, when, and how many likes and replies each got, and saves them somewhere you can work with them: a CSV file, a spreadsheet or a database. TikTok’s app has no export button, and copying comments by hand stops being realistic after the first screen.
People scrape TikTok comments for very different reasons: a brand reading what customers say about a product, a creator picking a giveaway winner, a seller looking for buying questions to answer, a researcher studying how a topic is discussed, or a moderation team watching for spam. This guide covers each of those with working code.
What you get for each comment
| Field | What it is |
|---|---|
cid | The comment ID. Use it to fetch replies and to avoid duplicates |
text | The comment text, with emoji and @mentions as typed |
user.unique_id, user.nickname | The commenter’s @username and display name |
user.uid, user.sec_uid | Stable account IDs, useful if usernames change |
digg_count | Likes on the comment |
reply_comment_total | How many replies it has |
create_time | When it was posted, as Unix seconds |
comment_language | The language TikTok detected, such as en or es |
author_pin | Whether the video’s creator pinned it |
Each page also returns total, the comment count TikTok reports for the video, plus cursor and has_more for pagination.
Step by step
- 1Get the video ID
Copy the video link. The long number after
/video/is theaweme_id. Short links work too: pass them asurland they are resolved for you. - 2Fetch the first page
GET
/v1/video/comments?aweme_id=…&count=50. Read the comments fromraw_comments. - 3Follow the cursor
Send the
cursorback untilhas_moreis false. Passsort_strategy=newto read newest first. - 4Add replies
For comments with replies, call
/v1/video/comments/replieswith the video ID and the comment’scid. - 5Save it
Write rows to CSV, a Google Sheet or your database, keyed on
cidso re-runs never duplicate.
GET /v1/video/comments · 1 req per call| Parameter | Type | Required | What it does |
|---|---|---|---|
aweme_id | string | aweme_id or url | The numeric video ID. e.g. 7693184538704416031 |
url | string | aweme_id or url | A share link instead of an aweme_id: tiktok.com, vm.tiktok.com or vt.tiktok.com. |
cursor | string | No | The cursor from the previous page. Omit it for the first page. |
count | integer | No | Items per page. e.g. 20 |
sort_strategy | string | No | hot or new. e.g. hot |
import { TikUltra } from 'tikultra'
const client = new TikUltra({ apiKey: process.env.TIKULTRA_KEY })
const res = await client.video.comments({ aweme_id: '7693184538704416031' })
console.log(res.data)Export every comment to CSV
This script exports all comments and their replies from one video into a CSV that Excel, Numbers and Google Sheets open directly. Install the SDK with pip install tikultra and set TIKULTRA_KEY first.
import csv, sys
from datetime import datetime, timezone
from tikultra import TikUltra
client = TikUltra()
video = sys.argv[1] # a link or an aweme_id
aweme_id = client.resolve(video)["aweme_id"] if not video.isdigit() else video
def row(c, parent=""):
return {
"cid": c["cid"],
"parent_cid": parent,
"username": c["user"]["unique_id"],
"text": c["text"],
"likes": c.get("digg_count", 0),
"replies": c.get("reply_comment_total", 0),
"language": c.get("comment_language", ""),
"posted": datetime.fromtimestamp(c.get("create_time", 0), tz=timezone.utc).isoformat(),
}
rows = []
for page in client.paginate("/v1/video/comments", params={"aweme_id": aweme_id, "count": 50}):
for c in page["raw_comments"]:
rows.append(row(c))
if c.get("reply_comment_total"):
for rp in client.paginate("/v1/video/comments/replies",
params={"aweme_id": aweme_id, "comment_id": c["cid"], "count": 50}):
rows += [row(r, c["cid"]) for r in rp["replies"]]
with open(f"comments_{aweme_id}.csv", "w", newline="", encoding="utf-8-sig") as f:
w = csv.DictWriter(f, fieldnames=rows[0].keys())
w.writeheader()
w.writerows(rows)
print(len(rows), "comments and replies saved")Two details matter here. utf-8-sig writes a byte-order mark so Excel shows emoji and non-Latin text correctly instead of garbled characters. And parent_cid keeps the thread structure, so you can rebuild conversations later or filter to top-level comments only.
Export to Google Sheets without code
If your team lives in spreadsheets, Google Apps Script can pull comments straight into a sheet. Open a sheet, choose Extensions → Apps Script, paste the function below, save your key under Project Settings → Script properties as TIKULTRA_KEY, and run it.
function exportTikTokComments() {
const KEY = PropertiesService.getScriptProperties().getProperty('TIKULTRA_KEY');
const AWEME_ID = '7693184538704416031'; // the number after /video/ in the link
const sheet = SpreadsheetApp.getActiveSheet();
sheet.clear();
sheet.appendRow(['cid', 'username', 'text', 'likes', 'replies', 'posted']);
let cursor = '';
for (let i = 0; i < 200; i++) {
const url = 'https://api.tikultra.com/v1/video/comments?count=50&aweme_id=' + AWEME_ID +
(cursor ? '&cursor=' + encodeURIComponent(cursor) : '');
const res = JSON.parse(UrlFetchApp.fetch(url, { headers: { 'x-api-key': KEY } }).getContentText());
const rows = res.raw_comments.map((c) => [
c.cid, c.user.unique_id, c.text, c.digg_count || 0, c.reply_comment_total || 0,
new Date((c.create_time || 0) * 1000),
]);
if (rows.length) sheet.getRange(sheet.getLastRow() + 1, 1, rows.length, rows[0].length).setValues(rows);
if (!res.has_more || !res.cursor) break;
cursor = res.cursor;
}
}The same request works in Make, Zapier and n8n: add an HTTP step, set the x-api-key header, and map raw_comments into rows. Spreadsheet scripts and automations hit time limits after a few thousand comments, so use the Python export for big videos.
Pick a giveaway winner from comments
“Comment to win” is one of the most common TikTok promotions, and picking fairly by scrolling is impossible on a busy video. Export the comments, keep one entry per person, apply your rules, and draw at random:
import random, re
KEYWORD = "giveaway" # what entrants had to comment
MIN_MENTIONS = 1 # e.g. "tag a friend"
entries = {}
for page in client.paginate("/v1/video/comments", params={"aweme_id": aweme_id, "count": 50}):
for c in page["raw_comments"]:
text = c["text"].lower()
if KEYWORD in text and len(re.findall(r"@\w", text)) >= MIN_MENTIONS:
entries.setdefault(c["user"]["unique_id"], c["text"]) # one entry per person
winner = random.SystemRandom().choice(sorted(entries))
print(f"{len(entries)} valid entries. Winner: @{winner}: {entries[winner]}")Record the entry count and the winner’s comment so you can show the draw was fair. If your rules require following the account, check the winner against your follower list with the follower scraper before announcing.
Find buying questions and leads
On product videos, the comments that matter most are questions: “where can I buy this”, “does it ship to Canada”, “what size is she wearing”. /v1/video/comment-leads reads a video’s comments and returns the questions and purchase-intent comments already structured, so you can answer them first or route them to sales. It costs 3 reqs and is on Every plan.
If you would rather classify comments yourself, a simple keyword pass catches most of them:
INTENT = ("where", "how much", "price", "link", "buy", "ship", "size", "discount", "code", "?")
questions = [r for r in rows if any(k in r["text"].lower() for k in INTENT)]
questions.sort(key=lambda r: r["likes"], reverse=True) # most-liked questions first
for q in questions[:25]:
print(q["likes"], q["username"], q["text"])For sentiment and topics at scale, send batches of comment text to a language model with a short instruction (“label each comment positive, negative or neutral and give its main topic”). Keep the cid with each label so you can join the results back.
Analyze what people are saying
Once comments are in a CSV, a few lines of pandas answer the usual questions: which comments got the most likes, how fast comments came in after posting, which words and languages dominate.
import pandas as pd
df = pd.read_csv("comments_7693184538704416031.csv", parse_dates=["posted"])
top = df[df.parent_cid.isna()]
print(top.nlargest(10, "likes")[["username", "likes", "text"]]) # most-liked comments
print(df.set_index("posted").resample("1h").size().head(48)) # comments per hour
print(df["language"].value_counts().head(10)) # commenters' languages
STOP = {"the", "and", "you", "this", "that", "for", "are", "with", "your", "its"}
words = df["text"].str.lower().str.findall(r"[a-z']{3,}").explode()
print(words[~words.isin(STOP)].value_counts().head(30)) # most common wordsComment velocity is worth watching. Most comments on a video arrive in its first hours, so a second wave days later usually means the video reached a new audience, often through a duet, a stitch or a search spike.
Scrape comments from a whole channel
To study a brand or a creator rather than one video, loop over their recent posts and export comments from each. Ten pages per video covers the top 500 comments, which is where nearly all the likes and replies are.
posts = []
for page in client.paginate("/v1/user/posts", params={"username": "somebrand", "count": 50}, max_pages=2):
posts += page["items"] # the 100 most recent videos
all_rows = []
for p in posts:
for page in client.paginate("/v1/video/comments",
params={"aweme_id": p["aweme_id"], "count": 50}, max_pages=10):
all_rows += [{"aweme_id": p["aweme_id"], **row(c)} for c in page["raw_comments"]]
print(len(all_rows), "comments across", len(posts), "videos")For hundreds of videos, a batch job (POST /v1/jobs/submit) fetches the first page of comments for up to 500 videos in one submission and calls your webhook when it is done.
Monitor comments on your own videos
Brands and creators often need to see new comments across all their recent videos without opening the app. Pull your latest posts, then read each video’s comments newest first and stop at the last cid you already have. Checking 30 recent videos every 6 hours is about 3,600 requests a month, $3.27 on Growth.
posts = client.user.posts("yourbrand", count=30)["items"]
for p in posts:
page = client.video.comments(p["aweme_id"], sort_strategy="new", count=50)
for c in page["raw_comments"]:
if c["cid"] in already_seen: # your database
break
already_seen.add(c["cid"])
handle_new_comment(p, c)To reply to or remove comments on your own videos from code, connect the account as a managed account: /v1/account/comment posts replies and /v1/account/comment/delete removes spam. The comment moderation guide and auto reply guide build that out.
Other comment endpoints
What it costs
A page of up to 50 comments is 1 req. A page of replies is the same. A video with 5,000 comments takes about 100 pages: 100 requests, $0.09 on Growth. Replies add pages only for comments that have them.
| Plan | Monthly price | Requests included | Per 1,000 calls | Rate limit |
|---|---|---|---|---|
| Starter | $49 | 40,000 | $1.22 | 20 req/s |
| Growth | $159 | 175,000 | $0.91 | 75 req/s |
| Scale | $499 | 750,000 | $0.67 | 250 req/s |
Errors and limits
A 404 means the video was deleted, made private or is not available in that region. Videos with comments turned off have no comments to return. Retry 429, 502 and 504 with a short backoff; failed calls are never billed. Your plan’s requests per second set the speed: Growth reads 75 pages a second, which is up to 3,750 comments a second.
| Status | Code | Meaning | Retry? |
|---|---|---|---|
| 400 | invalid_request | A parameter is missing or malformed. | No. Fix the request. |
| 401 | unauthorized | The key is missing, wrong or revoked. | No. |
| 402 | out_of_credits | Your balance can’t cover this call. | After a top-up. |
| 403 | forbidden | Your plan doesn’t include this endpoint. | No. Upgrade. |
| 404 | not_found | The video, profile or product doesn’t exist or isn’t visible. | No. |
| 409 | session_expired | A connected account needs to sign in again. | After re-connecting. |
| 429 | rate_limited | Over your plan’s requests per second. | Yes, after retry-after. |
| 502 | upstream_error | TikTok returned an error after our retries. | Yes, with backoff. |
| 504 | upstream_timeout | TikTok didn’t answer in time. | Yes, with backoff. |
Comment scraper options compared
| Option | How you use it | Pricing | Good for |
|---|---|---|---|
| Tikultra API | Code, Zapier or n8n via HTTP | Per request, from $49/month; 500 free requests | Repeated exports, many videos, pipelines and apps |
| ExportComments.com | Paste a link on a website | Per export, with comment caps by plan | One-off exports without code |
| Apify comment actors | Run an actor, download the dataset | Per result or compute | Batch exports inside Apify workflows |
| Browser extensions | Scroll the video in your browser | Free or one-off | Small videos; slow and breaks on long threads |
| Copying by hand | Scroll and copy | Free | A few dozen comments |
Is scraping TikTok comments allowed?
Comments on public videos are public, and reading them is lawful in many places. But comments are personal data: they carry usernames and opinions, so privacy laws such as the GDPR apply to what you store and how you use it. Keep only what you need, do not use comments to contact people who never contacted you, and be careful with anything about minors. Tikultra only reads comments on public videos; comments on private videos stay private.