api-config.json 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. {
  2. "name": "competitor-bsr-tracking",
  3. "displayName": "竞品BSR排名追踪",
  4. "description": "追踪竞品BSR/销量/价格变化趋势,生成增长路径分析和风险预警汇总",
  5. "category": "competitor-analysis",
  6. "version": "1.1.0",
  7. "type": "orchestration",
  8. "parameters": {
  9. "competitorAsins": {
  10. "type": "array",
  11. "items": { "type": "string" },
  12. "required": true,
  13. "description": "竞品ASIN列表"
  14. },
  15. "domain": {
  16. "type": "integer",
  17. "required": false,
  18. "default": 1,
  19. "description": "Amazon站点(1=美国)"
  20. }
  21. },
  22. "pipeline": [
  23. {
  24. "step": 1,
  25. "name": "批量获取竞品监控数据",
  26. "forEach": "competitorAsins",
  27. "api": {
  28. "service": "SorftimeApiService.getMonitorData",
  29. "endpoint": "/api/MonitorQuery",
  30. "method": "POST",
  31. "forwardUrl": "https://server.fmode.cn/api/voc/forward",
  32. "headers": { "Authorization": "Bearer r:858b3ee92314d5447d1fc3cdc10462d7" },
  33. "requestBody": { "ASIN": "${asin}" },
  34. "queryParams": { "domain": "${domain}" }
  35. },
  36. "output": "monitorData",
  37. "responseExtract": "{ PriceHistory, RankHistory, RatingHistory, ReviewCountHistory, SellerCount }"
  38. },
  39. {
  40. "step": 2,
  41. "name": "批量获取竞品当前状态",
  42. "forEach": "competitorAsins",
  43. "api": {
  44. "service": "SorftimeApiService.getProductDetail",
  45. "endpoint": "/api/ProductRequest",
  46. "method": "POST",
  47. "forwardUrl": "https://server.fmode.cn/api/voc/forward",
  48. "headers": { "Authorization": "Bearer r:858b3ee92314d5447d1fc3cdc10462d7" },
  49. "requestBody": { "ASIN": "${asin}", "Trend": 1, "QueryTrendStartDt": "", "QueryTrendEndDt": "" },
  50. "queryParams": { "domain": "${domain}" }
  51. },
  52. "output": "competitorDetails",
  53. "responseExtract": "{ Title, Brand, SalesPrice, Ratings, RatingsCount, BSR, MonthlySales, Category }"
  54. },
  55. {
  56. "step": 3,
  57. "name": "BSR/销量/价格趋势分析",
  58. "type": "compute",
  59. "logic": "analyzeTrends(monitorData, competitorDetails)",
  60. "algorithm": {
  61. "bsrTrend": "近7/14/30天BSR变化方向和幅度百分比",
  62. "salesTrend": "日销量/月销量趋势,环比增减百分比",
  63. "priceChange": "价格调整记录,是否在做促销",
  64. "ratingChange": "评分和评论数的变化趋势",
  65. "alerts": "识别异常变化: BSR大幅下降=销量暴涨, 突然降价=促销战"
  66. },
  67. "output": "tracking"
  68. },
  69. {
  70. "step": 4,
  71. "name": "增长路径分析",
  72. "type": "compute",
  73. "logic": "analyzeGrowthPath(tracking, competitorDetails)",
  74. "algorithm": {
  75. "tierClassification": "头部(Top10%)/腰部(10-40%)/尾部(40%+)",
  76. "dailySalesGap": "距上一层级门槛还差多少日销",
  77. "skuAdvice": "聚焦核心SKU打爆款建议",
  78. "keywordAdvice": "主攻长尾词提升排名建议"
  79. },
  80. "output": "growthPath"
  81. },
  82. {
  83. "step": 5,
  84. "name": "风险预警汇总",
  85. "type": "compute",
  86. "logic": "generateRiskAlerts(tracking, competitorDetails)",
  87. "algorithm": {
  88. "bsrRisk": "BSR连续下降检测",
  89. "ratingRisk": "评分下滑检测",
  90. "priceWarRisk": "价格战风险检测",
  91. "inventoryRisk": "库存风险推断",
  92. "complianceRisk": "合规风险检测"
  93. },
  94. "output": "riskAlerts"
  95. }
  96. ],
  97. "response": {
  98. "type": "object",
  99. "properties": {
  100. "tracking": {
  101. "type": "array",
  102. "description": "竞品追踪数据列表",
  103. "items": {
  104. "type": "object",
  105. "properties": {
  106. "asin": { "type": "string" },
  107. "brand": { "type": "string" },
  108. "currentBsr": { "type": "integer" },
  109. "bsrTrend": { "type": "object", "properties": { "7d": { "type": "number" }, "14d": { "type": "number" }, "30d": { "type": "number" } } },
  110. "salesTrend": { "type": "object", "properties": { "7d": { "type": "number" }, "14d": { "type": "number" }, "30d": { "type": "number" } } },
  111. "priceChange": { "type": "object", "properties": { "current": { "type": "number" }, "previous": { "type": "number" }, "changePercent": { "type": "number" } } },
  112. "ratingChange": { "type": "object", "properties": { "current": { "type": "number" }, "previous": { "type": "number" }, "newReviews": { "type": "integer" } } },
  113. "alerts": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "severity": { "type": "string" }, "message": { "type": "string" } } } }
  114. }
  115. }
  116. },
  117. "summary": {
  118. "type": "object",
  119. "properties": {
  120. "mostActive": { "type": "string" },
  121. "biggestThreat": { "type": "string" },
  122. "opportunityWindow": { "type": "string" }
  123. }
  124. },
  125. "growthPath": {
  126. "type": "object",
  127. "properties": {
  128. "currentTier": { "type": "string" },
  129. "nextTierThreshold": { "type": "object", "properties": { "dailySales": { "type": "integer" }, "gap": { "type": "integer" } } },
  130. "skuAdvice": { "type": "string" },
  131. "keywordAdvice": { "type": "string" }
  132. }
  133. },
  134. "riskAlerts": {
  135. "type": "array",
  136. "items": {
  137. "type": "object",
  138. "properties": {
  139. "level": { "type": "string", "enum": ["high", "medium", "low"] },
  140. "title": { "type": "string" },
  141. "description": { "type": "string" }
  142. }
  143. }
  144. }
  145. }
  146. },
  147. "timeout": 60000,
  148. "retry": {
  149. "maxAttempts": 2,
  150. "delay": 2000,
  151. "backoffMultiplier": 2
  152. }
  153. }