api-config.json 7.0 KB

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