api-config.json 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. {
  2. "name": "tiktok-video-search",
  3. "displayName": "TikTok 视频搜索",
  4. "description": "按关键词搜索 TikTok 视频,返回视频列表及播放量/点赞/评论/分享等数据。适用于品类 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_video_search_result",
  10. "headers": {
  11. "Authorization": "Bearer ${vocToken}",
  12. "Accept": "application/json"
  13. }
  14. },
  15. "parameters": {
  16. "type": "object",
  17. "required": [
  18. "keyword"
  19. ],
  20. "properties": {
  21. "keyword": {
  22. "type": "string",
  23. "description": "搜索关键词,如 'reed diffuser'、'candle warmer'、'aroma diffuser'"
  24. },
  25. "count": {
  26. "type": "integer",
  27. "description": "返回视频数量,最大 30",
  28. "default": 10,
  29. "minimum": 1,
  30. "maximum": 30
  31. },
  32. "cursor": {
  33. "type": "integer",
  34. "description": "分页游标,首次请求不传或传 0,后续传上次返回的 cursor 值",
  35. "default": 0
  36. }
  37. }
  38. },
  39. "requestTransform": {
  40. "description": "直接作为 GET 查询参数传递",
  41. "queryParams": {
  42. "keyword": "{{keyword}}",
  43. "count": "{{count}}",
  44. "cursor": "{{cursor}}"
  45. }
  46. },
  47. "response": {
  48. "type": "object",
  49. "description": "视频搜索结果",
  50. "properties": {
  51. "aweme_list": {
  52. "type": "array",
  53. "description": "视频列表(可能为空,数据也可能在 search_item_list[].aweme_info 中)",
  54. "items": {
  55. "type": "object",
  56. "properties": {
  57. "aweme_id": {
  58. "type": "string",
  59. "description": "视频唯一 ID"
  60. },
  61. "desc": {
  62. "type": "string",
  63. "description": "视频描述/标题"
  64. },
  65. "statistics": {
  66. "type": "object",
  67. "properties": {
  68. "play_count": {
  69. "type": "integer",
  70. "description": "播放量"
  71. },
  72. "digg_count": {
  73. "type": "integer",
  74. "description": "点赞数"
  75. },
  76. "comment_count": {
  77. "type": "integer",
  78. "description": "评论数"
  79. },
  80. "share_count": {
  81. "type": "integer",
  82. "description": "分享数"
  83. }
  84. }
  85. },
  86. "author": {
  87. "type": "object",
  88. "properties": {
  89. "nickname": {
  90. "type": "string",
  91. "description": "作者昵称"
  92. },
  93. "unique_id": {
  94. "type": "string",
  95. "description": "作者用户名"
  96. },
  97. "follower_count": {
  98. "type": "integer",
  99. "description": "作者粉丝数"
  100. }
  101. }
  102. },
  103. "cha_list": {
  104. "type": "array",
  105. "description": "关联话题/标签列表",
  106. "items": {
  107. "type": "object",
  108. "properties": {
  109. "cha_name": {
  110. "type": "string",
  111. "description": "话题名称"
  112. },
  113. "cha_id": {
  114. "type": "string",
  115. "description": "话题 ID"
  116. }
  117. }
  118. }
  119. }
  120. }
  121. }
  122. },
  123. "search_item_list": {
  124. "type": "array",
  125. "description": "备选数据路径(当 aweme_list 为空时从此取 aweme_info)"
  126. },
  127. "has_more": {
  128. "type": "boolean",
  129. "description": "是否有更多数据"
  130. },
  131. "cursor": {
  132. "type": "integer",
  133. "description": "下一页游标"
  134. }
  135. }
  136. },
  137. "notes": "响应数据可能在 aweme_list 或 search_item_list[].aweme_info 中,需做兼容处理。前端已封装 searchVideosV2 方法自动处理两种结构。",
  138. "usageExamples": [
  139. {
  140. "name": "品类 TikTok 播放量统计",
  141. "input": {
  142. "keyword": "candle warmer",
  143. "count": 20,
  144. "cursor": 0
  145. },
  146. "description": "搜索 candle warmer 相关视频,统计品类总播放量和爆款视频列表,用于社媒频道热度报告"
  147. },
  148. {
  149. "name": "竞品品牌内容监控",
  150. "input": {
  151. "keyword": "NEST New York",
  152. "count": 20,
  153. "cursor": 0
  154. },
  155. "description": "搜索竞品品牌 TikTok 视频,了解其内容策略和曝光规模"
  156. },
  157. {
  158. "name": "用户痛点内容发现",
  159. "input": {
  160. "keyword": "reed diffuser smells bad",
  161. "count": 15,
  162. "cursor": 0
  163. },
  164. "description": "搜索用户发布的踩雷/差评视频,发现产品痛点"
  165. }
  166. ],
  167. "workflow": {
  168. "description": "推荐调用链",
  169. "steps": [
  170. "1. tiktok-video-search(keyword) → 获取视频列表,统计总播放量",
  171. "2. tiktok-video-detail(aweme_id) → 获取单视频完整数据",
  172. "3. tiktok-video-comments(aweme_id) → 获取用户评论 VOC 分析",
  173. "4. tiktok-hashtag-detail(ch_id from cha_list) → 获取关联话题播放量详情"
  174. ]
  175. },
  176. "reportMapping": {
  177. "slides": [
  178. "TikTok热度排名(Slide6)",
  179. "社媒聆听(Slide14)"
  180. ],
  181. "dataPoints": [
  182. "品类 TikTok 总播放量",
  183. "爆款视频列表(按播放量排序)",
  184. "视频互动率(点赞/播放比)",
  185. "相关话题标签(cha_list)",
  186. "活跃 KOL 账号发现"
  187. ]
  188. },
  189. "timeout": 60000,
  190. "retry": {
  191. "maxAttempts": 3,
  192. "delay": 1500,
  193. "backoffMultiplier": 2
  194. },
  195. "tokenConfig": {
  196. "type": "bearer",
  197. "configFile": "~/.openclaw/voc-credentials.json",
  198. "tokenField": "vocToken",
  199. "resolutionOrder": [
  200. "configFile"
  201. ],
  202. "apigId": "Vo3ROWEvDy",
  203. "paymentUrlResolution": {
  204. "description": "动态构建充值URL:在已存在 session token 时查出用户 objectId,拼接到专属充值页面",
  205. "steps": [
  206. "1. 从 voc-credentials.json 获取当前 session token",
  207. "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
  208. "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  209. "4. 将该URL展示给用户,引导扫码支付"
  210. ],
  211. "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
  212. "userResolveHeaders": {
  213. "X-Parse-Application-Id": "ncloudmaster",
  214. "X-Parse-Session-Token": "{vocToken}"
  215. },
  216. "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/",
  217. "paymentParams": {
  218. "user": "{resolvedUserId}",
  219. "apigid": "Vo3ROWEvDy",
  220. "fun_id": "HOkkX72PMF"
  221. },
  222. "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
  223. },
  224. "onMissing": {
  225. "action": "showPaymentQR",
  226. "qrCodeUrl": "https://app.fmode.cn/dev/apig-pay/?apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  227. "title": "扫码开通 VOC-AI 数据服务",
  228. "message": "此 Skill 需要有效的 API Token。请先打开充值页面完成登录和充值;当用户提供 session token 后,请由 OpenClaw 运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json 的 vocToken 字段,再重试当前 Skill。",
  229. "tokenSetupCommandTemplate": "node scripts/tools/set-voc-token.js {sessionToken}",
  230. "tokenSetupInstructions": "当用户完成登录和充值后,如果用户把 session token 发给你,请直接运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json,然后重试当前 Skill。"
  231. },
  232. "onBalanceInsufficient": {
  233. "action": "resolveUserThenShowPayment",
  234. "title": "VOC-AI Token 余额不足,请扫码充值",
  235. "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
  236. }
  237. },
  238. "errorHandling": {
  239. "balanceInsufficient": {
  240. "conditions": [
  241. {
  242. "responseField": "code",
  243. "operator": "in",
  244. "value": [
  245. -2,
  246. -3,
  247. -10,
  248. 402,
  249. 429
  250. ]
  251. },
  252. {
  253. "responseField": "msg",
  254. "operator": "contains",
  255. "value": [
  256. "余额不足",
  257. "insufficient",
  258. "balance",
  259. "quota",
  260. "没有开通",
  261. "权限或余额"
  262. ]
  263. },
  264. {
  265. "responseField": "mess",
  266. "operator": "contains",
  267. "value": [
  268. "余额不足",
  269. "insufficient",
  270. "balance",
  271. "quota",
  272. "没有开通",
  273. "权限或余额"
  274. ]
  275. },
  276. {
  277. "responseField": "message",
  278. "operator": "contains",
  279. "value": [
  280. "余额不足",
  281. "insufficient",
  282. "balance",
  283. "没有开通",
  284. "权限或余额"
  285. ]
  286. }
  287. ],
  288. "matchMode": "any",
  289. "trigger": "tokenConfig.onBalanceInsufficient"
  290. },
  291. "unauthorized": {
  292. "conditions": [
  293. {
  294. "responseField": "code",
  295. "operator": "in",
  296. "value": [
  297. 401,
  298. 403
  299. ]
  300. },
  301. {
  302. "responseField": "msg",
  303. "operator": "contains",
  304. "value": [
  305. "unauthorized",
  306. "token",
  307. "invalid",
  308. "auth"
  309. ]
  310. }
  311. ],
  312. "matchMode": "any",
  313. "trigger": "tokenConfig.onMissing"
  314. }
  315. }
  316. }