api-config.json 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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": ["configFile", "currentToken"],
  102. "onMissing": {
  103. "action": "showPaymentQR",
  104. "qrCodeUrl": "https://pwa.fmode.cn/apig-pay.html?user={{user}}&apigid={{apigid}}&fun_id=HOkkX72PMF",
  105. "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
  106. "pollingIntervalMs": 3000,
  107. "pollingTimeoutMs": 300000,
  108. "onPaymentSuccess": "retrySkillWithNewToken",
  109. "title": "扫码开通 VOC-AI 数据服务",
  110. "message": "请扫描下方二维码完成支付,支付成功后将自动获取 Token 并继续执行。"
  111. },
  112. "onBalanceInsufficient": {
  113. "action": "showPaymentQR",
  114. "qrCodeUrl": "https://pwa.fmode.cn/apig-pay.html?user={{user}}&apigid={{apigid}}&fun_id=HOkkX72PMF",
  115. "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
  116. "pollingIntervalMs": 3000,
  117. "pollingTimeoutMs": 300000,
  118. "onPaymentSuccess": "retrySkillWithNewToken",
  119. "title": "VOC-AI Token 余额不足,请扫码充值",
  120. "message": "当前 Token 余额不足,请扫描二维码充值,支付完成后将自动继续执行。"
  121. }
  122. },
  123. "errorHandling": {
  124. "balanceInsufficient": {
  125. "conditions": [
  126. { "responseField": "code", "operator": "in", "value": [-2, -3, -10, 402, 429] },
  127. { "responseField": "msg", "operator": "contains", "value": ["余额不足", "insufficient", "balance", "quota"] },
  128. { "responseField": "message", "operator": "contains", "value": ["余额不足", "insufficient", "balance"] }
  129. ],
  130. "matchMode": "any",
  131. "trigger": "tokenConfig.onBalanceInsufficient"
  132. },
  133. "unauthorized": {
  134. "conditions": [
  135. { "responseField": "code", "operator": "in", "value": [401, 403] },
  136. { "responseField": "msg", "operator": "contains", "value": ["unauthorized", "token", "invalid", "auth"] }
  137. ],
  138. "matchMode": "any",
  139. "trigger": "tokenConfig.onMissing"
  140. }
  141. }
  142. }