apify-ecommerce
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseE-Commerce Cluster
电商集群
Answer natural language e-commerce questions by routing to the right Apify Actor and delivering a synthesized answer.
通过将请求路由至合适的Apify Actor并生成整合后的回答,来处理自然语言形式的电商相关问题。
Prerequisites
前置条件
(No need to check it upfront)
- file with
.envAPIFY_TOKEN - Node.js 20.6+ (for native support)
--env-file - CLI tool:
mcpcnpm install -g @apify/mcpc
(无需预先检查)
- 包含的
APIFY_TOKEN文件.env - Node.js 20.6+(支持原生功能)
--env-file - CLI工具:
mcpcnpm install -g @apify/mcpc
Workflow
工作流程
Copy this checklist and track progress:
Task Progress:
- [ ] Step 1: Detect intent and select Actor
- [ ] Step 2: Fetch Actor schema via mcpc
- [ ] Step 3: Ask user preferences (format, result count)
- [ ] Step 4: Run the Actor
- [ ] Step 5: Analyze results and deliver synthesized answer复制以下清单并跟踪进度:
任务进度:
- [ ] 步骤1:检测意图并选择Actor
- [ ] 步骤2:通过mcpc获取Actor schema
- [ ] 步骤3:询问用户偏好(格式、结果数量)
- [ ] 步骤4:运行Actor
- [ ] 步骤5:分析结果并生成整合后的回答Step 1: Detect Intent and Select Actor
步骤1:检测意图并选择Actor
Classify the user's message into an intent, then pick the right Actor.
Intent signals:
| Signals in user message | Intent |
|---|---|
| price, cost, cheapest, compare prices, pricing | |
| review, rating, sentiment, stars, feedback | |
| bestseller, top selling, most popular, trending | |
| seller, vendor, reseller, who sells | |
| all products from, scrape store, full catalog | |
| what platform, built on, tech stack, Shopify or WooCommerce | |
| SEO, listing quality, product page audit | |
| competitor funnel, competitor pricing, conversion elements | |
| search intent, keyword intent, SERP intent | |
| match products, same product on different platforms | |
| restaurant, food delivery, DoorDash, UberEats, TheFork | |
| enrich store, store metadata, store list | |
| event, concert, ticket, Eventbrite | |
| property, real estate, house listing, Realtor | |
| Facebook ads, Meta ads, ad library, competitor ads | |
| classified, Craigslist, used item for sale | |
| car, used car, vehicle, automotive, Webmotors | |
| pins, inspiration, Pinterest boards, visual search, Pinterest trends | |
| TikTok Shop, TikTok store, TikTok creator | |
| website for sale, domain for sale, Flippa | |
If multiple intents are detected, ask: "Do you want [intent A] or [intent B]?"
Actor routing table — always try Primary first, switch to Fallback only if it fails or returns 0 results:
| Intent | Platform | Primary Actor | Fallback Actor |
|---|---|---|---|
| Amazon / Walmart / generic | | — |
| eBay | | |
| Etsy | | |
| Google Shopping | | |
| Facebook Marketplace | | |
| SHEIN | | |
| Lazada | | |
| Canadian Tire | | |
| Tesco | | |
| Shopify | | |
| WooCommerce | | |
| Amazon / Walmart / generic | | |
| Trustpilot | | |
| TheFork | | |
| Amazon | | |
| Amazon | | |
| eBay | | |
| Shopify | | |
| WooCommerce | | |
| Amazon | | |
| Flippa | | |
| any | | |
| any | | |
| any | | |
| any | | |
| any | | |
| any | | |
| DoorDash | | |
| UberEats | | |
| TheFork | | |
| Facebook / Meta | | |
| Craigslist | | |
| Webmotors | | |
| Eventbrite | | |
| Realtor.com | | |
| | | |
| TikTok Shop | | |
| Flippa | | |
将用户消息分类为特定意图,然后选择对应的Actor。
意图信号:
| 用户消息中的信号 | 意图 |
|---|---|
| price, cost, cheapest, compare prices, pricing | |
| review, rating, sentiment, stars, feedback | |
| bestseller, top selling, most popular, trending | |
| seller, vendor, reseller, who sells | |
| all products from, scrape store, full catalog | |
| what platform, built on, tech stack, Shopify or WooCommerce | |
| SEO, listing quality, product page audit | |
| competitor funnel, competitor pricing, conversion elements | |
| search intent, keyword intent, SERP intent | |
| match products, same product on different platforms | |
| restaurant, food delivery, DoorDash, UberEats, TheFork | |
| enrich store, store metadata, store list | |
| event, concert, ticket, Eventbrite | |
| property, real estate, house listing, Realtor | |
| Facebook ads, Meta ads, ad library, competitor ads | |
| classified, Craigslist, used item for sale | |
| car, used car, vehicle, automotive, Webmotors | |
| pins, inspiration, Pinterest boards, visual search, Pinterest trends | |
| TikTok Shop, TikTok store, TikTok creator | |
| website for sale, domain for sale, Flippa | |
如果检测到多个意图,请询问:"您需要[intent A]还是[intent B]?"
Actor路由表 — 优先使用Primary,仅在失败或返回0结果时切换到Fallback:
| 意图 | 平台 | Primary Actor | Fallback Actor |
|---|---|---|---|
| Amazon / Walmart / generic | | — |
| eBay | | |
| Etsy | | |
| Google Shopping | | |
| Facebook Marketplace | | |
| SHEIN | | |
| Lazada | | |
| Canadian Tire | | |
| Tesco | | |
| Shopify | | |
| WooCommerce | | |
| Amazon / Walmart / generic | | |
| Trustpilot | | |
| TheFork | | |
| Amazon | | |
| Amazon | | |
| eBay | | |
| Shopify | | |
| WooCommerce | | |
| Amazon | | |
| Flippa | | |
| any | | |
| any | | |
| any | | |
| any | | |
| any | | |
| any | | |
| DoorDash | | |
| UberEats | | |
| TheFork | | |
| Facebook / Meta | | |
| Craigslist | | |
| Webmotors | | |
| Eventbrite | | |
| Realtor.com | | |
| | | |
| TikTok Shop | | |
| Flippa | | |
Step 2: Fetch Actor Schema
步骤2:获取Actor Schema
Fetch the Actor's input schema dynamically using mcpc:
bash
export $(grep APIFY_TOKEN .env | xargs) && mcpc --json mcp.apify.com --header "Authorization: Bearer $APIFY_TOKEN" tools-call fetch-actor-details actor:="ACTOR_ID" | jq -r ".content"Replace with the selected Actor (e.g., ).
ACTOR_IDapify/e-commerce-scraping-toolThis returns:
- Actor description and README
- Required and optional input parameters
- Output fields (if available)
通过mcpc动态获取Actor的输入schema:
bash
export $(grep APIFY_TOKEN .env | xargs) && mcpc --json mcp.apify.com --header "Authorization: Bearer $APIFY_TOKEN" tools-call fetch-actor-details actor:="ACTOR_ID" | jq -r ".content"将替换为所选的Actor(例如:)。
ACTOR_IDapify/e-commerce-scraping-tool此命令将返回:
- Actor描述和README
- 必填和可选输入参数
- 输出字段(如果可用)
Step 3: Ask User Preferences
步骤3:询问用户偏好
Before running, ask:
- Output format:
- Quick answer (default) — synthesized answer in chat, no file saved
- CSV — full export saved to disk
- JSON — full export saved to disk
- Result count — suggest defaults by intent:
| Intent | Default |
|---|---|
| 50 products |
| 200 reviews |
| 100 items |
| 50 sellers |
| all (unlimited) |
| 50 restaurants |
| all others | 20–50 |
运行前,请询问:
- 输出格式:
- 快速回答(默认)—— 在聊天中展示整合后的回答,不保存文件
- CSV—— 完整导出并保存到本地
- JSON—— 完整导出并保存到本地
- 结果数量—— 根据意图建议默认值:
| 意图 | 默认值 |
|---|---|
| 50个产品 |
| 200条评论 |
| 100个商品 |
| 50个卖家 |
| 全部(无限制) |
| 50家餐厅 |
| 其他所有 | 20–50 |
Step 4: Run the Actor
步骤4:运行Actor
Quick answer (display in chat, no file):
bash
node --env-file=.env ${CLAUDE_PLUGIN_ROOT}/reference/scripts/run_actor.js \
--actor "ACTOR_ID" \
--input 'JSON_INPUT'CSV:
bash
node --env-file=.env ${CLAUDE_PLUGIN_ROOT}/reference/scripts/run_actor.js \
--actor "ACTOR_ID" \
--input 'JSON_INPUT' \
--output YYYY-MM-DD_filename.csv \
--format csvJSON:
bash
node --env-file=.env ${CLAUDE_PLUGIN_ROOT}/reference/scripts/run_actor.js \
--actor "ACTOR_ID" \
--input 'JSON_INPUT' \
--output YYYY-MM-DD_filename.json \
--format json快速回答(在聊天中展示,不生成文件):
bash
node --env-file=.env ${CLAUDE_PLUGIN_ROOT}/reference/scripts/run_actor.js \
--actor "ACTOR_ID" \
--input 'JSON_INPUT'CSV格式:
bash
node --env-file=.env ${CLAUDE_PLUGIN_ROOT}/reference/scripts/run_actor.js \
--actor "ACTOR_ID" \
--input 'JSON_INPUT' \
--output YYYY-MM-DD_filename.csv \
--format csvJSON格式:
bash
node --env-file=.env ${CLAUDE_PLUGIN_ROOT}/reference/scripts/run_actor.js \
--actor "ACTOR_ID" \
--input 'JSON_INPUT' \
--output YYYY-MM-DD_filename.json \
--format jsonStep 5: Analyze Results and Deliver Answer
步骤5:分析结果并生成回答
After the run completes, deliver a direct synthesized answer — not a data dump:
- Pricing: price range, average, top 5 cheapest with URLs
- Reviews: average rating, top 3 positive and negative themes, recent snippets
- Bestsellers: top 10 by rank with name, price, rating, URL
- Sellers: total sellers, price range per seller, unauthorized seller flags
- Store-scrape: total products, category breakdown, price range, stock summary
- Tech-stack: platform detected, confidence level, notable plugins
- Food delivery: restaurant count, average rating, price tier breakdown
- Ads intelligence: total ads, active/inactive split, top creative formats
运行完成后,直接提供整合后的回答 — 而非原始数据:
- 定价:价格区间、平均值、5个最低价商品及链接
- 评论:平均评分、3个主要正面/负面主题、最新评论片段
- 畅销品:排名前10的商品,包含名称、价格、评分、链接
- 卖家:卖家总数、各卖家价格区间、非授权卖家标记
- 店铺抓取:商品总数、分类分布、价格区间、库存汇总
- 技术栈:检测到的平台、置信度、重要插件
- 外卖:餐厅数量、平均评分、价格层级分布
- 广告情报:广告总数、活跃/非活跃占比、热门创意格式
Error Handling
错误处理
APIFY_TOKEN not found.envAPIFY_TOKEN=your_tokenmcpc not foundnpm install -g @apify/mcpcActor not foundRun FAILEDTimeout--timeoutNo resultsproxy is required"proxy": {"useApifyProxy": true}Platform not detectedapify/e-commerce-scraping-toolgenericAPIFY_TOKEN not foundAPIFY_TOKEN=your_token.envmcpc not foundnpm install -g @apify/mcpcActor not foundRun FAILEDTimeout--timeoutNo resultsproxy is required"proxy": {"useApifyProxy": true}Platform not detectedapify/e-commerce-scraping-toolgeneric