api-config.json 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. {
  2. "name": "tiktok-video-comments",
  3. "displayName": "TikTok 视频评论查询",
  4. "description": "获取指定 TikTok 视频的用户评论列表,支持翻页。用户评论是 VOC 情感分析、痛点挖掘、需求发现的核心英文数据源。适用于品类用户评价采集、竞品带货视频反馈分析。",
  5. "category": "social-media",
  6. "version": "1.3.0",
  7. "endpoint": {
  8. "method": "GET",
  9. "url": "https://server.fmode.cn/api/voc-social/tiktok/app/v3/fetch_video_comments",
  10. "headers": {
  11. "Authorization": "Bearer ${vocToken}",
  12. "Accept": "application/json"
  13. }
  14. },
  15. "parameters": {
  16. "type": "object",
  17. "required": [
  18. "aweme_id"
  19. ],
  20. "properties": {
  21. "aweme_id": {
  22. "type": "string",
  23. "description": "TikTok 视频唯一 ID"
  24. },
  25. "count": {
  26. "type": "integer",
  27. "description": "每页评论数量",
  28. "default": 20,
  29. "maximum": 50
  30. },
  31. "cursor": {
  32. "type": "integer",
  33. "description": "分页游标,首次不传或传 0",
  34. "default": 0
  35. }
  36. }
  37. },
  38. "requestTransform": {
  39. "queryParams": {
  40. "aweme_id": "{{aweme_id}}",
  41. "count": "{{count}}",
  42. "cursor": "{{cursor}}"
  43. }
  44. },
  45. "response": {
  46. "type": "object",
  47. "description": "评论列表",
  48. "properties": {
  49. "comments": {
  50. "type": "array",
  51. "items": {
  52. "type": "object",
  53. "properties": {
  54. "cid": {
  55. "type": "string",
  56. "description": "评论 ID"
  57. },
  58. "text": {
  59. "type": "string",
  60. "description": "评论内容"
  61. },
  62. "digg_count": {
  63. "type": "integer",
  64. "description": "评论点赞数"
  65. },
  66. "reply_comment_total": {
  67. "type": "integer",
  68. "description": "回复数"
  69. },
  70. "create_time": {
  71. "type": "integer",
  72. "description": "评论时间戳"
  73. },
  74. "user": {
  75. "type": "object",
  76. "properties": {
  77. "nickname": {
  78. "type": "string",
  79. "description": "评论者昵称"
  80. },
  81. "unique_id": {
  82. "type": "string",
  83. "description": "评论者用户名"
  84. }
  85. }
  86. }
  87. }
  88. }
  89. },
  90. "has_more": {
  91. "type": "boolean",
  92. "description": "是否有更多评论"
  93. },
  94. "cursor": {
  95. "type": "integer",
  96. "description": "下一页游标"
  97. },
  98. "total": {
  99. "type": "integer",
  100. "description": "评论总数"
  101. }
  102. }
  103. },
  104. "usageExamples": [
  105. {
  106. "name": "爆款视频用户声音采集",
  107. "input": {
  108. "aweme_id": "7300000000000000000",
  109. "count": 20,
  110. "cursor": 0
  111. },
  112. "description": "获取爆款视频前 20 条评论,提取用户对产品的真实英文评价"
  113. },
  114. {
  115. "name": "翻页采集更多评论",
  116. "input": {
  117. "aweme_id": "7300000000000000000",
  118. "count": 20,
  119. "cursor": 20
  120. },
  121. "description": "用上次返回的 cursor 翻页,累计采集更多用户评论"
  122. }
  123. ],
  124. "workflow": {
  125. "description": "推荐调用链",
  126. "steps": [
  127. "上游: tiktok-video-search(keyword) → 找到高播放量视频 → 取 aweme_id",
  128. "上游: tiktok-video-detail(aweme_id) → 确认视频数据规模",
  129. "本步: tiktok-video-comments(aweme_id) → 批量采集英文用户评论",
  130. "分析: 对评论内容做情感分类和痛点关键词提取"
  131. ]
  132. },
  133. "reportMapping": {
  134. "slides": [
  135. "社媒聆听(Slide14)"
  136. ],
  137. "dataPoints": [
  138. "用户痛点英文关键词",
  139. "正向/负向情感分布",
  140. "评论点赞数(热评识别)",
  141. "用户购买意向信号"
  142. ]
  143. },
  144. "timeout": 60000,
  145. "retry": {
  146. "maxAttempts": 3,
  147. "delay": 1500,
  148. "backoffMultiplier": 2
  149. },
  150. "tokenConfig": {
  151. "type": "bearer",
  152. "configFile": "~/.openclaw/voc-credentials.json",
  153. "tokenField": "vocToken",
  154. "resolutionOrder": [
  155. "configFile"
  156. ],
  157. "apigId": "Vo3ROWEvDy",
  158. "paymentUrlResolution": {
  159. "description": "动态构建充值URL:在已存在 session token 时查出用户 objectId,拼接到专属充值页面",
  160. "steps": [
  161. "1. 从 voc-credentials.json 获取当前 session token",
  162. "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
  163. "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  164. "4. 将该URL展示给用户,引导扫码支付"
  165. ],
  166. "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
  167. "userResolveHeaders": {
  168. "X-Parse-Application-Id": "ncloudmaster",
  169. "X-Parse-Session-Token": "{vocToken}"
  170. },
  171. "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/",
  172. "paymentParams": {
  173. "user": "{resolvedUserId}",
  174. "apigid": "Vo3ROWEvDy",
  175. "fun_id": "HOkkX72PMF"
  176. },
  177. "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
  178. },
  179. "onMissing": {
  180. "action": "showPaymentQR",
  181. "qrCodeUrl": "https://app.fmode.cn/dev/apig-pay/?apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  182. "title": "扫码开通 VOC-AI 数据服务",
  183. "message": "此 Skill 需要有效的 API Token。请先打开充值页面完成登录和充值;当用户提供 session token 后,请由 OpenClaw 运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json 的 vocToken 字段,再重试当前 Skill。",
  184. "tokenSetupCommandTemplate": "node scripts/tools/set-voc-token.js {sessionToken}",
  185. "tokenSetupInstructions": "当用户完成登录和充值后,如果用户把 session token 发给你,请直接运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json,然后重试当前 Skill。"
  186. },
  187. "onBalanceInsufficient": {
  188. "action": "resolveUserThenShowPayment",
  189. "title": "VOC-AI Token 余额不足,请扫码充值",
  190. "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
  191. }
  192. },
  193. "errorHandling": {
  194. "balanceInsufficient": {
  195. "conditions": [
  196. {
  197. "responseField": "code",
  198. "operator": "in",
  199. "value": [
  200. -2,
  201. -3,
  202. -10,
  203. 402,
  204. 429
  205. ]
  206. },
  207. {
  208. "responseField": "msg",
  209. "operator": "contains",
  210. "value": [
  211. "余额不足",
  212. "insufficient",
  213. "balance",
  214. "quota",
  215. "没有开通",
  216. "权限或余额"
  217. ]
  218. },
  219. {
  220. "responseField": "mess",
  221. "operator": "contains",
  222. "value": [
  223. "余额不足",
  224. "insufficient",
  225. "balance",
  226. "quota",
  227. "没有开通",
  228. "权限或余额"
  229. ]
  230. },
  231. {
  232. "responseField": "message",
  233. "operator": "contains",
  234. "value": [
  235. "余额不足",
  236. "insufficient",
  237. "balance",
  238. "没有开通",
  239. "权限或余额"
  240. ]
  241. }
  242. ],
  243. "matchMode": "any",
  244. "trigger": "tokenConfig.onBalanceInsufficient"
  245. },
  246. "unauthorized": {
  247. "conditions": [
  248. {
  249. "responseField": "code",
  250. "operator": "in",
  251. "value": [
  252. 401,
  253. 403
  254. ]
  255. },
  256. {
  257. "responseField": "msg",
  258. "operator": "contains",
  259. "value": [
  260. "unauthorized",
  261. "token",
  262. "invalid",
  263. "auth"
  264. ]
  265. }
  266. ],
  267. "matchMode": "any",
  268. "trigger": "tokenConfig.onMissing"
  269. }
  270. }
  271. }