api-config.json 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. {
  2. "name": "douyin-general-search",
  3. "displayName": "抖音综合搜索 V2",
  4. "description": "按关键词在抖音综合搜索,获取相关视频列表及作者/互动数据。适用于品类内容趋势分析、竞品视频监控、VOC素材采集、爆款选题发现。",
  5. "category": "douyin",
  6. "version": "1.3.0",
  7. "endpoint": {
  8. "method": "POST",
  9. "url": "https://server.fmode.cn/api/voc-social/douyin/search/fetch_general_search_v2",
  10. "headers": {
  11. "Authorization": "Bearer ${vocToken}",
  12. "Content-Type": "application/json",
  13. "Accept": "application/json"
  14. }
  15. },
  16. "parameters": {
  17. "type": "object",
  18. "required": [
  19. "keyword"
  20. ],
  21. "properties": {
  22. "keyword": {
  23. "type": "string",
  24. "description": "搜索关键词,支持品类词/品牌词/话题词/人群词,如 '香薰蜡烛'、'户外露营'、'skincare'"
  25. },
  26. "cursor": {
  27. "type": "integer",
  28. "description": "翻页游标,首次请求传 0,下一页使用上次响应返回的 cursor 值",
  29. "default": 0
  30. },
  31. "sort_type": {
  32. "type": "string",
  33. "description": "排序方式:'0'=综合排序(推荐优先);'1'=最多点赞(爆款优先);'2'=最新发布(时效优先)",
  34. "enum": [
  35. "0",
  36. "1",
  37. "2"
  38. ],
  39. "default": "0"
  40. },
  41. "publish_time": {
  42. "type": "string",
  43. "description": "发布时间范围筛选:'0'=不限;'1'=最近一天;'7'=最近一周;'180'=最近半年",
  44. "enum": [
  45. "0",
  46. "1",
  47. "7",
  48. "180"
  49. ],
  50. "default": "0"
  51. },
  52. "filter_duration": {
  53. "type": "string",
  54. "description": "视频时长筛选:'0'=不限;'0-1'=1分钟以内(短片/种草);'1-5'=1-5分钟(中视频);'5-10000'=5分钟以上(深度内容)",
  55. "enum": [
  56. "0",
  57. "0-1",
  58. "1-5",
  59. "5-10000"
  60. ],
  61. "default": "0"
  62. },
  63. "content_type": {
  64. "type": "string",
  65. "description": "内容类型筛选:'0'=不限;'1'=视频;'2'=图文/图片;'3'=文章",
  66. "enum": [
  67. "0",
  68. "1",
  69. "2",
  70. "3"
  71. ],
  72. "default": "0"
  73. },
  74. "search_id": {
  75. "type": "string",
  76. "description": "搜索会话ID,首次请求传空字符串,翻页时从上次响应的 search_id 字段获取",
  77. "default": ""
  78. },
  79. "backtrace": {
  80. "type": "string",
  81. "description": "翻页回溯标识,首次请求传空字符串,翻页时从上次响应的 backtrace 字段获取",
  82. "default": ""
  83. }
  84. }
  85. },
  86. "requestTransform": {
  87. "body": {
  88. "keyword": "{{keyword}}",
  89. "cursor": "{{cursor}}",
  90. "sort_type": "{{sort_type}}",
  91. "publish_time": "{{publish_time}}",
  92. "filter_duration": "{{filter_duration}}",
  93. "content_type": "{{content_type}}",
  94. "search_id": "{{search_id}}",
  95. "backtrace": "{{backtrace}}"
  96. }
  97. },
  98. "response": {
  99. "type": "object",
  100. "description": "综合搜索结果,包含视频列表及互动数据",
  101. "properties": {
  102. "data": {
  103. "type": "array",
  104. "description": "搜索结果列表(aweme_info 数组),每项包含:aweme_id(视频ID)、desc(标题/文案)、author(作者信息)、statistics(互动数据)、video(播放地址)、text_extra(话题标签列表)"
  105. },
  106. "cursor": {
  107. "type": "integer",
  108. "description": "下一页游标,翻页时作为 cursor 参数传入"
  109. },
  110. "has_more": {
  111. "type": "integer",
  112. "description": "是否有更多数据(1=有,0=无)"
  113. },
  114. "search_id": {
  115. "type": "string",
  116. "description": "翻页搜索会话ID,翻页时原样传回"
  117. },
  118. "backtrace": {
  119. "type": "string",
  120. "description": "翻页回溯标识,翻页时原样传回"
  121. }
  122. },
  123. "keyFields": {
  124. "aweme_id": "视频唯一ID,可传入 douyin-video-detail 获取完整数据",
  125. "desc": "视频文案/标题,含核心卖点和话题标签",
  126. "author.uid": "作者用户ID",
  127. "author.nickname": "作者昵称",
  128. "author.sec_uid": "可传入 douyin-user-profile 获取作者详情",
  129. "statistics.digg_count": "点赞数(爆款指标)",
  130. "statistics.comment_count": "评论数,可用 douyin-video-comments 获取详情",
  131. "statistics.share_count": "分享数(传播力指标)",
  132. "statistics.play_count": "播放量(曝光力指标)"
  133. }
  134. },
  135. "workflow": {
  136. "description": "推荐调用链",
  137. "steps": [
  138. "1. douyin-general-search(keyword) → 获取相关视频列表",
  139. "2. douyin-video-detail(aweme_id) → 获取单视频完整数据",
  140. "3. douyin-video-comments(aweme_id) → 获取该视频评论",
  141. "4. douyin-comment-replies(item_id, comment_id) → 获取热评回复",
  142. "5. douyin-user-profile(sec_uid) → 获取高互动视频作者详情"
  143. ]
  144. },
  145. "usageExamples": [
  146. {
  147. "name": "品类爆款内容发现",
  148. "input": {
  149. "keyword": "香薰蜡烛",
  150. "cursor": 0,
  151. "sort_type": "1",
  152. "publish_time": "7",
  153. "content_type": "1"
  154. },
  155. "description": "搜索近一周点赞最多的香薰蜡烛视频,发现爆款内容规律,用于选品和内容策略参考"
  156. },
  157. {
  158. "name": "竞品品牌内容监控",
  159. "input": {
  160. "keyword": "竞品品牌名",
  161. "cursor": 0,
  162. "sort_type": "2",
  163. "publish_time": "1"
  164. },
  165. "description": "搜索竞品品牌最新发布内容,监控其内容策略动向"
  166. },
  167. {
  168. "name": "用户痛点VOC素材采集",
  169. "input": {
  170. "keyword": "香薰蜡烛 踩雷",
  171. "cursor": 0,
  172. "sort_type": "0",
  173. "filter_duration": "0-1"
  174. },
  175. "description": "搜索用户发布的短视频评测/踩雷内容,结合 douyin-video-comments 提取用户真实痛点"
  176. },
  177. {
  178. "name": "趋势话题内容研究",
  179. "input": {
  180. "keyword": "露营神器",
  181. "cursor": 0,
  182. "sort_type": "2",
  183. "publish_time": "7"
  184. },
  185. "description": "发现最新趋势话题下的内容形式,辅助新品上市内容策略规划"
  186. }
  187. ],
  188. "reportMapping": {
  189. "slides": [
  190. "社媒聆听(Slide14)",
  191. "竞品社媒策略(Slide15)"
  192. ],
  193. "dataPoints": [
  194. "品类热词视频列表",
  195. "视频互动率(点赞/播放比)",
  196. "爆款内容文案模式",
  197. "活跃 KOL 账号发现",
  198. "用户痛点关键词(结合评论分析)"
  199. ]
  200. },
  201. "timeout": 60000,
  202. "retry": {
  203. "maxAttempts": 3,
  204. "delay": 1500,
  205. "backoffMultiplier": 2
  206. },
  207. "tokenConfig": {
  208. "type": "bearer",
  209. "configFile": "~/.openclaw/voc-credentials.json",
  210. "tokenField": "vocToken",
  211. "resolutionOrder": [
  212. "configFile"
  213. ],
  214. "apigId": "Vo3ROWEvDy",
  215. "paymentUrlResolution": {
  216. "description": "动态构建充值URL:在已存在 session token 时查出用户 objectId,拼接到专属充值页面",
  217. "steps": [
  218. "1. 从 voc-credentials.json 获取当前 session token",
  219. "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
  220. "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  221. "4. 将该URL展示给用户,引导扫码支付"
  222. ],
  223. "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
  224. "userResolveHeaders": {
  225. "X-Parse-Application-Id": "ncloudmaster",
  226. "X-Parse-Session-Token": "{vocToken}"
  227. },
  228. "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/",
  229. "paymentParams": {
  230. "user": "{resolvedUserId}",
  231. "apigid": "Vo3ROWEvDy",
  232. "fun_id": "HOkkX72PMF"
  233. },
  234. "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
  235. },
  236. "onMissing": {
  237. "action": "showPaymentQR",
  238. "qrCodeUrl": "https://app.fmode.cn/dev/apig-pay/?apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  239. "title": "扫码开通 VOC-AI 数据服务",
  240. "message": "此 Skill 需要有效的 API Token。请先打开充值页面完成登录和充值;当用户提供 session token 后,请由 OpenClaw 运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json 的 vocToken 字段,再重试当前 Skill。",
  241. "tokenSetupCommandTemplate": "node scripts/tools/set-voc-token.js {sessionToken}",
  242. "tokenSetupInstructions": "当用户完成登录和充值后,如果用户把 session token 发给你,请直接运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json,然后重试当前 Skill。"
  243. },
  244. "onBalanceInsufficient": {
  245. "action": "resolveUserThenShowPayment",
  246. "title": "VOC-AI Token 余额不足,请扫码充值",
  247. "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
  248. }
  249. },
  250. "errorHandling": {
  251. "balanceInsufficient": {
  252. "conditions": [
  253. {
  254. "responseField": "code",
  255. "operator": "in",
  256. "value": [
  257. -2,
  258. -3,
  259. -10,
  260. 402,
  261. 429
  262. ]
  263. },
  264. {
  265. "responseField": "msg",
  266. "operator": "contains",
  267. "value": [
  268. "余额不足",
  269. "insufficient",
  270. "balance",
  271. "quota",
  272. "没有开通",
  273. "权限或余额"
  274. ]
  275. },
  276. {
  277. "responseField": "mess",
  278. "operator": "contains",
  279. "value": [
  280. "余额不足",
  281. "insufficient",
  282. "balance",
  283. "quota",
  284. "没有开通",
  285. "权限或余额"
  286. ]
  287. },
  288. {
  289. "responseField": "message",
  290. "operator": "contains",
  291. "value": [
  292. "余额不足",
  293. "insufficient",
  294. "balance",
  295. "没有开通",
  296. "权限或余额"
  297. ]
  298. }
  299. ],
  300. "matchMode": "any",
  301. "trigger": "tokenConfig.onBalanceInsufficient"
  302. },
  303. "unauthorized": {
  304. "conditions": [
  305. {
  306. "responseField": "code",
  307. "operator": "in",
  308. "value": [
  309. 401,
  310. 403
  311. ]
  312. },
  313. {
  314. "responseField": "msg",
  315. "operator": "contains",
  316. "value": [
  317. "unauthorized",
  318. "token",
  319. "invalid",
  320. "auth"
  321. ]
  322. }
  323. ],
  324. "matchMode": "any",
  325. "trigger": "tokenConfig.onMissing"
  326. }
  327. }
  328. }