api-config.json 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. {
  2. "name": "competitor-discovery",
  3. "displayName": "竞品发现与筛选",
  4. "description": "根据品类关键词和自身品牌信息,自动发现并筛选直接竞品",
  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. "ownBrand": {
  15. "type": "string",
  16. "required": true,
  17. "description": "自身品牌名称"
  18. },
  19. "ownAsins": {
  20. "type": "array",
  21. "items": { "type": "string" },
  22. "required": false,
  23. "description": "自身品牌核心ASIN列表"
  24. },
  25. "competitorCount": {
  26. "type": "integer",
  27. "required": false,
  28. "default": 5,
  29. "description": "需要筛选的竞品数量"
  30. },
  31. "domain": {
  32. "type": "integer",
  33. "required": false,
  34. "default": 1,
  35. "description": "Amazon站点(1=美国)"
  36. },
  37. "priceRange": {
  38. "type": "object",
  39. "required": false,
  40. "properties": {
  41. "min": { "type": "number" },
  42. "max": { "type": "number" }
  43. },
  44. "description": "价格带过滤范围,不传则自动按自身价格±30%"
  45. }
  46. },
  47. "pipeline": [
  48. {
  49. "step": 1,
  50. "name": "搜索品类产品",
  51. "api": {
  52. "service": "SorftimeApiService.searchProductsByQuery",
  53. "endpoint": "/api/ProductQuery",
  54. "method": "POST",
  55. "forwardUrl": "https://server.fmode.cn/api/voc-ecom/forward",
  56. "headers": { "Authorization": "Bearer r:858b3ee92314d5447d1fc3cdc10462d7" },
  57. "requestBody": { "Page": 1, "Query": "1", "QueryType": "7", "Pattern": "${categoryKeyword}" },
  58. "queryParams": { "domain": "${domain}" }
  59. },
  60. "output": "searchResults",
  61. "responseExtract": "extractProductList(resp) → Array<{ Asin, Title, Price, Rating, RatingsCount, MonthlySales, Brand, BSR, Photo }>"
  62. },
  63. {
  64. "step": 2,
  65. "name": "查找相似产品",
  66. "condition": "ownAsins.length > 0",
  67. "api": {
  68. "service": "SorftimeApiService.getSimilarProducts",
  69. "endpoint": "/api/SimilarProductRealtimeRequest",
  70. "method": "POST",
  71. "requestBody": { "ASIN": "${ownAsins[0]}" },
  72. "queryParams": { "domain": "${domain}" },
  73. "note": "异步任务:需后续调用 /api/SimilarProductRealtimeRequestStatusQuery 和 /api/SimilarProductRealtimeRequestCollection"
  74. },
  75. "output": "similarResults"
  76. },
  77. {
  78. "step": 3,
  79. "name": "关键词排名产品",
  80. "api": {
  81. "service": "SorftimeApiService.getKeywordProductRanking",
  82. "endpoint": "/api/KeywordProductRanking",
  83. "method": "POST",
  84. "requestBody": { "keyword": "${categoryKeyword}" },
  85. "queryParams": { "domain": "${domain}" }
  86. },
  87. "output": "rankingResults",
  88. "responseExtract": "Array<{ Asin, Title, Rank, Price, Rating, RatingsCount, IsSponsored }>"
  89. },
  90. {
  91. "step": 4,
  92. "name": "合并去重+竞品评分筛选",
  93. "type": "compute",
  94. "logic": "mergeAndScore(searchResults, similarResults, rankingResults, { ownBrand, priceRange, competitorCount })",
  95. "algorithm": {
  96. "merge": "按ASIN去重合并三个来源的产品",
  97. "exclude": "排除ownBrand的产品",
  98. "filter": "价格在ownPrice±30%范围内 && 评分>=3.5 && 同品类",
  99. "score": "matchScore = priceProximity*0.3 + ratingProximity*0.2 + salesProximity*0.2 + rankInKeyword*0.15 + isSimilar*0.15",
  100. "sort": "按matchScore降序,取top competitorCount个",
  101. "brandGrouping": "按Brand字段分组,统计每个品牌的SKU数和总销量,用于排除自有品牌和识别竞品品牌"
  102. },
  103. "output": "filteredCompetitors"
  104. },
  105. {
  106. "step": 5,
  107. "name": "批量获取竞品详情",
  108. "forEach": "filteredCompetitors",
  109. "api": {
  110. "service": "SorftimeApiService.getProductDetail",
  111. "endpoint": "/api/ProductRequest",
  112. "method": "POST",
  113. "requestBody": { "ASIN": "${competitor.asin}", "Trend": 1, "QueryTrendStartDt": "", "QueryTrendEndDt": "" },
  114. "queryParams": { "domain": "${domain}" }
  115. },
  116. "output": "competitorDetails",
  117. "responseExtract": "{ Title, Brand, SalesPrice, Ratings, RatingsCount, BSR, Category, Photo, Feature, Description, VariationASIN, MonthlySales }"
  118. },
  119. {
  120. "step": 6,
  121. "name": "竞争格局分析",
  122. "type": "compute",
  123. "logic": "analyzeCompetitiveLandscape(filteredCompetitors, competitorDetails)",
  124. "algorithm": {
  125. "cr5": {
  126. "method": "按品牌汇总销量 → top5品牌销量占比 = top5Sales/totalSales*100",
  127. "fallback": "品牌数据不足时默认CR5=30(中等)"
  128. },
  129. "monopolyLevel": {
  130. "low": "CR5<30 → '垄断度低,新卖家突围机会充足'",
  131. "medium": "CR5 30-60 → '中等垄断,需差异化策略'",
  132. "high": "CR5>60 → '垄断严重,不建议正面硬刚'"
  133. },
  134. "brandComparison": {
  135. "method": "按Brand分组 → 统计skus/totalSales/totalPrice/totalRating → 取top5品牌",
  136. "output": "Array<{ brand, skus, avgSales, avgPrice, avgRating }>"
  137. },
  138. "differentiationAdvice": {
  139. "highMonopoly": "切入细分人群赛道,避开头部正面竞争",
  140. "lowMonopoly": "新品有充足突围空间",
  141. "always": "打造独家设计款,注册外观专利,构建长期溢价能力"
  142. },
  143. "attackStrategy": "针对TOP竞品的核心差评痛点打造本店独家卖点; 在Listing/主图中做直接对标,抢夺竞品精准用户"
  144. },
  145. "output": "competitiveLandscape"
  146. }
  147. ],
  148. "response": {
  149. "type": "object",
  150. "properties": {
  151. "competitors": {
  152. "type": "array",
  153. "description": "筛选出的直接竞品列表",
  154. "items": {
  155. "type": "object",
  156. "properties": {
  157. "asin": { "type": "string" },
  158. "title": { "type": "string" },
  159. "brand": { "type": "string" },
  160. "price": { "type": "number" },
  161. "rating": { "type": "number" },
  162. "ratingsCount": { "type": "integer" },
  163. "monthlySales": { "type": "integer" },
  164. "bsr": { "type": "integer" },
  165. "category": { "type": "string" },
  166. "matchScore": { "type": "number" },
  167. "matchReasons": { "type": "array", "items": { "type": "string" } }
  168. }
  169. }
  170. },
  171. "searchMeta": {
  172. "type": "object",
  173. "properties": {
  174. "totalCandidates": { "type": "integer" },
  175. "filteredCount": { "type": "integer" },
  176. "filterCriteria": { "type": "object" }
  177. }
  178. },
  179. "competitiveLandscape": {
  180. "type": "object",
  181. "description": "竞争格局分析(来自computeCompetition算法)",
  182. "properties": {
  183. "cr5": { "type": "number", "description": "Top5品牌销量集中度(0-100)" },
  184. "monopolyLevel": { "type": "string", "enum": ["low", "medium", "high"] },
  185. "monopolyLabel": { "type": "string" },
  186. "brandComparison": {
  187. "type": "array",
  188. "items": {
  189. "type": "object",
  190. "properties": {
  191. "brand": { "type": "string" },
  192. "skus": { "type": "integer" },
  193. "avgSales": { "type": "integer" },
  194. "avgPrice": { "type": "number" },
  195. "avgRating": { "type": "number" }
  196. }
  197. }
  198. },
  199. "differentiationAdvice": { "type": "array", "items": { "type": "string" } },
  200. "attackStrategy": { "type": "array", "items": { "type": "string" } }
  201. }
  202. }
  203. }
  204. },
  205. "timeout": 120000,
  206. "retry": {
  207. "maxAttempts": 2,
  208. "delay": 2000,
  209. "backoffMultiplier": 2
  210. }
  211. }