api-config.json 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. {
  2. "name": "tiktok-user-search",
  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/web/fetch_search_user",
  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": "搜索关键词,如品牌名 'NEST New York' 或品类 'candle warmer'"
  24. },
  25. "count": {
  26. "type": "integer",
  27. "description": "返回用户数量",
  28. "default": 10,
  29. "maximum": 30
  30. },
  31. "cursor": {
  32. "type": "integer",
  33. "description": "分页游标",
  34. "default": 0
  35. }
  36. }
  37. },
  38. "requestTransform": {
  39. "queryParams": {
  40. "keyword": "{{keyword}}",
  41. "count": "{{count}}",
  42. "cursor": "{{cursor}}"
  43. }
  44. },
  45. "response": {
  46. "type": "object",
  47. "description": "用户搜索结果",
  48. "properties": {
  49. "user_list": {
  50. "type": "array",
  51. "description": "用户列表(可能在 data.user_list 中)",
  52. "items": {
  53. "type": "object",
  54. "properties": {
  55. "user_info": {
  56. "type": "object",
  57. "properties": {
  58. "unique_id": {
  59. "type": "string",
  60. "description": "用户名"
  61. },
  62. "nickname": {
  63. "type": "string",
  64. "description": "昵称"
  65. },
  66. "follower_count": {
  67. "type": "integer",
  68. "description": "粉丝数"
  69. },
  70. "following_count": {
  71. "type": "integer",
  72. "description": "关注数"
  73. },
  74. "total_favorited": {
  75. "type": "integer",
  76. "description": "获赞总数"
  77. },
  78. "video_count": {
  79. "type": "integer",
  80. "description": "作品数"
  81. },
  82. "avatar_larger": {
  83. "type": "object",
  84. "description": "头像(大图)"
  85. },
  86. "signature": {
  87. "type": "string",
  88. "description": "个人简介"
  89. }
  90. }
  91. }
  92. }
  93. }
  94. }
  95. }
  96. },
  97. "usageExamples": [
  98. {
  99. "name": "品类 KOL 批量搜索",
  100. "input": {
  101. "keyword": "candle warmer creator",
  102. "count": 20,
  103. "cursor": 0
  104. },
  105. "description": "搜索 candle warmer 品类达人,获取候选名单后用 tiktok-user-profile 获取粉丝数评估化"
  106. },
  107. {
  108. "name": "竞品品牌账号定位",
  109. "input": {
  110. "keyword": "NEST New York",
  111. "count": 5,
  112. "cursor": 0
  113. },
  114. "description": "搜索竞品品牌官方 TikTok 账号,用于竞品社媒影响力对标"
  115. }
  116. ],
  117. "workflow": {
  118. "description": "推荐调用链",
  119. "steps": [
  120. "本步: tiktok-user-search(keyword) → 搜索达人/品牌 → 得到 unique_id、follower_count、total_favorited",
  121. "下游: tiktok-user-profile(uniqueId) → 获取账号完整数据和 secUid",
  122. "下游: tiktok-user-posts(sec_user_id) → 获取达人发布的视频列表"
  123. ]
  124. },
  125. "reportMapping": {
  126. "slides": [
  127. "红人达人库(Slide11)"
  128. ],
  129. "dataPoints": [
  130. "品类 KOL 候选列表",
  131. "粉丝规模分布(头部/腿部/尾部达人)",
  132. "竞品代言人定位"
  133. ]
  134. },
  135. "timeout": 60000,
  136. "retry": {
  137. "maxAttempts": 3,
  138. "delay": 1500,
  139. "backoffMultiplier": 2
  140. },
  141. "tokenConfig": {
  142. "type": "bearer",
  143. "configFile": "~/.openclaw/voc-credentials.json",
  144. "tokenField": "vocToken",
  145. "resolutionOrder": [
  146. "configFile"
  147. ],
  148. "apigId": "Vo3ROWEvDy",
  149. "paymentUrlResolution": {
  150. "description": "动态构建充值URL:在已存在 session token 时查出用户 objectId,拼接到专属充值页面",
  151. "steps": [
  152. "1. 从 voc-credentials.json 获取当前 session token",
  153. "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
  154. "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  155. "4. 将该URL展示给用户,引导扫码支付"
  156. ],
  157. "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
  158. "userResolveHeaders": {
  159. "X-Parse-Application-Id": "ncloudmaster",
  160. "X-Parse-Session-Token": "{vocToken}"
  161. },
  162. "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/",
  163. "paymentParams": {
  164. "user": "{resolvedUserId}",
  165. "apigid": "Vo3ROWEvDy",
  166. "fun_id": "HOkkX72PMF"
  167. },
  168. "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
  169. },
  170. "onMissing": {
  171. "action": "showPaymentQR",
  172. "qrCodeUrl": "https://app.fmode.cn/dev/apig-pay/?apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  173. "title": "扫码开通 VOC-AI 数据服务",
  174. "message": "此 Skill 需要有效的 API Token。请先打开充值页面完成登录和充值;当用户提供 session token 后,请由 OpenClaw 运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json 的 vocToken 字段,再重试当前 Skill。",
  175. "tokenSetupCommandTemplate": "node scripts/tools/set-voc-token.js {sessionToken}",
  176. "tokenSetupInstructions": "当用户完成登录和充值后,如果用户把 session token 发给你,请直接运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json,然后重试当前 Skill。"
  177. },
  178. "onBalanceInsufficient": {
  179. "action": "resolveUserThenShowPayment",
  180. "title": "VOC-AI Token 余额不足,请扫码充值",
  181. "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
  182. }
  183. },
  184. "errorHandling": {
  185. "balanceInsufficient": {
  186. "conditions": [
  187. {
  188. "responseField": "code",
  189. "operator": "in",
  190. "value": [
  191. -2,
  192. -3,
  193. -10,
  194. 402,
  195. 429
  196. ]
  197. },
  198. {
  199. "responseField": "msg",
  200. "operator": "contains",
  201. "value": [
  202. "余额不足",
  203. "insufficient",
  204. "balance",
  205. "quota",
  206. "没有开通",
  207. "权限或余额"
  208. ]
  209. },
  210. {
  211. "responseField": "mess",
  212. "operator": "contains",
  213. "value": [
  214. "余额不足",
  215. "insufficient",
  216. "balance",
  217. "quota",
  218. "没有开通",
  219. "权限或余额"
  220. ]
  221. },
  222. {
  223. "responseField": "message",
  224. "operator": "contains",
  225. "value": [
  226. "余额不足",
  227. "insufficient",
  228. "balance",
  229. "没有开通",
  230. "权限或余额"
  231. ]
  232. }
  233. ],
  234. "matchMode": "any",
  235. "trigger": "tokenConfig.onBalanceInsufficient"
  236. },
  237. "unauthorized": {
  238. "conditions": [
  239. {
  240. "responseField": "code",
  241. "operator": "in",
  242. "value": [
  243. 401,
  244. 403
  245. ]
  246. },
  247. {
  248. "responseField": "msg",
  249. "operator": "contains",
  250. "value": [
  251. "unauthorized",
  252. "token",
  253. "invalid",
  254. "auth"
  255. ]
  256. }
  257. ],
  258. "matchMode": "any",
  259. "trigger": "tokenConfig.onMissing"
  260. }
  261. }
  262. }