api-config.json 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. {
  2. "name": "competitor-product-comparison",
  3. "displayName": "竞品产品对比",
  4. "description": "对自身产品与竞品进行多维度横向对比,生成5维健康度仪表盘并标注机会/风险标签",
  5. "category": "competitor-analysis",
  6. "version": "1.3.0",
  7. "type": "orchestration",
  8. "parameters": {
  9. "ownAsins": {
  10. "type": "array",
  11. "items": { "type": "string" },
  12. "required": true,
  13. "description": "自身品牌ASIN列表"
  14. },
  15. "competitorAsins": {
  16. "type": "array",
  17. "items": { "type": "string" },
  18. "required": true,
  19. "description": "竞品ASIN列表(来自 competitor-discovery 输出)"
  20. },
  21. "domain": {
  22. "type": "integer",
  23. "required": false,
  24. "default": 1,
  25. "description": "Amazon站点(1=美国)"
  26. },
  27. "dimensions": {
  28. "type": "array",
  29. "items": { "type": "string" },
  30. "required": false,
  31. "description": "对比维度,默认全部"
  32. }
  33. },
  34. "pipeline": [
  35. {
  36. "step": 1,
  37. "name": "批量获取所有ASIN产品详情",
  38. "forEach": "ownAsins + competitorAsins",
  39. "api": {
  40. "service": "SorftimeApiService.getProductDetail",
  41. "endpoint": "/api/ProductRequest",
  42. "method": "POST",
  43. "forwardUrl": "https://server.fmode.cn/api/voc-ecom/forward",
  44. "headers": { "Authorization": "Bearer r:858b3ee92314d5447d1fc3cdc10462d7" },
  45. "requestBody": { "ASIN": "${asin}", "Trend": 1, "QueryTrendStartDt": "", "QueryTrendEndDt": "" },
  46. "queryParams": { "domain": "${domain}" }
  47. },
  48. "output": "allProductDetails",
  49. "responseExtract": "{ Title, Brand, SalesPrice, Ratings, RatingsCount, BSR, Category, Photo, Feature, Description, VariationASIN, MonthlySales }"
  50. },
  51. {
  52. "step": 2,
  53. "name": "批量获取销量数据",
  54. "forEach": "ownAsins + competitorAsins",
  55. "api": {
  56. "service": "SorftimeApiService.getAsinSalesVolume",
  57. "endpoint": "/api/AsinSalesVolume",
  58. "method": "POST",
  59. "requestBody": { "ASIN": "${asin}" },
  60. "queryParams": { "domain": "${domain}" }
  61. },
  62. "output": "salesData"
  63. },
  64. {
  65. "step": 3,
  66. "name": "多维度对比矩阵计算",
  67. "type": "compute",
  68. "logic": "buildComparisonMatrix(allProductDetails, salesData, ownAsins)",
  69. "algorithm": {
  70. "dimensions": {
  71. "price": "售价、历史价格趋势、折扣力度",
  72. "rating": "平均分、评论数、星级分布(1-5星占比)",
  73. "sales": "月销量、日销量趋势、BSR排名",
  74. "product": "标题关键词、卖点Feature、图片数量、A+页面",
  75. "brand": "品牌店铺、FBA/FBM、发货地",
  76. "variant": "变体数量、尺寸/颜色选项"
  77. },
  78. "scoring": "各维度竞争力得分(0-100)"
  79. },
  80. "output": "comparisonMatrix"
  81. },
  82. {
  83. "step": 4,
  84. "name": "5维健康度评估",
  85. "type": "compute",
  86. "logic": "calcHealthDashboard(comparisonMatrix, ownAsins)",
  87. "algorithm": {
  88. "weights": {
  89. "pricingCompetitiveness": 0.2,
  90. "ratingHealth": 0.25,
  91. "trafficRank": 0.2,
  92. "salesEfficiency": 0.15,
  93. "growthPotential": 0.2
  94. },
  95. "tags": "每个产品生成机会标签 + 风险标签",
  96. "coreShortcoming": "识别最低分维度作为核心短板"
  97. },
  98. "output": "healthDashboard"
  99. }
  100. ],
  101. "response": {
  102. "type": "object",
  103. "properties": {
  104. "comparisonMatrix": {
  105. "type": "array",
  106. "description": "对比矩阵",
  107. "items": {
  108. "type": "object",
  109. "properties": {
  110. "asin": { "type": "string" },
  111. "brand": { "type": "string" },
  112. "isOwn": { "type": "boolean" },
  113. "metrics": {
  114. "type": "object",
  115. "properties": {
  116. "price": { "type": "object", "properties": { "value": { "type": "number" }, "score": { "type": "integer" } } },
  117. "rating": { "type": "object", "properties": { "value": { "type": "number" }, "score": { "type": "integer" } } },
  118. "monthlySales": { "type": "object", "properties": { "value": { "type": "integer" }, "score": { "type": "integer" } } },
  119. "reviewCount": { "type": "object", "properties": { "value": { "type": "integer" }, "score": { "type": "integer" } } },
  120. "bsr": { "type": "object", "properties": { "value": { "type": "integer" }, "score": { "type": "integer" } } },
  121. "featureCount": { "type": "object", "properties": { "value": { "type": "integer" }, "score": { "type": "integer" } } },
  122. "variantCount": { "type": "object", "properties": { "value": { "type": "integer" }, "score": { "type": "integer" } } }
  123. }
  124. },
  125. "overallScore": { "type": "number" }
  126. }
  127. }
  128. },
  129. "advantages": { "type": "array", "items": { "type": "string" } },
  130. "gaps": { "type": "array", "items": { "type": "string" } },
  131. "recommendation": { "type": "string" },
  132. "healthDashboard": {
  133. "type": "object",
  134. "description": "5维健康度仪表盘,key为ASIN",
  135. "additionalProperties": {
  136. "type": "object",
  137. "properties": {
  138. "overallScore": { "type": "number" },
  139. "dimensions": {
  140. "type": "object",
  141. "properties": {
  142. "pricingCompetitiveness": { "type": "integer" },
  143. "ratingHealth": { "type": "integer" },
  144. "trafficRank": { "type": "integer" },
  145. "salesEfficiency": { "type": "integer" },
  146. "growthPotential": { "type": "integer" }
  147. }
  148. },
  149. "opportunityTags": { "type": "array", "items": { "type": "string" } },
  150. "riskTags": { "type": "array", "items": { "type": "string" } },
  151. "coreShortcoming": { "type": "string" }
  152. }
  153. }
  154. }
  155. }
  156. },
  157. "timeout": 120000,
  158. "retry": {
  159. "maxAttempts": 2,
  160. "delay": 2000,
  161. "backoffMultiplier": 2
  162. }
  163. }