TikTok comments API
Top-level comments on a TikTok video, 20 a page in TikTok’s order, with likes, reply counts and the commenter, as TikTok’s comment JSON.
GET /v1/tiktok/videos/{id}/comments1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/tiktok/videos/7707446852798549279/comments",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "comments": [ { "cid": "7707656405906162445", "aweme_id": "7707446852798549279", "text": "What cut of steak did you use?", "create_time": 1794578691, "digg_count": 2579, "reply_comment_total": 29, "reply_id": "0", "user": { "uid": "7509611577361105966", "unique_id": "jessica_helfer", "nickname": "Jessica Helfer", "sec_uid": "MS4wLjABAAAA7XftEgH_tVrthOlClHTEq9jLHidIQmeAi96PJUKR2rS2aQUAPsyaEQ3LnBVf8MhU", "account_labels": null, "ad_cover_url": null, "advance_feature_item_order": null, "advanced_feature_info": null, "avatar_thumb": { "uri": "tos-useast8-avt-0068-tx2/18e18c6969a22924ce7dc5bb63c22bf6", "url_list": [ "…" ], "url_prefix": null }, "bold_fields": null, "can_message_follow_status_list": null, "can_set_geofencing": null, "cha_list": null, "cover_url": null, "…": "17 more fields" }, "comment_language": "en", "is_author_digged": false, "author_pin": false, "allow_download_photo": true, "collect_stat": 0, "comment_post_item_ids": null, "…": "25 more fields" }, { "cid": "7707556469470167839", "aweme_id": "7707446852798549279", "text": "this with broccoli 😻", "create_time": 1794555420, "digg_count": 5277, "reply_comment_total": 6, "reply_id": "0", "user": { "uid": "6925204018239423494", "unique_id": "neiaiko", "nickname": "️", "sec_uid": "MS4wLjABAAAAEo1OPo8CphE2eSfko8lzW0EfSFPmJBGkkYNI7RlwtaKZyZ0_luvXgJmxhYAGrfbM", "account_labels": null, "ad_cover_url": null, "advance_feature_item_order": null, "advanced_feature_info": null, "avatar_thumb": { "uri": "tos-useast8-avt-0068-tx2/ed7196c0669bb6debe0de857aec546ad", "url_list": [ "…" ], "url_prefix": null }, "bold_fields": null, "can_message_follow_status_list": null, "can_set_geofencing": null, "cha_list": null, "cover_url": null, "…": "17 more fields" }, "comment_language": "en", "is_author_digged": true, "author_pin": false, "allow_download_photo": true, "collect_stat": 0, "comment_post_item_ids": null, "…": "25 more fields" } ], "cursor": "20", "has_more": true, "total": 935}Parameters
| Name | Type | Description |
|---|---|---|
idpath · required | string | A video (or photo post) id, or its URL (www.tiktok.com/@user/video/<id>). Example: 7707446852798549279. |
cursorquery | string | The previous page’s cursor, for the next page. Omit for the first. |
Response fields
200 with a TikTokCommentsResponse, in TikTok’s own web JSON (itemStruct, userInfo, comments).
| Field | Type | Description |
|---|---|---|
comments | TikTokComment[] | |
cursor | string | Pass as cursor for the next page. |
has_more | boolean | |
total | number |
Status codes
| Status | Meaning |
|---|---|
200 | A page of comments, with total. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | The account, video, comment, hashtag or sound does not exist on TikTok, or was removed. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | TikTok is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
TikTok is a trademark of ByteDance Ltd. We are not affiliated with or endorsed by TikTok or ByteDance.