Fetch Stock Daily JSON
Use this skill for the publishable Node.js path stock input -> symbol resolution -> daily history fetch -> raw JSON archive.
Quick Start
Run the Node.js helper from the repo root:
node skills/fetch-stock-daily-json/scripts/fetch_daily_json.js 贵州茅台
node skills/fetch-stock-daily-json/scripts/fetch_daily_json.js 600519 --years 3
node skills/fetch-stock-daily-json/scripts/fetch_daily_json.js 宁德时代 --start-date 20240101 --end-date 20260329 --adjust qfq
The script prints a JSON summary with the resolved symbol, row count, requested window, actual trade-date bounds, and saved file path.
Workflow
- Accept repo-compatible inputs only: 6-digit code,
600519.SH or 300750.SZ, or a Chinese stock name. Do not use sh600519.
- Prefer the bundled Node.js script instead of re-implementing the workflow in the task.
- Resolve stock names through the Eastmoney A-share list API and cache the code-name map locally.
- Fetch daily bars from the Eastmoney historical kline API with
daily period and qfq/hfq/none adjustment.
- Save the archived rows under
data/raw/eastmoney/daily_history/YYYYMMDD/<symbol>_<HHMMSS>.json.
- Default to
years=5 and adjust=qfq when the user does not provide a date window.
- Stop after JSON archive generation unless the user explicitly asks for downstream parsing, analysis, or DB sync.
Return Format
Return the script's JSON summary and call out:
resolved_symbol
rows
trade_date_min
trade_date_max
output_path
Failure Handling
- If name resolution fails, ask for a valid 6-digit A-share code or Chinese stock name.
- If the fetch returns zero rows, keep the archive file and report
rows: 0.
- If you need the JS-side API details or the parity notes versus the Python workflow, read
references/lobsterclaw-workflow.md.