api-config.json 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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 r:a5a19ea9868043b15d9b10423234ca43",
  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. "currentToken": "r:858b3ee92314d5447d1fc3cdc10462d7",
  113. "resolutionOrder": [
  114. "configFile",
  115. "currentToken"
  116. ],
  117. "apigId": "Vo3ROWEvDy",
  118. "paymentUrlResolution": {
  119. "description": "动态构建充值URL:通过当前token查出用户objectId,拼接到充值页面",
  120. "steps": [
  121. "1. 从 voc-credentials.json 或 currentToken 获取当前 session token",
  122. "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
  123. "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  124. "4. 将该URL展示给用户,引导扫码支付"
  125. ],
  126. "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
  127. "userResolveHeaders": {
  128. "X-Parse-Application-Id": "ncloudmaster",
  129. "X-Parse-Session-Token": "{vocToken}"
  130. },
  131. "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/",
  132. "paymentParams": {
  133. "user": "{resolvedUserId}",
  134. "apigid": "Vo3ROWEvDy",
  135. "fun_id": "HOkkX72PMF"
  136. },
  137. "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
  138. },
  139. "onMissing": {
  140. "action": "resolveUserThenShowPayment",
  141. "title": "扫码开通 VOC-AI 数据服务",
  142. "message": "此 Skill 需要有效的 API Token。请按以下步骤操作:\n1. 如果你已有 Token,请告诉我,我会保存到 ~/.openclaw/voc-credentials.json\n2. 如果没有 Token,我会引导你扫码充值开通"
  143. },
  144. "onBalanceInsufficient": {
  145. "action": "resolveUserThenShowPayment",
  146. "title": "VOC-AI Token 余额不足,请扫码充值",
  147. "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
  148. }
  149. },
  150. "errorHandling": {
  151. "balanceInsufficient": {
  152. "conditions": [
  153. {
  154. "responseField": "code",
  155. "operator": "in",
  156. "value": [
  157. -2,
  158. -3,
  159. -10,
  160. 402,
  161. 429
  162. ]
  163. },
  164. {
  165. "responseField": "msg",
  166. "operator": "contains",
  167. "value": [
  168. "余额不足",
  169. "insufficient",
  170. "balance",
  171. "quota"
  172. ]
  173. },
  174. {
  175. "responseField": "message",
  176. "operator": "contains",
  177. "value": [
  178. "余额不足",
  179. "insufficient",
  180. "balance"
  181. ]
  182. }
  183. ],
  184. "matchMode": "any",
  185. "trigger": "tokenConfig.onBalanceInsufficient"
  186. },
  187. "unauthorized": {
  188. "conditions": [
  189. {
  190. "responseField": "code",
  191. "operator": "in",
  192. "value": [
  193. 401,
  194. 403
  195. ]
  196. },
  197. {
  198. "responseField": "msg",
  199. "operator": "contains",
  200. "value": [
  201. "unauthorized",
  202. "token",
  203. "invalid",
  204. "auth"
  205. ]
  206. }
  207. ],
  208. "matchMode": "any",
  209. "trigger": "tokenConfig.onMissing"
  210. }
  211. }
  212. }