Fetch Stock Daily JSON
name: fetch-stock-daily-json
by chenchunjiekk · published 2026-04-01
$ claw add gh:chenchunjiekk/chenchunjiekk-fetch-stock-daily---
name: fetch-stock-daily-json
description: "Resolve a China A-share stock name or code in pure Node.js, fetch daily historical bars from Eastmoney HTTP APIs, and archive them as local JSON files. Use when the request is about 日线, 历史K线, daily history, candles, OHLCV, raw market data export, or stock-name-or-code to API to JSON persistence for inputs such as 600519, 300750.SZ, or 贵州茅台."
---
# 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 qfqThe script prints a JSON summary with the resolved symbol, row count, requested window, actual trade-date bounds, and saved file path.
Workflow
1. Accept repo-compatible inputs only: 6-digit code, `600519.SH` or `300750.SZ`, or a Chinese stock name. Do not use `sh600519`.
2. Prefer the bundled Node.js script instead of re-implementing the workflow in the task.
3. Resolve stock names through the Eastmoney A-share list API and cache the code-name map locally.
4. Fetch daily bars from the Eastmoney historical kline API with `daily` period and `qfq/hfq/none` adjustment.
5. Save the archived rows under `data/raw/eastmoney/daily_history/YYYYMMDD/<symbol>_<HHMMSS>.json`.
6. Default to `years=5` and `adjust=qfq` when the user does not provide a date window.
7. 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:
Failure Handling
More tools from the same signal band
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...