Finewisdom API Hub
Home › Use cases › Douyin comments sentiment analysis

Douyin comments API for sentiment analysis: which endpoints, what it costs

Three endpoints are enough: douyin_keyword_search finds videos, douyin_video_comments pulls the comments, douyin_video_detail adds engagement so you know which videos are worth pulling. ¥0.1–0.2 per call, failed calls are never charged. 500 videos × 6 comment pages ≈ ¥700.

Get 20 free callsAll 102 endpoints

Which endpoints to call

EndpointPriceCallsSubtotalPurpose
douyin_keyword_search¥0.1×1¥0.1Find candidate videos by keyword; returns aweme_id
douyin_video_detail¥0.1×1¥0.1Engagement metrics, to decide which videos are worth comments
douyin_video_comments¥0.2×6¥1.2Pull comments by aweme_id (cursor is page)
per video (1 search + 1 detail + 6 comment pages)¥1.4per full run
500 videos¥700500 × ¥1.4

Working code skeleton

Runs as-is once you set TOKEN. Failed and empty calls are skipped, so they cost nothing.

import time, requests

TOKEN, API = "fw_xxx", "https://finewisdom.top/api"

def call(method, **params):
    r = requests.get(API, params={"token": TOKEN, "method": method, **params}, timeout=60).json()
    if r.get("status") != "success":
        print("skip:", method, r.get("message"))   # failed calls are not charged
        return None
    return r["data"]

def comments_of(aweme_id, max_pages=6):
    out = []
    for page in range(max_pages):
        d = call("douyin_video_comments", aweme_id=aweme_id, page=page)
        if not d:
            break
        batch = d.get("comments") or d.get("list") or []
        if not batch:
            break            # empty result is free, stop early
        out.extend(batch)
        time.sleep(1.1)      # rate limit is 1 request/second
    return out

def run(keyword):
    found = call("douyin_keyword_search", keyword=keyword, page=0)
    videos = found.get("list") or found.get("aweme_list") or []
    rows = []
    for v in videos[:500]:
        aid = v.get("aweme_id")
        detail = call("douyin_video_detail", aweme_id=aid)
        rows.extend({
            "keyword": keyword,
            "aweme_id": aid,
            "like": (detail or {}).get("like") or v.get("like"),
            "text": c.get("text") or c.get("content"),
        } for c in comments_of(aid))
    return rows

Gotchas worth knowing

FAQ

Can I pull all comments for a keyword directly?

No. You search first to get content IDs, then pull comments by ID. The comment endpoint takes a content ID — there is no keyword-to-comments shortcut.

Why call the detail endpoint first?

Detail returns likes/comments/plays, which lets you skip low-value videos before spending money on comment pages. That typically halves the bill.

Related endpoints

douyin_keyword_searchParameters, price and examplesdouyin_video_commentsParameters, price and examplesdouyin_video_detailParameters, price and examplesdouyin_author_infoParameters, price and examplesdouyin_video_play_countParameters, price and examples