返回 Skill 列表
extension
分类: 数据与分析需要 API Key

A股数据结构化

当用户需要获取精确的、时效性强的市场或公司数据时,例如实时报价、历史价格、资金流动情况、估值指标、财务报表、公司基本信息、股东信息、高管信息或企业关系等,可以使用这项技能进行权威的 Eastmoney MX 财务数据查询。但请勿用于新闻报道、公告发布(请使用 mx-search)、基于条件的股票筛选(请使用 mx-xuangu)、关注名单管理(请使用 mx-zixuan)或模拟交易操作(请使用 mx-moni)。

person作者: user_160536ffhubcommunity

mx-data

Use mx_data.py to query Eastmoney MX data through natural language and produce structured Excel/JSON outputs.

Trigger Boundaries

  • Use for exact data questions: price, close/open/high/low, volume, turnover, PE/PB, ROE, revenue, profit, balance sheet items, dividends, shareholders, executives, company profile, sector/index/fund quotes.
  • Prefer this skill whenever the answer depends on current or historical market data rather than model memory.
  • Do not use it for event interpretation, news causality, announcements, research reports, policy text, or market narrative; use mx-search first for those.
  • Do not use it to screen a universe by constraints such as "ROE > 15%" or "PE < 20"; use mx-xuangu.

Inputs

  • Required: a clear natural-language query with entity, metric, and time range or date.
  • Ask a concise follow-up if the entity, metric, or period is ambiguous and the ambiguity changes the result.
  • Use narrower periods for daily-level data. Multi-year daily queries can create large Excel/JSON files and overload context.
  • Require MX_APIKEY in the environment. Optional: set MX_OUTPUT_DIR; otherwise output goes to ~/.codex/skills-output/mx_data/output.

Workflow

  1. Normalize the user request into one focused query. Include the entity code/name, metric, market if needed, and date range.
  2. Run:
python /Users/lu/.codex/skills/mx-data/mx_data.py "贵州茅台近三年净利润 营业收入"
  1. Inspect the terminal preview first. Open generated Excel/JSON only when deeper parsing is needed.
  2. If the raw JSON shape matters, load references/result-fields.md.
  3. Answer with the data source, query used, time range, key values, and generated file paths when files were created.

Output Contract

  • State that the data came from Eastmoney MX via mx-data.
  • Include units, dates, and whether values are real-time, daily, annual, or another granularity.
  • For tables, summarize the important rows/columns and point to the generated .xlsx and _raw.json.
  • Do not turn raw data into investment advice unless the user explicitly asks for analysis; even then, distinguish data from judgment.

Failure Handling

  • Missing MX_APIKEY: ask the user to configure it; do not invent values.
  • Empty result: broaden entity/metric wording or reduce condition specificity.
  • Large output: rerun with a narrower time range or fewer metrics.
  • API limit/auth errors: report the code and stop.
  • Network/JSON errors: retry once only if the failure looks transient; otherwise report the failure and preserve any raw output path.

Validation

  • Use evals/evals.json after changing this skill or its script.
  • Positive cases should trigger mx-data; adjacent news, screening, watchlist, and trading prompts should not.