api-config.json 8.1 KB

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