api-config.json 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. {
  2. "name": "competitor-pricing-analysis",
  3. "displayName": "竞品定价策略分析",
  4. "description": "分析竞品定价策略,包括5分位价格带分布、黄金价格带评分、毛利估算、促销建议和盈亏平衡销量分析",
  5. "category": "competitor-analysis",
  6. "version": "1.3.0",
  7. "type": "orchestration",
  8. "parameters": {
  9. "categoryKeyword": {
  10. "type": "string",
  11. "required": true,
  12. "description": "品类关键词"
  13. },
  14. "competitorAsins": {
  15. "type": "array",
  16. "items": { "type": "string" },
  17. "required": true,
  18. "description": "竞品ASIN列表"
  19. },
  20. "ownPrice": {
  21. "type": "number",
  22. "required": false,
  23. "description": "自身产品当前价格,用于对比定位"
  24. },
  25. "domain": {
  26. "type": "integer",
  27. "required": false,
  28. "default": 1,
  29. "description": "Amazon站点(1=美国)"
  30. }
  31. },
  32. "pipeline": [
  33. {
  34. "step": 1,
  35. "name": "搜索品类Top100产品价格数据",
  36. "api": {
  37. "service": "SorftimeApiService.searchProductsByQuery",
  38. "endpoint": "/api/ProductQuery",
  39. "method": "POST",
  40. "forwardUrl": "https://server.fmode.cn/api/voc-ecom/forward",
  41. "headers": { "Authorization": "Bearer r:858b3ee92314d5447d1fc3cdc10462d7" },
  42. "requestBody": { "Page": 1, "Query": "1", "QueryType": "7", "Pattern": "${categoryKeyword}" },
  43. "queryParams": { "domain": "${domain}" }
  44. },
  45. "output": "categoryProducts",
  46. "responseExtract": "Array<{ Asin, Title, Price, Rating, RatingsCount, MonthlySales, Brand, BSR }>"
  47. },
  48. {
  49. "step": 2,
  50. "name": "批量获取竞品详细定价信息",
  51. "forEach": "competitorAsins",
  52. "api": {
  53. "service": "SorftimeApiService.getProductDetail",
  54. "endpoint": "/api/ProductRequest",
  55. "method": "POST",
  56. "forwardUrl": "https://server.fmode.cn/api/voc-ecom/forward",
  57. "headers": { "Authorization": "Bearer r:858b3ee92314d5447d1fc3cdc10462d7" },
  58. "requestBody": { "ASIN": "${asin}", "Trend": 1, "QueryTrendStartDt": "", "QueryTrendEndDt": "" },
  59. "queryParams": { "domain": "${domain}" }
  60. },
  61. "output": "competitorDetails",
  62. "responseExtract": "{ Title, Brand, SalesPrice, ListPrice, CouponInfo, FBAFee, Ratings, RatingsCount, MonthlySales }"
  63. },
  64. {
  65. "step": 3,
  66. "name": "获取竞品历史价格趋势",
  67. "forEach": "competitorAsins",
  68. "api": {
  69. "service": "SorftimeApiService.getMonitorData",
  70. "endpoint": "/api/MonitorQuery",
  71. "method": "POST",
  72. "forwardUrl": "https://server.fmode.cn/api/voc-ecom/forward",
  73. "headers": { "Authorization": "Bearer r:858b3ee92314d5447d1fc3cdc10462d7" },
  74. "requestBody": { "ASIN": "${asin}" },
  75. "queryParams": { "domain": "${domain}" }
  76. },
  77. "output": "priceHistory",
  78. "responseExtract": "{ PriceHistory, RankHistory }"
  79. },
  80. {
  81. "step": 4,
  82. "name": "5分位价格带分析",
  83. "type": "compute",
  84. "logic": "analyzePriceBands(categoryProducts)",
  85. "algorithm": {
  86. "quintile": "按P20/P40/P60/P80划分为低价带/中低/黄金中价/中高/高价带",
  87. "perBand": "每带统计: skuCount, avgSales, avgRating, avgBsr",
  88. "goldenBandScore": "bandScore = avgSales×0.5 + avgRating×20 + (skuCount>0?10:0),最高分为量利平衡最优带"
  89. },
  90. "output": "priceBands"
  91. },
  92. {
  93. "step": 5,
  94. "name": "竞品定价策略识别+毛利估算",
  95. "type": "compute",
  96. "logic": "analyzeCompetitorPricing(competitorDetails, priceHistory, priceBands, ownPrice)",
  97. "algorithm": {
  98. "pricingStrategy": "渗透定价(低于P20)/跟随定价(黄金带内)/溢价定价(高于P80)",
  99. "marginEstimate": "15%佣金+$5FBA+30%采购成本 → grossMargin%, 盈亏平衡销量",
  100. "ownPosition": "自身价格在哪个价格带的哪个百分位",
  101. "optimalPrice": "goldenBandMin + (goldenBandMax-goldenBandMin)*0.6 * min(1.15, max(0.85, selfRating/bandAvgRating))",
  102. "promotionAdvice": "价格战风险检测,优先多件折扣/满减替代降价"
  103. },
  104. "output": "pricingAnalysis"
  105. }
  106. ],
  107. "response": {
  108. "type": "object",
  109. "properties": {
  110. "priceBands": {
  111. "type": "array",
  112. "description": "5分位价格带分布",
  113. "items": {
  114. "type": "object",
  115. "properties": {
  116. "range": { "type": "string" },
  117. "label": { "type": "string" },
  118. "productCount": { "type": "integer" },
  119. "avgRating": { "type": "number" },
  120. "avgSales": { "type": "integer" },
  121. "isGolden": { "type": "boolean" }
  122. }
  123. }
  124. },
  125. "competitorPricing": {
  126. "type": "array",
  127. "description": "竞品定价详情",
  128. "items": {
  129. "type": "object",
  130. "properties": {
  131. "asin": { "type": "string" },
  132. "brand": { "type": "string" },
  133. "currentPrice": { "type": "number" },
  134. "listPrice": { "type": "number" },
  135. "coupon": { "type": "number" },
  136. "pricingStrategy": { "type": "string" },
  137. "priceHistory": { "type": "array" },
  138. "estimatedMargin": { "type": "number" }
  139. }
  140. }
  141. },
  142. "ownPricePosition": {
  143. "type": "object",
  144. "properties": {
  145. "band": { "type": "string" },
  146. "percentile": { "type": "number" },
  147. "competitiveness": { "type": "string" }
  148. }
  149. },
  150. "recommendation": {
  151. "type": "object",
  152. "properties": {
  153. "optimalRange": { "type": "array", "items": { "type": "number" } },
  154. "goldenBand": { "type": "string" },
  155. "strategy": { "type": "string" },
  156. "reasons": { "type": "array", "items": { "type": "string" } }
  157. }
  158. },
  159. "marginEstimate": {
  160. "type": "object",
  161. "properties": {
  162. "currentMargin": { "type": "number" },
  163. "suggestedMargin": { "type": "number" },
  164. "breakEvenSales": { "type": "integer" }
  165. }
  166. },
  167. "promotionAdvice": { "type": "array", "items": { "type": "string" } }
  168. }
  169. },
  170. "timeout": 120000,
  171. "retry": {
  172. "maxAttempts": 2,
  173. "delay": 2000,
  174. "backoffMultiplier": 2
  175. }
  176. }