api-config.json 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. {
  2. "name": "asin-reverse-keywords",
  3. "displayName": "ASIN 反查关键词",
  4. "description": "根据 ASIN 反向查询该产品关联的搜索关键词列表,包括搜索排名、搜索量等。用于竞品关键词策略分析、广告关键词挖掘。",
  5. "category": "voc",
  6. "version": "1.3.0",
  7. "endpoint": {
  8. "method": "POST",
  9. "url": "https://server.fmode.cn/api/voc-ecom/forward",
  10. "headers": {
  11. "Content-Type": "application/json",
  12. "Authorization": "Bearer {{vocToken}}"
  13. }
  14. },
  15. "parameters": {
  16. "type": "object",
  17. "required": [
  18. "ASIN"
  19. ],
  20. "properties": {
  21. "ASIN": {
  22. "type": "string",
  23. "description": "Amazon 产品 ASIN(10位大写字母数字)",
  24. "pattern": "^[A-Z0-9]{10}$"
  25. },
  26. "domain": {
  27. "type": "integer",
  28. "description": "Amazon 站点 ID: 1=amazon.com",
  29. "default": 1
  30. }
  31. }
  32. },
  33. "requestTransform": {
  34. "template": {
  35. "path": "/api/ASINRequestKeyword",
  36. "method": "POST",
  37. "query": {
  38. "domain": "{{domain}}"
  39. },
  40. "body": {
  41. "ASIN": "{{ASIN}}"
  42. }
  43. }
  44. },
  45. "response": {
  46. "type": "array",
  47. "description": "关键词列表",
  48. "items": {
  49. "type": "object",
  50. "properties": {
  51. "Keyword": {
  52. "type": "string",
  53. "description": "关键词"
  54. },
  55. "SearchVolume": {
  56. "type": "integer",
  57. "description": "月搜索量"
  58. },
  59. "Rank": {
  60. "type": "integer",
  61. "description": "该ASIN在此关键词下的排名"
  62. },
  63. "CompetitorCount": {
  64. "type": "integer",
  65. "description": "竞争产品数"
  66. }
  67. }
  68. }
  69. },
  70. "usageExamples": [
  71. {
  72. "name": "反查竞品关键词",
  73. "input": {
  74. "ASIN": "B0B24QJ217",
  75. "domain": 1
  76. },
  77. "description": "查看 COCORRINA Reed Diffuser 排名靠前的搜索关键词"
  78. }
  79. ],
  80. "reportMapping": {
  81. "slides": [
  82. "广告关键词引擎(Slide15)"
  83. ],
  84. "dataPoints": [
  85. "竞品关键词列表",
  86. "搜索排名",
  87. "搜索量"
  88. ]
  89. },
  90. "timeout": 60000,
  91. "retry": {
  92. "maxAttempts": 3,
  93. "delay": 1000,
  94. "backoffMultiplier": 2
  95. },
  96. "tokenConfig": {
  97. "type": "bearer",
  98. "configFile": "~/.openclaw/voc-credentials.json",
  99. "tokenField": "vocToken",
  100. "currentToken": "r:858b3ee92314d5447d1fc3cdc10462d7",
  101. "resolutionOrder": [
  102. "configFile",
  103. "currentToken"
  104. ],
  105. "apigId": "Vo3ROWEvDy",
  106. "paymentUrlResolution": {
  107. "description": "动态构建充值URL:通过当前token查出用户objectId,拼接到充值页面",
  108. "steps": [
  109. "1. 从 voc-credentials.json 或 currentToken 获取当前 session token",
  110. "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
  111. "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  112. "4. 将该URL展示给用户,引导扫码支付"
  113. ],
  114. "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
  115. "userResolveHeaders": {
  116. "X-Parse-Application-Id": "ncloudmaster",
  117. "X-Parse-Session-Token": "{vocToken}"
  118. },
  119. "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/",
  120. "paymentParams": {
  121. "user": "{resolvedUserId}",
  122. "apigid": "Vo3ROWEvDy",
  123. "fun_id": "HOkkX72PMF"
  124. },
  125. "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
  126. },
  127. "onMissing": {
  128. "action": "resolveUserThenShowPayment",
  129. "title": "扫码开通 VOC-AI 数据服务",
  130. "message": "此 Skill 需要有效的 API Token。请按以下步骤操作:\n1. 如果你已有 Token,请告诉我,我会保存到 ~/.openclaw/voc-credentials.json\n2. 如果没有 Token,我会引导你扫码充值开通"
  131. },
  132. "onBalanceInsufficient": {
  133. "action": "resolveUserThenShowPayment",
  134. "title": "VOC-AI Token 余额不足,请扫码充值",
  135. "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
  136. }
  137. },
  138. "errorHandling": {
  139. "balanceInsufficient": {
  140. "conditions": [
  141. {
  142. "responseField": "code",
  143. "operator": "in",
  144. "value": [
  145. -2,
  146. -3,
  147. -10,
  148. 402,
  149. 429
  150. ]
  151. },
  152. {
  153. "responseField": "msg",
  154. "operator": "contains",
  155. "value": [
  156. "余额不足",
  157. "insufficient",
  158. "balance",
  159. "quota"
  160. ]
  161. },
  162. {
  163. "responseField": "message",
  164. "operator": "contains",
  165. "value": [
  166. "余额不足",
  167. "insufficient",
  168. "balance"
  169. ]
  170. }
  171. ],
  172. "matchMode": "any",
  173. "trigger": "tokenConfig.onBalanceInsufficient"
  174. },
  175. "unauthorized": {
  176. "conditions": [
  177. {
  178. "responseField": "code",
  179. "operator": "in",
  180. "value": [
  181. 401,
  182. 403
  183. ]
  184. },
  185. {
  186. "responseField": "msg",
  187. "operator": "contains",
  188. "value": [
  189. "unauthorized",
  190. "token",
  191. "invalid",
  192. "auth"
  193. ]
  194. }
  195. ],
  196. "matchMode": "any",
  197. "trigger": "tokenConfig.onMissing"
  198. }
  199. }
  200. }