接口说明

TikTok Comments API 获取 TikTok 评论数据,支持接口列出的分页、排序或筛选参数。

使用 Pangolinfo API Key 调用,返回结构化 JSON 数据。

请求URL

POST https://scrapeapi.pangolinfo.com/api/v1/social/tiktok-comments

请求头

参数名参数值类型说明
Content-Typeapplication/jsonstring数据格式
AuthorizationBearer xxxstring认证凭证

采集最长约75秒,客户端超时建议设为90秒。

请求参数

参数必填类型说明
targetYesstring帖子链接; 也可直接传视频 id (纯数字)
optionsNoobject仅处理下列开放参数;未列出的字段忽略,内部参数不可覆盖。

options 参数说明

参数必填类型说明
maxPagesNointeger本次请求翻几页,默认 1,最大 5,按实际返回条数计费,更多数据用返回的游标续取
默认值: 1
最小值: 1
最大值: 5
cursorNostring续取评论: 上次输出的 pagination.comments.cursor (offset); 回复模式: 上次输出的 pagination.cursor (offset); 缺省从头
commentIdNostring回复模式: 主评论 id (评论输出的 nativeId)

仅处理本页列出的请求参数,其他字段忽略。分页游标原样传回,不编码、解码或转换格式。

每次默认1页,最多5页;页数必须为正整数,超过5按5处理。

提供非空commentId进入独立回复模式,按返回的直接回复计费;Facebook同时计入返回的嵌套回复。按本页cursor说明续取。

响应值

返回值类型说明
codeinteger状态码,0 表示成功
messagestring响应信息,成功时为 ok
pointCostnumber本次请求实际消耗的积点
dataobject返回数据,结构见下表
metaobject请求标识及耗时(毫秒)
billingobject计费条数、单价及规则版本

返回参数 data 说明

返回值类型说明
typestringcomments = 评论模式; replies = 回复模式 (传了 options.commentId)
可用值: [“comments”, “replies”]
commentsCountnumber | null评论模式: 评论总数
commentsobject[]评论模式: 评论, 与 tiktok-post 同形
commentIdstring回复模式: 父评论 id
replyCountnumber | null回复模式: 父评论的回复总数
repliesobject[]回复模式: 回复, 与评论 replys[] 同形
paginationobject评论模式: {comments: {cursor, hasMore}}; 回复模式: {cursor, hasMore}

data.comments[] 字段说明

返回值类型说明
timeTextobject | null评论时间 (text 为 ISO)
contentstring | null评论内容
likesnumber点赞数
avatarstring | null评论者头像
nicknamestring | null评论者昵称, 没有时用用户名
nativeIdstring评论 id; 回复模式传 options.commentId 用它
replyCountnumber回复数
profileUrlstring | null评论者主页
parentIdstring | null所属顶层评论 id; 顶层评论为 null
replyToReplyIdstring | null被回复的那条回复 id (楼中楼); 直接回复评论为 null
usernamestring | null评论者用户名 (@ 后面那段)
userIdstring | null评论者 id
secUidstring | null评论者 secUid
verifiedboolean评论者是否认证
languagestring | null评论语言代码 (un = 未识别)
isAuthorDiggedboolean作者是否点赞了这条评论
isPinnedboolean是否置顶
imagesstring[]评论图片链接
labelsany[]评论标签 (上游原样)
replysobject[]随评论附带的一级回复。

data.comments[].timeText 字段说明

返回值类型说明
textstring | null上游原始时间文本
valuenumber | null解析后的毫秒时间戳; 解析失败为 null

data.comments[].replys[] 字段说明

返回值类型说明
timeTextobject | null评论时间 (text 为 ISO)
contentstring | null评论内容
likesnumber点赞数
avatarstring | null评论者头像
nicknamestring | null评论者昵称, 没有时用用户名
nativeIdstring评论 id; 回复模式传 options.commentId 用它
replyCountnumber回复数
profileUrlstring | null评论者主页
parentIdstring | null所属顶层评论 id; 顶层评论为 null
replyToReplyIdstring | null被回复的那条回复 id (楼中楼); 直接回复评论为 null
usernamestring | null评论者用户名 (@ 后面那段)
userIdstring | null评论者 id
secUidstring | null评论者 secUid
verifiedboolean评论者是否认证
languagestring | null评论语言代码 (un = 未识别)
isAuthorDiggedboolean作者是否点赞了这条评论
isPinnedboolean是否置顶
imagesstring[]评论图片链接
labelsany[]评论标签 (上游原样)
replysany[]不再向下展开, 恒为空

data.replies[] 字段说明

返回值类型说明
timeTextobject | null评论时间 (text 为 ISO)
contentstring | null评论内容
likesnumber点赞数
avatarstring | null评论者头像
nicknamestring | null评论者昵称, 没有时用用户名
nativeIdstring评论 id; 回复模式传 options.commentId 用它
replyCountnumber回复数
profileUrlstring | null评论者主页
parentIdstring | null所属顶层评论 id; 顶层评论为 null
replyToReplyIdstring | null被回复的那条回复 id (楼中楼); 直接回复评论为 null
usernamestring | null评论者用户名 (@ 后面那段)
userIdstring | null评论者 id
secUidstring | null评论者 secUid
verifiedboolean评论者是否认证
languagestring | null评论语言代码 (un = 未识别)
isAuthorDiggedboolean作者是否点赞了这条评论
isPinnedboolean是否置顶
imagesstring[]评论图片链接
labelsany[]评论标签 (上游原样)
replysany[]不再向下展开, 恒为空

请求示例

curl --request POST \
  --url https://scrapeapi.pangolinfo.com/api/v1/social/tiktok-comments \
  --header 'Authorization: Bearer YOUR_PANGOLINFO_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "target": "https://www.tiktok.com/@scout2015/video/6718335390845095173"
}'

返回示例

下例截取实际响应中的首条列表记录,长文本与链接作了缩写;pointCost 为该次完整响应的实际费用。完整字段结构可在在线调试页查看。

{
  "code": 0,
  "message": "ok",
  "pointCost": 6.4,
  "data": {
    "type": "comments",
    "commentsCount": 5500,
    "comments": [
      {
        "timeText": {
          "text": "2019-07-27T13:35:22.000Z",
          "value": 1564234522000
        },
        "content": "Well it’s pretty easy...and obvious 😂 hlysa",
        "likes": 340,
        "avatar": "https://p19-common-sign.tiktokcdn-eu.com/tos-maliva-avt-0068/7328085019259748357~tplv-tiktokx-cropcenter:100:100.jpg?dr=10399&refresh_token=f7179828&x-expire...",
        "nickname": "Quit",
        "nativeId": "6718336105873702917",
        "replyCount": 50,
        "profileUrl": "https://www.tiktok.com/@pretzelsticks0",
        "replys": [],
        "parentId": null,
        "replyToReplyId": null,
        "username": "pretzelsticks0",
        "userId": "6627564337508761605",
        "secUid": "MS4wLjABAAAABCmZv8sEMzxVXCLVjoVUMYM465WA0BMplKB9c7y5WWXDpV0OykgbTV3qOf0Jbleg",
        "verified": false,
        "language": "un",
        "isAuthorDigged": true,
        "isPinned": false,
        "images": [],
        "labels": [
          "Liked by creator"
        ]
      }
    ],
    "pagination": {
      "comments": {
        "cursor": "0",
        "hasMore": true
      }
    }
  },
  "meta": {
    "requestId": "pg-audit-r1-tiktok-comments-1793954336215544200",
    "durationMs": 3224
  },
  "billing": {
    "unitPrice": 0.8,
    "ruleVersion": "social-primary-v2",
    "billedCount": 8,
    "pointCost": 6.4
  }
}

积点消耗说明

每条一级评论消耗 0.8 积点,附带回复免费。支持独立回复模式的接口按返回的直接回复条数计费,每条0.8积点,回复附带的下一层免费。

空结果、失败响应不扣费。同一响应中相同 ID 只计一次,独立调用和续页分别计费。详见 社媒评论 API 计费说明。

在线调试