api-config.json 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. {
  2. "name": "douyin-user-search",
  3. "displayName": "抖音用户搜索 V2",
  4. "description": "按关键词搜索抖音达人/用户,返回匹配的账号列表及基础数据。适用于红人库建设、品类达人批量筛选、竞品代言人定位。",
  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_user_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": "搜索关键词,如 '人工智能'、'美妆'"
  25. },
  26. "cursor": {
  27. "type": "integer",
  28. "description": "翻页游标,首次请求传 0",
  29. "default": 0
  30. }
  31. }
  32. },
  33. "requestTransform": {
  34. "body": {
  35. "keyword": "{{keyword}}",
  36. "cursor": "{{cursor}}"
  37. }
  38. },
  39. "response": {
  40. "type": "object",
  41. "description": "用户搜索结果",
  42. "properties": {
  43. "cursor": {
  44. "type": "integer",
  45. "description": "下一页游标"
  46. },
  47. "has_more": {
  48. "type": "integer",
  49. "description": "是否有更多数据(1=有,0=无)"
  50. },
  51. "user_list": {
  52. "type": "array",
  53. "description": "用户列表",
  54. "items": {
  55. "type": "object",
  56. "properties": {
  57. "user_info": {
  58. "type": "object",
  59. "description": "用户信息(uid, nickname, unique_id, sec_uid, follower_count, signature 等)"
  60. }
  61. }
  62. }
  63. }
  64. }
  65. },
  66. "usageExamples": [
  67. {
  68. "name": "品类达人批量筛选",
  69. "input": {
  70. "keyword": "香薰蜡烛达人",
  71. "cursor": 0
  72. },
  73. "description": "搜索香薰蜡烛品类达人,得到候选名单后用 douyin-user-profile 获取粉丝数评估化"
  74. },
  75. {
  76. "name": "竞品品牌账号搜索",
  77. "input": {
  78. "keyword": "竞品品牌名+官方旗舰店",
  79. "cursor": 0
  80. },
  81. "description": "搜索竞品品牌在抖音的官方账号,用于监控其运营动态"
  82. }
  83. ],
  84. "workflow": {
  85. "description": "推荐调用链",
  86. "steps": [
  87. "本步: douyin-user-search(keyword) → 搜索达人/品牌 → 得到 uid、nickname、sec_uid、follower_count",
  88. "下游: douyin-user-profile(sec_user_id) → 获取账号完整数据和统计",
  89. "筛选: 按 follower_count 筛选符合粉丝规模要求的达人"
  90. ]
  91. },
  92. "reportMapping": {
  93. "slides": [
  94. "社媒聆听(Slide14)"
  95. ],
  96. "dataPoints": [
  97. "品类达人候选列表",
  98. "粉丝规模分布(头部/腰部/尾部达人)",
  99. "竞品代言人定位"
  100. ]
  101. },
  102. "timeout": 60000,
  103. "retry": {
  104. "maxAttempts": 3,
  105. "delay": 1500,
  106. "backoffMultiplier": 2
  107. },
  108. "tokenConfig": {
  109. "type": "bearer",
  110. "configFile": "~/.openclaw/voc-credentials.json",
  111. "tokenField": "vocToken",
  112. "resolutionOrder": [
  113. "configFile"
  114. ],
  115. "apigId": "Vo3ROWEvDy",
  116. "paymentUrlResolution": {
  117. "description": "动态构建充值URL:在已存在 session token 时查出用户 objectId,拼接到专属充值页面",
  118. "steps": [
  119. "1. 从 voc-credentials.json 获取当前 session token",
  120. "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
  121. "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  122. "4. 将该URL展示给用户,引导扫码支付"
  123. ],
  124. "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
  125. "userResolveHeaders": {
  126. "X-Parse-Application-Id": "ncloudmaster",
  127. "X-Parse-Session-Token": "{vocToken}"
  128. },
  129. "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/",
  130. "paymentParams": {
  131. "user": "{resolvedUserId}",
  132. "apigid": "Vo3ROWEvDy",
  133. "fun_id": "HOkkX72PMF"
  134. },
  135. "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
  136. },
  137. "onMissing": {
  138. "action": "showPaymentQR",
  139. "qrCodeUrl": "https://app.fmode.cn/dev/apig-pay/?apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  140. "title": "扫码开通 VOC-AI 数据服务",
  141. "message": "此 Skill 需要有效的 API Token。请先打开充值页面完成登录和充值;当用户提供 session token 后,请由 OpenClaw 运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json 的 vocToken 字段,再重试当前 Skill。",
  142. "tokenSetupCommandTemplate": "node scripts/tools/set-voc-token.js {sessionToken}",
  143. "tokenSetupInstructions": "当用户完成登录和充值后,如果用户把 session token 发给你,请直接运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json,然后重试当前 Skill。"
  144. },
  145. "onBalanceInsufficient": {
  146. "action": "resolveUserThenShowPayment",
  147. "title": "VOC-AI Token 余额不足,请扫码充值",
  148. "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
  149. }
  150. },
  151. "errorHandling": {
  152. "balanceInsufficient": {
  153. "conditions": [
  154. {
  155. "responseField": "code",
  156. "operator": "in",
  157. "value": [
  158. -2,
  159. -3,
  160. -10,
  161. 402,
  162. 429
  163. ]
  164. },
  165. {
  166. "responseField": "msg",
  167. "operator": "contains",
  168. "value": [
  169. "余额不足",
  170. "insufficient",
  171. "balance",
  172. "quota",
  173. "没有开通",
  174. "权限或余额"
  175. ]
  176. },
  177. {
  178. "responseField": "mess",
  179. "operator": "contains",
  180. "value": [
  181. "余额不足",
  182. "insufficient",
  183. "balance",
  184. "quota",
  185. "没有开通",
  186. "权限或余额"
  187. ]
  188. },
  189. {
  190. "responseField": "message",
  191. "operator": "contains",
  192. "value": [
  193. "余额不足",
  194. "insufficient",
  195. "balance",
  196. "没有开通",
  197. "权限或余额"
  198. ]
  199. }
  200. ],
  201. "matchMode": "any",
  202. "trigger": "tokenConfig.onBalanceInsufficient"
  203. },
  204. "unauthorized": {
  205. "conditions": [
  206. {
  207. "responseField": "code",
  208. "operator": "in",
  209. "value": [
  210. 401,
  211. 403
  212. ]
  213. },
  214. {
  215. "responseField": "msg",
  216. "operator": "contains",
  217. "value": [
  218. "unauthorized",
  219. "token",
  220. "invalid",
  221. "auth"
  222. ]
  223. }
  224. ],
  225. "matchMode": "any",
  226. "trigger": "tokenConfig.onMissing"
  227. }
  228. }
  229. }