Cross-Border E-Commerce Full-Chain Automation Tool
Task Objective
- This skill is used for: full-process automation of cross-border e-commerce from product selection to promotion
- Capabilities include:
- 1688 Product Sourcing: keyword search, detail scraping, image download, anti-scraping fallback (Mock data as a fallback)
- Intelligent Data Cleaning: automatic title translation, price standardization, supplier rating, profit margin calculation, batch filtering
- Multi-Platform Listing: one-click generation of WeChat Store/Shopify/TikTok listing templates, supporting CSV/Excel/JSON export
- Promotion Plan Generation: automatic keyword generation, competitor analysis, ad copywriting, budget planning
- Short Video Creation: automatically generates vertical promotional videos based on product images (MoviePy + Ken Burns effect)
- One-Click Dropshipping: direct ordering from 1688 sources, supporting stealth shipping notes, Playwright browser automation
- Hot Product Trend Discovery: multi-source trend aggregation (Google Trends), 6-dimension hot product scoring, automatic triggering of subsequent pipelines
- Xianyu Product Selection Bargain Hunting: second-hand product search, brand recognition, false listing filtering, 6-dimension bargain scoring, price monitoring, intelligent recommendations
- Fully Automated Pipeline: hot product discovery → sourcing → cleaning → listing → promotion → video, one-click end-to-end execution
- Trigger conditions: when users need to engage in cross-border e-commerce business, including product selection, listing, promotion, video creation, or second-hand product selection bargain hunting
Prerequisites
- Python 3.8+
- Dependency installation:
pip install requests beautifulsoup4 lxml pyyaml pytrends moviepy pillow
- 1688 / Xianyu require a logged-in state for complete sourcing; it is recommended to use them in a browser environment that is already logged in
- Promotional video generation requires ffmpeg (a MoviePy dependency)
Operation Steps
Process 1: Full-Chain Automation (Recommended)
# 自动挖掘爆品 → 采集 → 清洗 → 上架 → 推广 → 视频生成
python main.py auto-pipeline --seed-keywords "收纳盒,蓝牙耳机" --top-n 5 --product-limit 3 --platform all
Process 2: 1688 Sourcing → Listing → Promotion
# Step 1: 采集
python main.py scrape --keyword "蓝牙耳机" --pages 2 --detail --download-images
# Step 2: 清洗(过滤毛利率低于20%、供应商评分低于60分的商品)
python main.py clean --input data/raw_products.json --min-margin 0.20 --min-score 60
# Step 3: 上架(生成多平台模板)
python main.py publish --input data/cleaned_products.json --platform all --export all
# Step 4: 推广(关键词+竞品分析+广告文案+预算)
python main.py promote --input data/cleaned_products.json --limit 10 --daily-budget 50
# Step 5: 生成推广短视频
python main.py video --input data/cleaned_products.json --limit 5 --duration 15
Process 3: Hot Product Discovery
# 自动挖掘趋势爆品
python main.py trend --categories electronics,home --top-n 10
# 指定种子词挖掘
python main.py trend --seed-keywords "充电宝,手机壳" --top-n 10
Process 4: Xianyu Product Selection Bargain Hunting
# 闲鱼搜索
python main.py xianyu --keyword "投影仪" --price-max 999 --pages 3 --condition 9成新
# 捡漏搜索(带参数需求)
python main.py hunt --keyword "投影仪 4K 云台" --budget 999 \
--min-lumens 1000 --require-4k --require-gimbal --require-wall
# 智能推荐(多关键词综合)
python main.py recommend --keywords "投影仪,家用投影,4K投影" --budget 999 \
--min-lumens 1000 --require-4k --require-gimbal
# 价格监控
python main.py monitor --keywords "投影仪,坚果投影" --budget 999
Process 5: One-Click Dropshipping
python main.py fulfill --source-url "https://detail.1688.com/offer/xxx.html" \
--receiver-name "张三" --receiver-phone "13800138000" \
--receiver-address "北京市朝阳区xxx" --sku-spec "白色/大号" --quantity 1
Core Logic
Hot Product Discovery Scoring Model
Hot product score = trend velocity × 35% + (1 - competition level) × 25% + profit potential × 25% + supply stability × 15%
| Dimension |
Weight |
Scoring Logic |
| Trend Velocity |
35% |
Google Trends search volume change rate; the higher the recent increase, the higher the score |
| Competition Level |
25% |
Inverse indicator of market competition intensity; the lower the competition, the higher the score |
| Profit Potential |
25% |
Profit margin between the 1688 supply price and the estimated selling price |
| Supply Stability |
15% |
Number of suppliers and supply stability |
Xianyu Bargain Hunting Scoring Model
Scoring formula: price advantage (30 points) + cost-performance ratio (20 points) + condition (15 points) + seller reputation (15 points) + parameter match (20 points) - risk deduction
| Dimension |
Score |
Scoring Logic |
| Price Advantage |
0-30 |
The lower the ratio of actual price to reasonable second-hand price, the higher the score; price drops add points |
| Cost Performance |
0-20 |
Discount rate relative to the brand-new price; the bigger the discount, the higher the score |
| Condition |
0-15 |
Brand new 15 points > Like new 13 > 99 new 12 > 90% new 10 > Normal use 7 |
| Seller Reputation |
0-15 |
100% positive reviews +10; number of interested buyers adds points |
| Spec Matching |
0-20 |
Match degree based on user-required specs (brightness/4K/gimbal, etc.) |
| Risk Deduction |
0-30 |
Risk factors such as low price with high specs falsely advertised, no brand, merchants shipping in bulk, etc. |
Brand Recognition and False Advertising Filtering
- Built-in recognition dictionary of 30+ brands (projectors/phones/laptops/tablets, etc.)
- False advertising detection: abnormal low price with high specs (e.g. ¥200 claiming 3000+ lumens)
- Blacklist filtering: known false advertising brand keywords, merchant bulk shipping identification
Data Cleaning Rules
- Automatically translate titles to English (for listing on Shopify/TikTok)
- Price normalization (unified to USD)
- Profit margin = (estimated selling price - supply price) / estimated selling price
- Supplier rating filtering, minimum order quantity screening
Promotional Video Generation
- Automatically generate vertical short videos (9:16) based on MoviePy
- Ken Burns slow zoom effects
- Product image carousel + title overlay
- Configurable duration (default 15 seconds)
Project Structure
ecommerce-tool/
├── main.py # CLI 入口(13 个子命令)
├── config.yaml # 配置文件
├── requirements.txt # 依赖
├── ecommerce_tool/
│ ├── scraper.py # 1688 采集模块
│ ├── cleaner.py # 数据清洗模块
│ ├── publisher.py # 多平台上架模块
│ ├── promoter.py # 推广方案模块
│ ├── video_generator.py # 短视频生成模块
│ ├── fulfillment.py # 一键代发模块
│ ├── trend_detector.py # 爆品挖掘模块
│ ├── xianyu_scraper.py # 闲鱼采集模块
│ ├── bargain_hunter.py # 捡漏分析模块
│ └── utils.py # 工具函数
CLI Command Overview
| Command |
Description |
scrape |
Collect products from 1688 |
clean |
Clean product data |
publish |
Generate listing templates (WeChat Store/Shopify/TikTok) |
promote |
Generate promotion plans (keywords/competitors/copy/budget) |
video |
Generate promotional short videos |
fulfill |
One-click dropshipping order placement |
pipeline |
Full-process automation (collect→clean→list→promote→video) |
trend |
Automatically mine trending hit products |
auto-pipeline |
Fully automatic hit product pipeline (mine→collect→list→promote→video) |
xianyu |
Xianyu product search |
hunt |
Xianyu bargain hunt search |
recommend |
Smart recommendations (multi-keyword comprehensive) |
monitor |
Price monitoring |
Python API Usage
from ecommerce_tool.scraper import Scraper1688
from ecommerce_tool.cleaner import DataCleaner
from ecommerce_tool.publisher import Publisher
from ecommerce_tool.promoter import Promoter
from ecommerce_tool.video_generator import VideoGenerator
from ecommerce_tool.fulfillment import FulfillmentEngine
from ecommerce_tool.trend_detector import TrendDetector
from ecommerce_tool.xianyu_scraper import XianyuScraper
from ecommerce_tool.bargain_hunter import BargainHunter
# 1688 采集
scraper = Scraper1688(config, logger)
products = scraper.search("蓝牙耳机", pages=2)
# 爆品挖掘
detector = TrendDetector(config, logger)
candidates = detector.discover(categories=["electronics"], top_n=10)
# 闲鱼捡漏
hunter = BargainHunter(config, logger)
results = hunter.hunt(
keyword="投影仪",
price_max=999,
spec_requirements={
"min_lumens": 1000,
"support_4k": True,
"has_gimbal": True,
"support_wall": True,
},
)
print(hunter.display_results(results))
Notes
- 1688 / Xianyu have anti-scraping mechanisms; it is recommended to set reasonable request intervals (1.5-3.5 seconds)
- Automatically fall back to Mock data when the network is unavailable (for development and debugging)
- Video generation requires an ffmpeg environment
- Promotional copy and keywords are AI-generated references; actual placement requires manual review
- Xianyu bargain scores are for product selection reference only and do not constitute trading advice
- False advertising filtering cannot 100% eliminate counterfeit goods; please verify carefully before purchasing
Related Links