Vibe AStock data-access skill
A skill helps an agent retrieve Chinese-equity data and preserve source responses with timestamps and explicit gaps
- 964 ★ on the repository
- Last commit
- Apache-2.0
Extended access
Why this level
- Scripts contact external market-data sources and save responses to disk
- Data-use terms and result completeness depend on the selected source
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add skills/vibe-astock-data-accessDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- Scripts contact external market-data sources and save responses to disk
- Data-use terms and result completeness depend on the selected source
This is third-party code. Review the repository files before installing.
What it does
The `data-access` skill in Vibe AStock explains how to obtain quotes and financial data through registered Python scripts. Some scripts retrieve quotes, company profiles and cumulative financials. Others return analyst estimates, daily candles and the Chinese trading calendar. Results include retrieval status, sources, timestamps and evidence records with units. With a run directory supplied, source responses go into `raw/` and structured output into `fetch/`. An agent can link a reported number to the retrieved file. Data retrieval is separated from calculation. Quarterly values, growth rates and other derived figures belong in the project’s calculation layer. Partial responses must expose gaps and fallback sources instead of substituting model-memory figures.
Who it is for. Research-agent builders working with Chinese equities and needing data files with source and retrieval status.
Good fit when
- Save a source response beside a quote and retrieval time
- Distinguish cumulative financials from a single quarter in a report
- Record fallback-source use when the primary source fails
- Report missing data instead of a plausible figure from model memory
Not a fit when
- You need trade-order execution
- You require guaranteed source availability or forecast accuracy
- You need a ready-made recommendation to buy a particular stock
Example request
Read `data-access` and show a quote-fetch command for 300308 as a technical example. Save the raw response and JSON in a separate run directory. Report source, time and gaps without a buy recommendation.Limitations
Scripts need Python 3.11 or later, with 3.12 recommended; source dependencies are in the skill’s scripts/requirements.txt. Each provider determines access, commercial-use and redistribution rights for market data. Public APIs can change formats and have incomplete coverage; baostock omits the Beijing exchange, and one forecast is not analyst consensus. Saved responses and hashes establish provenance, not correctness; verify financial conclusions separately.
How to disable. Stop running scripts and remove `data-access` from the agent. Inspect saved run directories before deletion. If the Vibe AStock app was started separately, stop it too; removing the skill does not stop application servers.
FAQ
What does an individual call look like?
From the project root, use `python3 .agents/skills/data-access/scripts/<script>.py --symbol 300308 --out-dir .local/runs/<run-id>`. Choose a registered script name. The example symbol is not a recommendation.
What do exit codes mean?
For the documented scripts, 0 means primary-source success, 2 means partial or fallback data and 3 means key data failed. Inspect `errors` and gaps for nonzero results.
Are all sources keyless?
Not all. The initial individual scripts use public unauthenticated access. The expanded registry requires `VRA_SEC_CONTACT` for SEC and `IWENCAI_API_KEY` for iWencai. Check the chosen entry.
Why not immediately subtract quarterly figures?
Some financial responses contain cumulative reporting-period values. The skill preserves them; quarterly derivation belongs in the calculation layer with periods and units accounted for.
Must I run the full web interface?
Not for an individual Python-script call. The application and orchestrator add the broader research workflow and need separate installation and model access.
What license covers Vibe AStock code?
Apache 2.0. It does not replace market-data providers’ terms.
Discussion
No questions or reviews yet.
Related
SkillsA skill with Chinese A-share market data: quotes, research reports, financials, news and 11 more categories from 34 sources, no keys
A skill that queries Arkvol for China, Hong Kong and US market data and retells it with the date, indicators and limits of use
A skill with US and global market data: options, VIX, short selling, insider trades, rates and FX, with no API keys
A skill for analysing sectors of the Chinese A-share market: policy, media, money flows, companies and ETFs with sources and dates
A skill and MCP server that give an agent quotes, candles and ticker search for the China, Hong Kong and US markets
Four skills for China's A-share market: quotes and indicators, trend-pullback signals, a simulated account and backtests
README in short
The broader project registry adds `scripts/fetch_endpoint.py` and per-source conditions. Not every endpoint belongs to the initial research plan; some are used only on demand.
README badge
Original SKILL.md
---
name: data-access
description: A 股零鉴权取数手册。当需要真实的行情 / 市值 / 估值快照、季度报告期累计财务数据、机构一致预期 EPS、PE 历史序列、公告标题、日 K 线、交易日历时使用;只允许运行本 skill 登记的脚本取数(腾讯 / 新浪 / 同花顺 / baostock / 深交所 / 东财),禁止凭模型记忆给数,禁止自造爬虫。概念解释、观点讨论等不需要取数的话题不要加载。
---
# A 股零鉴权取数(data-access)
本 skill 是 研究宪法 §0 第 1 条("禁止凭记忆生成数据")与 §5("取数只用登记脚本")的落地:每个数字都来自本次运行的脚本调用,原始响应落盘,证据带齐契约字段。脚本只取数、不做算术(单季拆分 / TTM / 同比 / 分位一律交给 `calc/`)。
## 1. 调用方式
```bash
python3 .agents/skills/data-access/scripts/<script>.py --symbol 300308 --out-dir .local/runs/<run-id>
```
(示例代码 300308 为 Phase 0 验收标的,仅作命令行示例,不代表任何推荐。)
- `--symbol` 接受 `300308` / `SZ300308` / `300308.SZ`(前后缀二选一,矛盾即报错,绝不猜市场);输出统一 6 位 + 市场 `SH|SZ|BJ`。
- `--out-dir` 给运行目录:原始响应自动写到 `<out-dir>/raw/`,结构化结果写到 `<out-dir>/fetch/<script>.json`;不给则只打印 JSON 到 stdout(仍计算 sha256)。
- 退出码:`0` ok(主源成功)/ `2` partial(走了备源或部分字段缺失,看 `extra.degraded` 与 `errors`)/ `3` failed(关键数据全部失败)。**非 0 不是"没数据可以编",是"如实记缺口"。**
- 依赖:`scripts/requirements.txt`(requests / pandas / lxml / akshare / baostock);腾讯、深交所、东财 K 线只用标准库。需要联网;正式研究里由编排器在自己的进程中执行这些脚本,接进来的研究大脑(本机 Agent 或模型 API)不联网、也不直接跑脚本。
- 东财系请求全部经 `common.em_get`:**跨进程串行**(文件锁覆盖整个请求生命周期,任一时刻最多一个东财请求在途,间隔 ≥1s + 抖动)、403 不重试、代理失败自动直连重试、`push2` 断连自动轮询 `push2delay`。编排器并行启动多个脚本也会在锁上排队。
## 2. 脚本登记表
| 脚本 | 拿什么 | 主源 | 备源 | 研究中的地位 |
|---|---|---|---|---|
| `fetch_quote.py` | 现价 / 昨收 / 涨跌幅 / 换手 / PE_TTM / PE 静 / PB / 流通市值 / 总市值 / 成交额;僵尸报价疑似 `is_stale`(命中 → partial 且估值类 evidence 带 note;停牌 / 废码 / 盘前三者之一,可用性由 SOP 结合交易日历判定) | 腾讯 qt.gtimg.cn | 东财 push2(delay)(同样做僵尸判定,period 取源端行情时间) | ★ 必需(估值分子) |
| `fetch_profile.py` | 名称 / 上市日 / 在市状态 / 证监会行业 / 东财行业 / 总股本 / 流通股 / 市值 | 腾讯 + baostock | 东财 push2(delay)(可选增强,失败不拖垮) | ★ 必需 |
| `fetch_financials.py` | 最近 N 报告期**累计值**:营业总收入 / 归母净利润 / 扣非净利润 / 基本 EPS;关键字段 × 最近 8 期完整性校验 | 新浪财务摘要(akshare) | 新浪利润表直连(**无扣非**;主源部分缺失时只补营收 / 归母,补齐也算走备源 → partial) | ★ 必需(扣非×4 PE / TTM 同比) |
| `fetch_estimates.py` | 一致预期 EPS(FY T / T+1 / T+2):均值 / min / max / 机构数 | 同花顺 worth.html | 东财研报逐篇预测(**非一致预期**,partial) | ★ 必需(前瞻 CAGR) |
| `fetch_pe_history.py` | PE_TTM / PB 日频序列(默认 5 年)→ raw CSV;最新值 | baostock | —(北交所不支持) | ○ 可选(TTM PE 分位) |
| `fetch_announcements.py` | 最近 N 条公告标题 / 日期 / PDF 链接 | 深市:深交所官方;沪市 / 北交所:东财 | 深市备源东财 | ○ 可选(风险 / 反证线索) |
| `fetch_kline.py` | 日 K 前复权序列 → raw;最新收盘(逐行校验,坏行剔除→partial) | 腾讯 fqkline | 东财 push2his(本机网络常断) | ○ 可选(stale 二次验证时用) |
| `fetch_trade_calendar.py` | 全市场交易日历:last_trading_day / previous_trading_day / is_today_trading_day / session_phase(pre_open·trading·post_close·non_trading_day)/ **reference_quote_day**(此刻新鲜报价应有的日期)(evidence symbol=MARKET, market=CN) | baostock query_trade_dates | — | ★ 必需(判定报价日期差异是休市 / 盘前还是个股停牌) |
Phase 0 不在范围(Phase 1 进 `datasources/registry.yaml` 后再接):新闻正文、研报 PDF、资金流、龙虎榜、融资融券、股东户数、解禁、筹码、宏观。
## 3. 输出契约
每个脚本输出一个 JSON 信封: