Automatically scrapes A-share market data and generates a daily report.
Trigger Keywords
Users can trigger this skill with the following keywords:
- A-share Daily Report
- A-share Briefing
- A-share Daily Briefing
- Stock Market Daily Report
- Stock Market Briefing
- Stock Market Daily Briefing
Features
- 📊 Market Overview: Shanghai Composite, Shenzhen Component, ChiNext, STAR Market indices
- 🔥 Hot Sectors: Top 5 sectors by gain
- 📈 Tomorrow's Focus: Technical breakouts, sectors with favorable policies
- ⚠️ Risk Alerts: Overvalued sectors, sectors with capital outflows
- 💰 Capital Flows: Northbound capital, main force net inflow
Quick Start
Generate Daily Report
node scripts/a-stock-report.js
Run directly to generate the A-share daily report (formatted output).
Get JSON Data
node scripts/a-stock-report.js json
Get data in JSON format for programmatic processing.
JSON Data Field Descriptions
{
"sh_index": "3250.45", // 上证指数收盘点位
"sh_index_change": "+1.25%", // 上证指数涨跌幅
"sz_index": "10890.32", // 深证成指收盘点位
"sz_index_change": "-0.35%", // 深证成指涨跌幅
"cy_index": "2150.18", // 创业板指收盘点位
"cy_index_change": "+0.82%", // 创业板指涨跌幅
"kc_index": "850.76", // 科创板指收盘点位
"kc_index_change": "-1.12%", // 科创板指涨跌幅
"market_sentiment": "偏多", // 市场情绪(偏多/偏空/中性)
"hot_boards": [ // 热门板块(涨幅前5)
{
"name": "人工智能", // 板块名称
"change": "+5.23%", // 涨跌幅
"leader": "--", // 领涨股(当前为占位)
"reason": "资金关注" // 热门理由
}
],
"focus_boards": [ // 明日关注板块
{
"name": "人工智能", // 板块名称
"reason": "资金持续流入", // 关注理由
"technical": "趋势向好", // 技术面分析
"suggestion": "逢低关注" // 操作建议
}
],
"risk_boards": [ // 风险板块(跌幅前3)
{
"name": "房地产", // 板块名称
"reason": "资金流出", // 风险理由
"suggestion": "谨慎参与" // 操作建议
}
],
"north_money": "--", // 北向资金净流入(暂不可用)
"main_inflow": "人工智能、半导体、新能源", // 主力流入方向(热门板块前3)
"margin_balance": "--", // 融资余额(暂不可用)
"board_failed": false, // 板块数据是否获取失败
"index_failed": [], // 获取失败的指数列表(如指数获取失败则显示名称)
"index_success": ["上证指数", "深证成指", "创业板指", "科创板指"], // 成功获取的指数列表
"strategy": "1. **仓位控制**:建议维持6-7成仓位\n2. **关注方向**:今日热点板块的持续性\n3. **风险控制**:设置止损位,避免追高\n4. **操作节奏**:低吸高抛,不追涨杀跌" // 操作策略
}
Field Descriptions:
- Index fields (
*_index,*_index_change): value is"--" board_failed: whether sector data failed to be retrieved (true/false)index_failed: array of index names that failed to be retrieved; an empty array means all succeededindex_success: array of index names successfully retrievednorth_money、margin_balance: temporarily unavailable data, fixed as"--"
Save to File (Optional)
# Linux/Mac
mkdir -p ~/documents/reports/a-stock-daily-report
node scripts/a-stock-report.js > ~/documents/reports/a-stock-daily-report/report_$(date +%Y%m%d).md
# Windows
if not exist %USERPROFILE%\documents\reports\a-stock-daily-report mkdir %USERPROFILE%\documents\reports\a-stock-daily-report
node scripts/a-stock-report.js > %USERPROFILE%\documents\reports\a-stock-daily-report\report_%date:~0,4%%date:~5,2%%date:~8,2%.md
Data Sources
- East Money: sector rankings, index quotes
- API: free, no key required
⚠️ Important Notes
Handling Data Retrieval Failures
When some data fails to be retrieved (such as index or sector data), the report will continue to be generated and will note the reason for failure in the report, with the corresponding data displayed as --。
API Usage Restrictions
- The index data API may be closed during non-trading hours (evenings, weekends)
- Recommended run time: 15:30-16:00 after market close on trading days (A-shares close at 15:00)
- If you need to retrieve data in the evening, it is recommended to:
- Caching mechanism: run once within 30 minutes after market close and cache the data
- Manual maintenance: use locally stored index data
- Graceful degradation: a sector data report can still be generated when index data is unavailable
Environment Variables
No environment variables need to be configured.
Dependencies
- Node.js 14+
- No additional dependency packages required (uses Node.js built-in modules)
Troubleshooting
Run Failure or Abnormal Data
- Confirm Node.js version >= 14:
node --version - Check network connection
- Check error logs (stderr output)
- Confirm whether the API is available (may be closed during non-trading hours, weekends/holidays)
- Check whether it is a trading day and confirm the run time is appropriate
Output Format
The report is output in Markdown format and includes the following sections:
# 📊 A股市场日报
**YYYY年MM月DD日**
---
## 🎯 大盘概览
| 指数 | 收盘点位 | 涨跌幅 |
|------|---------|--------|
| 上证指数 | xxxx.xx | ±x.xx% |
| 深证成指 | xxxx.xx | ±x.xx% |
| 创业板指 | xxxx.xx | ±x.xx% |
| 科创板指 | xxxx.xx | ±x.xx% |
**市场情绪**: 偏多/偏空/中性
⚠️ **数据获取提示**: 以下数据获取失败 (指数数据 - 上证指数、深证成指、创业板指、科创板指),可能原因:非交易时间/网络异常/API 暂时不可用
---
## 🔥 热门板块 TOP 5
| 排名 | 板块名称 | 涨跌幅 | 领涨股 |
|------|---------|--------|--------|
| 1 | 板块名 | ±x.xx% | 股票名 |
| ...
---
## 📈 明日关注
| 板块名称 | 关注理由 | 技术面 | 操作建议 |
|---------|---------|--------|---------|
| 板块名 | 理由 | 分析 | 建议 |
| ...
---
## ⚠️ 风险提示
| 板块名称 | 风险理由 | 建议 |
|---------|---------|------|
| 板块名 | 原因 | 建议 |
| ...
---
## 💰 资金动向
- **主力流入方向**: 板块1、板块2、板块3
- **北向资金**: 金额
- **融资余额**: 金额
---
## 📝 操作策略
1. **仓位控制**: 建议
2. **关注方向**: 建议
3. **风险控制**: 建议
4. **操作节奏**: 建议
---
**数据来源**: 东方财富网
**生成时间**: YYYY-MM-DD