api-config.json 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. {
  2. "name": "tiktok-user-posts",
  3. "displayName": "TikTok 用户作品列表",
  4. "description": "获取指定 TikTok 用户发布的视频列表,包括播放量、点赞、评论等数据。适用于竞品品牌内容策略分析、KOL 年度内容表现评估、达人带货说服力分析。",
  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_user_post_videos",
  10. "headers": {
  11. "Authorization": "Bearer r:a5a19ea9868043b15d9b10423234ca43",
  12. "Accept": "application/json"
  13. }
  14. },
  15. "parameters": {
  16. "type": "object",
  17. "required": [
  18. "sec_user_id"
  19. ],
  20. "properties": {
  21. "sec_user_id": {
  22. "type": "string",
  23. "description": "用户的安全 ID(secUid),需先通过 tiktok_user_profile 接口获取"
  24. },
  25. "count": {
  26. "type": "integer",
  27. "description": "每页视频数量",
  28. "default": 20,
  29. "maximum": 30
  30. },
  31. "cursor": {
  32. "type": "integer",
  33. "description": "分页游标",
  34. "default": 0
  35. }
  36. }
  37. },
  38. "requestTransform": {
  39. "queryParams": {
  40. "sec_user_id": "{{sec_user_id}}",
  41. "count": "{{count}}",
  42. "cursor": "{{cursor}}"
  43. }
  44. },
  45. "response": {
  46. "type": "object",
  47. "description": "用户视频列表",
  48. "properties": {
  49. "aweme_list": {
  50. "type": "array",
  51. "items": {
  52. "type": "object",
  53. "properties": {
  54. "aweme_id": {
  55. "type": "string",
  56. "description": "视频 ID"
  57. },
  58. "desc": {
  59. "type": "string",
  60. "description": "视频描述"
  61. },
  62. "statistics": {
  63. "type": "object",
  64. "properties": {
  65. "play_count": {
  66. "type": "integer"
  67. },
  68. "digg_count": {
  69. "type": "integer"
  70. },
  71. "comment_count": {
  72. "type": "integer"
  73. },
  74. "share_count": {
  75. "type": "integer"
  76. }
  77. }
  78. },
  79. "create_time": {
  80. "type": "integer",
  81. "description": "发布时间戳"
  82. }
  83. }
  84. }
  85. },
  86. "has_more": {
  87. "type": "boolean"
  88. },
  89. "cursor": {
  90. "type": "integer"
  91. }
  92. }
  93. },
  94. "notes": "sec_user_id 需先通过 tiktok-user-profile 获取 secUid 字段。",
  95. "relatedSkills": [
  96. "tiktok-user-profile"
  97. ],
  98. "usageExamples": [
  99. {
  100. "name": "竞品品牌内容策略分析",
  101. "input": {
  102. "sec_user_id": "MS4wLjABAAAA...",
  103. "count": 20,
  104. "cursor": 0
  105. },
  106. "description": "获取竞品品牌最近 20 条视频,分析发布频率、内容主题、平均播放量"
  107. },
  108. {
  109. "name": "KOL 常青带货说服力分析",
  110. "input": {
  111. "sec_user_id": "达人 secUid",
  112. "count": 30,
  113. "cursor": 0
  114. },
  115. "description": "获取达人近期 30 条视频,分析常青内容的平均播放量和带货说服力"
  116. }
  117. ],
  118. "workflow": {
  119. "description": "推荐调用链",
  120. "steps": [
  121. "上游: tiktok-user-search(keyword) → 搜索达人 → 取 uniqueId",
  122. "上游: tiktok-user-profile(uniqueId) → 获取 secUid 字段",
  123. "本步: tiktok-user-posts(sec_user_id=secUid) → 获取该用户发布的全部视频",
  124. "分析: 统计平均播放量、内容类型分布、发布频率规律"
  125. ]
  126. },
  127. "reportMapping": {
  128. "slides": [
  129. "竞品对标(Slide4)",
  130. "社媒聆听(Slide14)"
  131. ],
  132. "dataPoints": [
  133. "内容发布频率和时间规律",
  134. "视频平均播放量和互动率",
  135. "KOL 常青带货内容说服力",
  136. "竞品品牌内容策略对标"
  137. ]
  138. },
  139. "timeout": 60000,
  140. "retry": {
  141. "maxAttempts": 3,
  142. "delay": 1500,
  143. "backoffMultiplier": 2
  144. },
  145. "tokenConfig": {
  146. "type": "bearer",
  147. "configFile": "~/.openclaw/voc-credentials.json",
  148. "tokenField": "vocToken",
  149. "currentToken": "r:858b3ee92314d5447d1fc3cdc10462d7",
  150. "resolutionOrder": ["configFile", "currentToken"],
  151. "onMissing": {
  152. "action": "showPaymentQR",
  153. "qrCodeUrl": "https://pwa.fmode.cn/apig-pay.html?user={{user}}&apigid={{apigid}}&fun_id=HOkkX72PMF",
  154. "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
  155. "pollingIntervalMs": 3000,
  156. "pollingTimeoutMs": 300000,
  157. "onPaymentSuccess": "retrySkillWithNewToken",
  158. "title": "扫码开通 VOC-AI 数据服务",
  159. "message": "请扫描下方二维码完成支付,支付成功后将自动获取 Token 并继续执行。"
  160. },
  161. "onBalanceInsufficient": {
  162. "action": "showPaymentQR",
  163. "qrCodeUrl": "https://pwa.fmode.cn/apig-pay.html?user={{user}}&apigid={{apigid}}&fun_id=HOkkX72PMF",
  164. "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
  165. "pollingIntervalMs": 3000,
  166. "pollingTimeoutMs": 300000,
  167. "onPaymentSuccess": "retrySkillWithNewToken",
  168. "title": "VOC-AI Token 余额不足,请扫码充值",
  169. "message": "当前 Token 余额不足,请扫描二维码充值,支付完成后将自动继续执行。"
  170. }
  171. },
  172. "errorHandling": {
  173. "balanceInsufficient": {
  174. "conditions": [
  175. { "responseField": "code", "operator": "in", "value": [-2, -3, -10, 402, 429] },
  176. { "responseField": "msg", "operator": "contains", "value": ["余额不足", "insufficient", "balance", "quota"] },
  177. { "responseField": "message", "operator": "contains", "value": ["余额不足", "insufficient", "balance"] }
  178. ],
  179. "matchMode": "any",
  180. "trigger": "tokenConfig.onBalanceInsufficient"
  181. },
  182. "unauthorized": {
  183. "conditions": [
  184. { "responseField": "code", "operator": "in", "value": [401, 403] },
  185. { "responseField": "msg", "operator": "contains", "value": ["unauthorized", "token", "invalid", "auth"] }
  186. ],
  187. "matchMode": "any",
  188. "trigger": "tokenConfig.onMissing"
  189. }
  190. }
  191. }