api-config.json 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. {
  2. "name": "douyin-user-profile",
  3. "displayName": "抖音用户信息查询",
  4. "description": "根据 sec_user_id 获取抖音用户完整主页数据,包括粉丝数、总获赞数、作品数、个人简介、认证信息等。适用于KOL档案建立、竞品品牌账号分析、达人粉丝画像评估。",
  5. "category": "douyin",
  6. "version": "1.3.0",
  7. "endpoint": {
  8. "method": "GET",
  9. "url": "https://server.fmode.cn/api/voc-social/douyin/app/v3/handler_user_profile",
  10. "headers": {
  11. "Authorization": "Bearer r:a5a19ea9868043b15d9b10423234ca43",
  12. "Accept": "application/json"
  13. }
  14. },
  15. "parameters": {
  16. "type": "object",
  17. "required": [
  18. "sec_user_id"
  19. ],
  20. "properties": {
  21. "sec_user_id": {
  22. "type": "string",
  23. "description": "抖音用户 sec_user_id"
  24. }
  25. }
  26. },
  27. "requestTransform": {
  28. "queryParams": {
  29. "sec_user_id": "{{sec_user_id}}"
  30. }
  31. },
  32. "response": {
  33. "type": "object",
  34. "description": "用户完整资料",
  35. "properties": {
  36. "data": {
  37. "type": "object",
  38. "description": "用户信息,包括昵称、粉丝数、获赞数、作品数、个人简介、头像等"
  39. }
  40. }
  41. },
  42. "usageExamples": [
  43. {
  44. "name": "KOL达人档案建立",
  45. "input": {
  46. "sec_user_id": "MS4wLjABAAAAW9FWcqS7RdQAWPd2AA5fL_ilmqsIFUCQ_Iym6Yh9_cUa6ZRqVLjVQSUjlHrfXY1Y"
  47. },
  48. "description": "获取达人完整主页数据,建立KOL档案:粉丝规模、获赞总量、内容数量、个人定位"
  49. },
  50. {
  51. "name": "竞品品牌账号分析",
  52. "input": {
  53. "sec_user_id": "竞品品牌抖音sec_user_id"
  54. },
  55. "description": "分析竞品品牌抖音账号的粉丝规模、内容体量、账号认证状态"
  56. }
  57. ],
  58. "workflow": {
  59. "description": "推荐调用链",
  60. "steps": [
  61. "上游: douyin-user-search(keyword) → 搜索达人 → 取 sec_uid",
  62. "上游: douyin-general-search(keyword) → 获取视频列表 → 从 author.sec_uid 获取",
  63. "本步: douyin-user-profile(sec_user_id) → 获取完整账号数据",
  64. "下游: 结合粉丝数/获赞数评估KOL商业价值"
  65. ]
  66. },
  67. "reportMapping": {
  68. "slides": [
  69. "社媒聆听(Slide14)"
  70. ],
  71. "dataPoints": [
  72. "KOL粉丝规模",
  73. "账号总获赞(影响力指标)",
  74. "作品发布频率(活跃度)",
  75. "账号认证类型(品牌/个人/机构)",
  76. "达人个人定位(简介分析)"
  77. ]
  78. },
  79. "timeout": 60000,
  80. "retry": {
  81. "maxAttempts": 3,
  82. "delay": 1500,
  83. "backoffMultiplier": 2
  84. },
  85. "tokenConfig": {
  86. "type": "bearer",
  87. "configFile": "~/.openclaw/voc-credentials.json",
  88. "tokenField": "vocToken",
  89. "currentToken": "r:858b3ee92314d5447d1fc3cdc10462d7",
  90. "resolutionOrder": ["configFile", "currentToken"],
  91. "onMissing": {
  92. "action": "showPaymentQR",
  93. "qrCodeUrl": "https://pwa.fmode.cn/apig-pay.html?user={{user}}&apigid={{apigid}}&fun_id=HOkkX72PMF",
  94. "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
  95. "pollingIntervalMs": 3000,
  96. "pollingTimeoutMs": 300000,
  97. "onPaymentSuccess": "retrySkillWithNewToken",
  98. "title": "扫码开通 VOC-AI 数据服务",
  99. "message": "请扫描下方二维码完成支付,支付成功后将自动获取 Token 并继续执行。"
  100. },
  101. "onBalanceInsufficient": {
  102. "action": "showPaymentQR",
  103. "qrCodeUrl": "https://pwa.fmode.cn/apig-pay.html?user={{user}}&apigid={{apigid}}&fun_id=HOkkX72PMF",
  104. "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
  105. "pollingIntervalMs": 3000,
  106. "pollingTimeoutMs": 300000,
  107. "onPaymentSuccess": "retrySkillWithNewToken",
  108. "title": "VOC-AI Token 余额不足,请扫码充值",
  109. "message": "当前 Token 余额不足,请扫描二维码充值,支付完成后将自动继续执行。"
  110. }
  111. },
  112. "errorHandling": {
  113. "balanceInsufficient": {
  114. "conditions": [
  115. { "responseField": "code", "operator": "in", "value": [-2, -3, -10, 402, 429] },
  116. { "responseField": "msg", "operator": "contains", "value": ["余额不足", "insufficient", "balance", "quota"] },
  117. { "responseField": "message", "operator": "contains", "value": ["余额不足", "insufficient", "balance"] }
  118. ],
  119. "matchMode": "any",
  120. "trigger": "tokenConfig.onBalanceInsufficient"
  121. },
  122. "unauthorized": {
  123. "conditions": [
  124. { "responseField": "code", "operator": "in", "value": [401, 403] },
  125. { "responseField": "msg", "operator": "contains", "value": ["unauthorized", "token", "invalid", "auth"] }
  126. ],
  127. "matchMode": "any",
  128. "trigger": "tokenConfig.onMissing"
  129. }
  130. }
  131. }