Sina Market
A unified Sina Finance market-data skill for:
- - A-shares
- Hong Kong stocks
- domestic futures
- Sina futures quote pages
- Chinese futures name detection and code normalization
This skill does not currently claim support for US stocks or full market-index-specific parsing. Keep the public description aligned to implemented behavior.
What this skill can do
1. Detect market types
Examples:
CODEBLOCK0
2. Fetch stock quotes
Supports:
- - A-shares, e.g.
600519, 000001, sh600519, INLINECODE3 - Hong Kong stocks, e.g.
00700, INLINECODE5
CODEBLOCK1
3. Fetch domestic futures quotes
Supports direct futures quote lookup, including nf_-style inner futures routing when needed.
CODEBLOCK2
4. Extract futures page metadata
Useful when direct quote output is empty or when you want page-level discovery data.
CODEBLOCK3
5. Unified inspect with fallback
This is the most useful command for mixed workflows.
CODEBLOCK4
6. Batch coverage test
Use this to quickly see whether a symbol resolves via stock-hq, futures-hq, or page-fallback.
CODEBLOCK5
Routing logic
The skill uses a layered strategy.
Stocks
- - A-shares → INLINECODE7
- Hong Kong stocks → INLINECODE8
Futures
- - try raw contract code
- try
nf_ + contract code for inner futures - if quote still fails, try Sina futures quote page metadata fallback
Chinese futures names
Examples:
- -
甲醇2605 → INLINECODE11 - INLINECODE12 → INLINECODE13
- INLINECODE14 → INLINECODE15
- INLINECODE16 → INLINECODE17
- INLINECODE18 → INLINECODE19
- INLINECODE20 → INLINECODE21
Output guidance
Prefer this structure in replies:
- -
结论:是否成功获取实时行情 / 是否走 fallback - INLINECODE23 :A股 / 港股 / 国内期货 / 期货页面元数据
- INLINECODE24 :标准化后的代码
- INLINECODE25 :最新价、最高、最低、成交量、持仓量、日期、时间
- INLINECODE26 :新浪公开网页资源字段和覆盖范围可能变化
Current strengths
- - unified stock + futures workflow
- inner futures
nf_ support - futures page discovery fallback
- batch coverage testing
- Chinese futures input support
Known limitations
- - Chinese futures mapping is curated, not exhaustive yet
- page metadata fallback does not guarantee full quote fields
- some symbols may still require additional market-specific parsing in the future
- public webpage resources are not an official SLA-backed API
Files
scripts/
- -
scripts/sina_market.py: unified working script - INLINECODE29 : legacy futures-oriented helper retained during transition
references/
- -
references/fields.md: futures field normalization notes - INLINECODE31 : curated Chinese futures name to contract-code mapping
新浪市场
一个统一的新浪财经市场数据技能,适用于:
- - A股
- 港股
- 国内期货
- 新浪期货报价页面
- 中文期货名称检测与代码标准化
该技能目前不声称支持美股或完整的市场指数特定解析。保持公开描述与实际实现功能一致。
该技能的功能
1. 检测市场类型
示例:
bash
python3 scripts/sina_market.py detect 600519 00700 AG0 PG2607
python3 scripts/sina_market.py detect 甲醇2605 白银2606 沥青2606
2. 获取股票报价
支持:
- - A股,例如 600519、000001、sh600519、sz000001
- 港股,例如 00700、hk00700
bash
python3 scripts/sina_market.py stock-quote 600519 000001 00700 --format json
python3 scripts/sina_market.py stock-quote 600519 00700 --format table
3. 获取国内期货报价
支持直接期货报价查询,必要时包含 nf_ 格式的内部期货路由。
bash
python3 scripts/sina_market.py futures-quote AG0 AU0 SC0 --format json
python3 scripts/sina_market.py futures-quote PG2607 EB2607 MA2605 BU2606 --format json
python3 scripts/sina_market.py futures-quote 甲醇2605 白银2606 沥青2606 --format json
4. 提取期货页面元数据
当直接报价输出为空或需要页面级发现数据时使用。
bash
python3 scripts/sina_market.py futures-page PG2607
python3 scripts/sina_market.py futures-page EB2607
5. 统一检查并回退
这是混合工作流中最有用的命令。
bash
python3 scripts/sina_market.py inspect 600519 00700 AG0 PG2607 EB2607 --format json
python3 scripts/sina_market.py inspect 甲醇2605 白银2606 沥青2606 --format json
6. 批量覆盖测试
使用此命令快速查看某个代码是否通过股票行情、期货行情或页面回退解析。
bash
python3 scripts/sina_market.py coverage-test 600519 00700 AG0 PG2607 EB2607 --format table
python3 scripts/sina_market.py coverage-test 甲醇2605 PVC2605 PTA2605 白银2606 聚丙烯2605 沥青2606 --format table
路由逻辑
该技能采用分层策略。
股票
- - A股 → hq.sinajs.cn
- 港股 → hq.sinajs.cn
期货
- - 尝试原始合约代码
- 尝试 nf_ + 合约代码用于内部期货
- 如果报价仍然失败,尝试新浪期货报价页面元数据回退
中文期货名称
示例:
- - 甲醇2605 → MA2605
- PVC2605 → V2605
- PTA2605 → TA2605
- 白银2606 → AG2606
- 聚丙烯2605 → PP2605
- 沥青2606 → BU2606
输出指南
回复中优先采用以下结构:
- - 结论:是否成功获取实时行情 / 是否走回退
- 市场类型:A股 / 港股 / 国内期货 / 期货页面元数据
- 标准代码:标准化后的代码
- 关键字段:最新价、最高、最低、成交量、持仓量、日期、时间
- 风险提示:新浪公开网页资源字段和覆盖范围可能变化
当前优势
- - 统一的股票 + 期货工作流
- 内部期货 nf_ 支持
- 期货页面发现回退
- 批量覆盖测试
- 中文期货输入支持
已知限制
- - 中文期货映射为精选版本,尚未完全覆盖
- 页面元数据回退不保证完整的报价字段
- 某些代码未来可能仍需要额外的市场特定解析
- 公共网页资源不是官方SLA支持的API
文件
scripts/
- - scripts/sinamarket.py:统一工作脚本
- scripts/sinafutures.py:过渡期间保留的旧版期货辅助工具
references/
- - references/fields.md:期货字段标准化说明
- references/chinesefuturesmapping.json:精选的中文期货名称到合约代码映射