api-config.json 8.2 KB

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