api-config.json 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  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 ${vocToken}",
  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. "resolutionOrder": [
  150. "configFile"
  151. ],
  152. "apigId": "Vo3ROWEvDy",
  153. "paymentUrlResolution": {
  154. "description": "动态构建充值URL:在已存在 session token 时查出用户 objectId,拼接到专属充值页面",
  155. "steps": [
  156. "1. 从 voc-credentials.json 获取当前 session token",
  157. "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
  158. "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  159. "4. 将该URL展示给用户,引导扫码支付"
  160. ],
  161. "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
  162. "userResolveHeaders": {
  163. "X-Parse-Application-Id": "ncloudmaster",
  164. "X-Parse-Session-Token": "{vocToken}"
  165. },
  166. "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/",
  167. "paymentParams": {
  168. "user": "{resolvedUserId}",
  169. "apigid": "Vo3ROWEvDy",
  170. "fun_id": "HOkkX72PMF"
  171. },
  172. "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
  173. },
  174. "onMissing": {
  175. "action": "showPaymentQR",
  176. "qrCodeUrl": "https://app.fmode.cn/dev/apig-pay/?apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  177. "title": "扫码开通 VOC-AI 数据服务",
  178. "message": "此 Skill 需要有效的 API Token。请先打开充值页面完成登录和充值;当用户提供 session token 后,请由 OpenClaw 运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json 的 vocToken 字段,再重试当前 Skill。",
  179. "tokenSetupCommandTemplate": "node scripts/tools/set-voc-token.js {sessionToken}",
  180. "tokenSetupInstructions": "当用户完成登录和充值后,如果用户把 session token 发给你,请直接运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json,然后重试当前 Skill。"
  181. },
  182. "onBalanceInsufficient": {
  183. "action": "resolveUserThenShowPayment",
  184. "title": "VOC-AI Token 余额不足,请扫码充值",
  185. "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
  186. }
  187. },
  188. "errorHandling": {
  189. "balanceInsufficient": {
  190. "conditions": [
  191. {
  192. "responseField": "code",
  193. "operator": "in",
  194. "value": [
  195. -2,
  196. -3,
  197. -10,
  198. 402,
  199. 429
  200. ]
  201. },
  202. {
  203. "responseField": "msg",
  204. "operator": "contains",
  205. "value": [
  206. "余额不足",
  207. "insufficient",
  208. "balance",
  209. "quota",
  210. "没有开通",
  211. "权限或余额"
  212. ]
  213. },
  214. {
  215. "responseField": "mess",
  216. "operator": "contains",
  217. "value": [
  218. "余额不足",
  219. "insufficient",
  220. "balance",
  221. "quota",
  222. "没有开通",
  223. "权限或余额"
  224. ]
  225. },
  226. {
  227. "responseField": "message",
  228. "operator": "contains",
  229. "value": [
  230. "余额不足",
  231. "insufficient",
  232. "balance",
  233. "没有开通",
  234. "权限或余额"
  235. ]
  236. }
  237. ],
  238. "matchMode": "any",
  239. "trigger": "tokenConfig.onBalanceInsufficient"
  240. },
  241. "unauthorized": {
  242. "conditions": [
  243. {
  244. "responseField": "code",
  245. "operator": "in",
  246. "value": [
  247. 401,
  248. 403
  249. ]
  250. },
  251. {
  252. "responseField": "msg",
  253. "operator": "contains",
  254. "value": [
  255. "unauthorized",
  256. "token",
  257. "invalid",
  258. "auth"
  259. ]
  260. }
  261. ],
  262. "matchMode": "any",
  263. "trigger": "tokenConfig.onMissing"
  264. }
  265. }
  266. }