
A Stock Daily Report
Automate a daily China A-share market brief by pulling East Money sector board data into a report without manual chart scraping.
Overview
A-stock Daily Report is an agent skill for the Grow phase that fetches East Money A-share sector board data and supports generating a daily market report.
Install
npx skills add https://github.com/zsxink/skills-hub --skill a-stock-daily-reportWhat is this skill?
- Fetches East Money push2 board listings (top 50 sectors) via HTTP with timeout handling
- Node.js script with configurable East Money board and single-stock API endpoints
- JSON parsing pipeline suitable for extending into markdown or email daily reports
- Uses realistic browser Referer and User-Agent headers for quote-site API access
- Fetches up to 50 sector board rows per request via East Money clist API
Adoption & trust: 712 installs on skills.sh; 2 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You follow China A-shares but waste time manually refreshing sector boards and copying numbers into a daily note.
Who is it for?
Solo builders or indie traders who want Node-based, API-driven A-share sector snapshots for a personal daily digest.
Skip if: Teams needing licensed market data, U.S.-only equities, or fully hosted reporting with no custom code.
When should I use this skill?
You need automated A-share sector data from East Money to feed a daily written or agent-generated market report.
What do I get? / Deliverables
You get a scriptable East Money data pull you can chain into formatted daily reports on a schedule.
- Fetched JSON board dataset
- Extensible Node script for daily report generation
Recommended Skills
Journey fit
Market recap and sector ranking fit the Grow analytics shelf where solo traders turn raw quotes into repeatable intelligence. Analytics is the canonical home for scheduled market summaries and trend snapshots, not one-off research ideation.
How it compares
Use instead of hand-copying East Money screens; this is a fetch script, not a portfolio analytics SaaS.
Common Questions / FAQ
Who is a-stock-daily-report for?
Solo builders and indie traders tracking China A-shares who want agent- or cron-driven daily sector summaries built on East Money APIs.
When should I use a-stock-daily-report?
Use it in Grow (analytics) for scheduled market recaps, or Operate (iterate) when tuning a personal reporting pipeline after you change sectors or output format.
Is a-stock-daily-report safe to install?
Review the Security Audits panel on this Prism page and inspect the script’s outbound HTTP calls and dependencies before running it with real schedules or secrets.
SKILL.md
READMESKILL.md - A Stock Daily Report
#!/usr/bin/env node /** * A股日报自动生成器(Node.js版本) * 功能:抓取东方财富板块数据,生成日报 */ const https = require('https'); const http = require('http'); const path = require('path'); // 配置 const CONFIG = { eastmoneyBoardApi: 'http://push2.eastmoney.com/api/qt/clist/get', eastmoneyStockApi: 'http://push2.eastmoney.com/api/qt/stock/get', }; /** * HTTP请求封装 */ function httpGet(url, options = {}) { return new Promise((resolve, reject) => { const client = url.startsWith('https') ? https : http; const req = client.get(url, options, (res) => { let data = ''; res.on('data', (chunk) => data += chunk); res.on('end', () => { try { resolve(JSON.parse(data)); } catch (e) { reject(e); } }); }); req.on('error', reject); req.setTimeout(10000, () => { req.destroy(); reject(new Error('Request timeout')); }); }); } /** * 获取板块数据 */ async function fetchBoardData() { const params = new URLSearchParams({ pn: '1', pz: '50', po: '1', np: '1', ut: 'bd1d9ddb04089700cf9c27f6f7426281', fltt: '2', invt: '2', fid: 'f3', fs: 'm:90+t:2', fields: 'f1,f2,f3,f4,f5,f6,f7,f12,f14', }); const url = `${CONFIG.eastmoneyBoardApi}?${params.toString()}`; const options = { headers: { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36', 'Referer': 'http://quote.eastmoney.com/', }, }; try { const data = await httpGet(url, options); const boards = []; if (data?.data?.diff) { data.data.diff.forEach((item) => { const changeVal = item.f3 || 0; const changeStr = changeVal > 0 ? `+${changeVal.toFixed(2)}%` : `${changeVal.toFixed(2)}%`; boards.push({ code: item.f12 || '', name: item.f14 || '', change: changeStr, amount: item.f6 || 0, }); }); } return boards; } catch (e) { console.error(`[ERROR] API 获取板块数据失败: ${e.message}`); return []; } } /** * 获取大盘指数数据 */ async function fetchIndexData() { const indicesConfig = [ { secid: '1.000001', key: 'sh_index', name: '上证指数' }, { secid: '0.399001', key: 'sz_index', name: '深证成指' }, { secid: '0.399006', key: 'cy_index', name: '创业板指' }, { secid: '1.000688', key: 'kc_index', name: '科创板指' }, ]; const result = { failed: [], success: [] }; for (const { secid, key, name } of indicesConfig) { const params = new URLSearchParams({ secid: secid, fields: 'f43,f44,f45,f46,f47,f48,f49,f50,f51,f52,f55,f57,f58,f60,f170,f171', }); const url = `${CONFIG.eastmoneyStockApi}?${params.toString()}`; const options = { headers: { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)', 'Referer': 'http://quote.eastmoney.com/', }, }; try { const data = await httpGet(url, options); if (data?.data) { const d = data.data; result[key] = (d.f43 / 100).toFixed(2); result[`${key}_change`] = `${(d.f170 / 100).toFixed(2)}%`; result.success.push(name); } else { throw new Error('数据为空'); } } catch (e) { console.error(`[ERROR] 获取 ${name} 失败: ${e.message}`); result[key] = '--'; result[`${key}_change`] = '--'; result.failed.push(name); } } return result; } /** * 分析数据并构建报告数据 */ function analyzeAndBuildReportData(boards, indices) { const boardFailed = !boards || boards.length === 0; // 热门板块(涨幅前5) let hotBoards = []; let focusBoards = []; let riskBoards = []; if (!boardFailed) { // 按涨幅排序 const getChangeVal = (b) => { try { return parseFloat(b.change.replace('%', '').replace('+', '')) || 0; } catch { return 0; } }; const sortedBoards = [...boards].sort((a, b) => getChangeVal(b) - getChangeVal(a)); hotBoards = sortedBoards.slice(0, 5).map((b) => ({ name: b.name, change: b.change,