TikTok Comments API: The Power-User Guide for Listening

Published on May 29, 2026

Comments are the richest layer of the TikTok graph. They carry sentiment, intent, complaints, language signals, and the social-proof metrics (likes, replies, pins) that filter what the algorithm and the audience consider important. For researchers, social listening platforms, and CX teams, a comment dataset is often more valuable than the video itself.

This guide walks through the /post-comments/ and /post-comment-replies/ endpoints exposed by TikLiveAPI, the exact response shape you should expect, and eight production recipes you can adapt for monitoring, ranking, spam triage, and complaint queues. All examples assume the base URL https://api.tikliveapi.com and authentication via the X-Api-Key header. If you do not have a key yet, register and verify your email for 100 free credits, then check pricing on the pricing page.

The endpoints you will use

Two endpoints carry the entire comment workflow. Both are documented in detail under the posts category and can be tried interactively in the playground.

/post-comments/

Returns the top-level comment thread for a single TikTok post.

  • Method: GET
  • Path: /post-comments/
  • Parameters: url (the public TikTok video URL), count (page size), cursor (pagination offset, integer starting at 0)
  • Top response key: comments (an array)

Each item in comments[] uses snake_case. The fields that matter for analysis are:

  • id - the comment identifier. Note that this is the id field, not cid. If you have looked at raw TikTok web responses before, you may have seen cid; the API normalizes this to id.
  • video_id - the post the comment belongs to, useful when you batch comments from many videos into one table.
  • text - the body of the comment.
  • digg_count - the number of likes the comment received.
  • reply_total - how many replies hang off this comment. Use this to decide whether to call /post-comment-replies/.
  • user - a nested object with snake_case fields (unique_id, sec_uid, and so on).

/post-comment-replies/

Returns the replies under a single comment. This is a separate call by design: most comments have zero replies, and forcing nested fetches would waste credits.

  • Method: GET
  • Path: /post-comment-replies/
  • Parameters: video_id, comment_id, count, cursor

You need both video_id and comment_id. You already have both: video_id comes from the parent comment item, and comment_id is the parent comment's id field.

Authentication

Send your key in the X-Api-Key header on every request. The proxy also accepts Authorization: Bearer for convenience, but stick with X-Api-Key in production scripts.

curl "https://api.tikliveapi.com/post-comments/?url=https://www.tiktok.com/@user/video/7000000000000000000&count=50&cursor=0" \
  -H "X-Api-Key: YOUR_API_KEY"

Recipe 1: Fetch every comment on a post

Paginate with cursor until the returned array shrinks below the page size you asked for, or until you hit a hard cap you set yourself. One request equals one credit, so cap aggressively on long-tail viral posts.

import requests

BASE = "https://api.tikliveapi.com"
HEADERS = {"X-Api-Key": "YOUR_API_KEY"}

def fetch_all_comments(post_url, page_size=50, max_pages=40):
    out, cursor = [], 0
    for _ in range(max_pages):
        r = requests.get(
            f"{BASE}/post-comments/",
            params={"url": post_url, "count": page_size, "cursor": cursor},
            headers=HEADERS, timeout=30,
        )
        r.raise_for_status()
        batch = r.json().get("comments", []) or []
        if not batch:
            break
        out.extend(batch)
        if len(batch) < page_size:
            break
        cursor += page_size
    return out

Recipe 2: Parallel replies via /post-comment-replies/

Once you have the top-level thread, only call replies for comments where reply_total > 0. Run those calls in parallel with a bounded worker pool so you do not stampede.

from concurrent.futures import ThreadPoolExecutor

def fetch_replies(video_id, comment_id, page_size=30):
    r = requests.get(
        f"{BASE}/post-comment-replies/",
        params={
            "video_id": video_id,
            "comment_id": comment_id,
            "count": page_size,
            "cursor": 0,
        },
        headers=HEADERS, timeout=30,
    )
    r.raise_for_status()
    return comment_id, r.json()

def hydrate_replies(comments, workers=8):
    targets = [(c["video_id"], c["id"]) for c in comments if c.get("reply_total", 0) > 0]
    with ThreadPoolExecutor(max_workers=workers) as pool:
        return dict(pool.map(lambda t: fetch_replies(*t), targets))

The dictionary is keyed by the parent comment's id, so you can splice the reply payload back onto the thread tree in one pass.

Recipe 3: Rank comments by social weight

A comment with high digg_count is socially endorsed. A comment with high reply_total is a conversation hotspot. Together they identify the messages that shape the perception of a post. A simple blended score works well as a first pass:

import math

def score(c):
    likes = c.get("digg_count", 0) or 0
    replies = c.get("reply_total", 0) or 0
    return math.log1p(likes) + 1.5 * math.log1p(replies)

ranked = sorted(comments, key=score, reverse=True)
top_20 = ranked[:20]

The logarithm compresses outliers and the 1.5 weighting on replies reflects the heavier signal of a sustained back-and-forth. Tune the weights against your own labeled set.

Recipe 4: Detect spam and promo comments

Spam on TikTok comments has three durable fingerprints: link or handle dumping, repeated character spans, and giveaway language. A cheap rule set catches most of it before you spend NLP cycles.

import re

PROMO = re.compile(r"\b(dm|giveaway|free\s+\w+|click\s+link|check\s+bio)\b", re.I)
HANDLE = re.compile(r"@[A-Za-z0-9_.]{3,}")
REPEAT = re.compile(r"(.)\1{4,}")

def spam_score(text):
    if not text:
        return 0
    s = 0
    s += 2 if PROMO.search(text) else 0
    s += len(HANDLE.findall(text))
    s += 1 if REPEAT.search(text) else 0
    s += 1 if text.count("http") >= 1 else 0
    return s

flagged = [c for c in comments if spam_score(c.get("text", "")) >= 3]

For accounts that need higher precision, layer this with a per-author repetition check: if the same user.unique_id posts near-identical text under many of your monitored videos, that is a strong spam signal.

Recipe 5: Language detection

TikTok is multilingual by default. If you are doing sentiment or topic modeling, route each comment to a language-specific pipeline. langdetect or fastText both work; fastText is faster on short text.

from langdetect import detect, DetectorFactory
DetectorFactory.seed = 0

def language_of(text):
    text = (text or "").strip()
    if len(text) < 4:
        return "unk"
    try:
        return detect(text)
    except Exception:
        return "unk"

by_lang = {}
for c in comments:
    lang = language_of(c.get("text"))
    by_lang.setdefault(lang, []).append(c)

Short comments are noisy for any detector, so the four-character floor keeps stickers and single emoji out of the buckets.

Recipe 6: Top complainers

For CX teams, the highest-value question is "which authors keep complaining". Group comments by user.unique_id, count how many of their comments cross a negativity threshold, and surface the top of that list. A small negative-cue lexicon does the job for triage; replace with a sentiment model when you have labeled data.

NEG = ("broken", "scam", "refund", "worst", "never again", "lied",
       "trash", "hate", "stolen", "fake", "doesn't work", "ripoff")

def is_complaint(text):
    t = (text or "").lower()
    return any(k in t for k in NEG)

from collections import Counter
counts = Counter()
for c in comments:
    if is_complaint(c.get("text", "")):
        u = (c.get("user") or {}).get("unique_id")
        if u:
            counts[u] += 1

top_complainers = counts.most_common(15)

Recipe 7: Time-of-day distribution

Most comment items carry a create_time Unix timestamp. Bucket by hour in the timezone of your audience to find when conversation peaks. This is the prep step for scheduling reply windows or moderator shifts.

from datetime import datetime, timezone
from zoneinfo import ZoneInfo

def hour_bucket(ts, tz="UTC"):
    return datetime.fromtimestamp(ts, tz=timezone.utc).astimezone(ZoneInfo(tz)).hour

hist = [0] * 24
for c in comments:
    ts = c.get("create_time")
    if ts:
        hist[hour_bucket(ts, "America/Los_Angeles")] += 1

If you operate across regions, run the bucketing per language cluster from Recipe 5 - the curve for Spanish-language comments rarely lines up with the English one.

Recipe 8: Build a complaint queue

Combine the previous recipes into one daily worker. The pattern: pull recent comments for each monitored post, filter for complaints with non-spam authors, rank by a blend of social weight and recency, and push the top N into your ticketing tool.

import time

def build_queue(post_urls, top_n=25):
    queue = []
    now = time.time()
    for url in post_urls:
        for c in fetch_all_comments(url, page_size=50, max_pages=10):
            if spam_score(c.get("text", "")) >= 3:
                continue
            if not is_complaint(c.get("text", "")):
                continue
            age_hours = max(1, (now - (c.get("create_time") or now)) / 3600)
            weight = score(c) / (age_hours ** 0.4)
            queue.append((weight, c))
    queue.sort(key=lambda x: x[0], reverse=True)
    return [c for _, c in queue[:top_n]]

The recency exponent of 0.4 keeps day-old viral complaints on the board without burying brand-new ones. Pin the queue's primary key to the comment id so deduping across runs is trivial.

A note on ethics and retention

Comment data is public, but the people who wrote it did not consent to indefinite storage in a private warehouse. A few habits keep you on the right side of platform policy and most privacy regimes:

  • Set a retention window. Ninety days is a common default for social listening; thirty days is plenty for active CX triage. Aggregate counts can live longer than raw text.
  • Honor deletions. If a comment disappears from TikTok between fetches, drop it from your store on the next sweep rather than keeping the cached copy alive.
  • Avoid building person-level profiles on top of unique_id unless you have a legitimate-interest assessment in place. Aggregate by author count, not by author identity.
  • Never re-publish raw comment text alongside personal identifiers in external reports. Quote sparingly and anonymize handles when you do.

The API gives you the data; you own the policy on top of it.

FAQ

Why is the comment identifier called id and not cid?

The raw TikTok web payload uses cid. The API normalizes this to id at the comments[] item level so it stays consistent with the rest of the surface. When you pass it to /post-comment-replies/, use the value of id as the comment_id parameter.

How do I page through replies?

Same shape as the parent endpoint: send count and increment cursor until a short page comes back. Most reply threads are small, so a single page of 30 usually clears the whole sub-thread.

Do I get a credit charged for empty pages?

Every successful request counts as one credit, including ones that return an empty array. Cap your loops and check the previous page's length before requesting the next.

Can I batch-fetch comments across many posts in one call?

No - /post-comments/ is single-post. To parallelize, wrap calls in a worker pool keyed by post URL, the same pattern as Recipe 2.

How fresh is the data?

Real-time, pulled directly from TikTok at request time. Reply counts and like counts will track live numbers within seconds of the platform updating them.

Where do I see the full schema?

The full field list and a runnable example live under documentation for posts. You can also try the endpoint with your own URL in the playground before writing any code.

What if I hit a wall on usage or billing?

Credits never expire, so you can buy in bulk without worrying about a clock. For volume quotes or integration questions, reach the team via contact.

That covers the eight recipes most teams reach for. Wire any subset of them into your existing pipeline and you have a working TikTok comment intelligence layer in an afternoon.

Build with the TikTok API

Ready to put what you read into code? Try our endpoints live or grab the full reference.

Open Playground Read Documentation