# eastmoney **Repository Path**: exlimit/eastmoney ## Basic Information - **Project Name**: eastmoney - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-07-14 - **Last Updated**: 2026-08-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 东方财富实时行情采集系统 通过东方财富公开 JSON 接口(非页面 HTML 解析),按配置间隔拉取指数、板块、资金流、涨停池、跑马灯等数据。 双写产出(两版一致的消费路径): - `data/snapshots/*.json`:时间戳完整快照 - `data/latest.json`:最新快照(原子覆盖,**分析侧固定读这个**) Python 版额外写入 `data/market.db`(SQLite);Go 版只写 JSON,适合编译成长跑二进制。 ## Go 二进制(推荐生产长跑) 交易时段循环取数、只写 JSON,见 **[go/README.md](go/README.md)**。 ```bash cd go go build -o ../bin/emquote.exe ./cmd/emquote ..\bin\emquote.exe --once --config ..\config.yaml # 试跑一轮 ..\bin\emquote.exe --config ..\config.yaml # 开盘长跑 ``` 更省事(Windows): ```bat scripts\run_once_go.bat scripts\start_collector.bat python scripts\read_latest.py ``` 分析 Agent 对接约定见 [docs/AGENT_HANDOFF.md](docs/AGENT_HANDOFF.md)。 **数据字典 / 网页对照核验**:[docs/DATA_CATALOG.md](docs/DATA_CATALOG.md) 开盘后核对清单脚本:`python scripts/print_verify_checklist.py` ## 环境 - Python 3.8+(开发/对照)或 Go 1.21+(二进制) - Python 依赖见 `requirements.txt` ```bash pip install -r requirements.txt ``` ## 快速开始 ```bash # 立即采集一轮 python scripts/run_once.py # 或 python -m eastmoney.main --once # 交易时段调度(默认 09:15-11:35、12:55-15:10,工作日) # 全程按 interval_seconds 墙钟对齐;触发统一 +5s python -m eastmoney.main ``` 建议在项目根目录运行,或设置: ```bash set PYTHONPATH=src ``` ## 配置 见 [`config.yaml`](config.yaml): | 项 | 说明 | |---|---| | `interval_seconds` | 交易时段内墙钟对齐间隔(秒);常用 60/300/600/900 | | `trading_sessions` | 采集时段(上午从 09:15 起;收盘侧建议多留约 5 分钟) | | `rankings.board_top_n` | 板块类榜单最终保留前 N(默认 **20**) | | `rankings.concept_fetch_n` | 概念先拉取前 N,过滤后再截断到 `board_top_n`(默认 **50**) | | `rankings.stock_top_n` | 个股类榜单前 N(默认 **20**) | | `concept_exclude` | 概念排除字典(`names` 精确 / `contains` 子串) | | `focus_boards.top_n` | 涨幅/跌幅/资金流入各取前 N 板块(默认 **5**) | | `focus_boards.stocks_top_n` | 板内领涨/领跌/流入个股前 N(默认 **10**) | | `marquee.news_n` / `pkyd_n` | 最新消息 / 盘口异动条数 | | `apis.push2` | 默认 `push2delay`(部分网络下 `push2` 易断连) | **列表策略**(涨停六大股池仍全量): | 类别 | 规则 | |---|---| | 行业板块榜 | 直接 Top20 | | 概念板块榜 | 先拉 Top50 → `concept_exclude` 过滤 → 最多保留 20 | | 个股榜 | Top20 | | `focus_boards` | 六组:行业/概念 × 涨幅前5 / 跌幅前5 / 资金流入前5,板内个股 Top10 | `focus_boards` 键名:`industry_pct_top5` / `concept_pct_top5` / `industry_pct_down_top5` / `concept_pct_down_top5` / `industry_inflow_top5` / `concept_inflow_top5`(数量由 `focus_boards.top_n` 决定,键名里的 `top5` 为固定命名)。 ## 数据覆盖 | 模块 | 来源页面语义 | 主要接口 | |---|---|---| | 指数 | 行情中心 | `ulist.np/get` | | 行业/概念板块 | gridlist / 首页榜 | `clist/get` `fs=m:90+t:2/3` | | 沪A/深A 涨幅、换手、量比、振幅、成交额 | 首页榜 | `clist/get` | | 大盘资金流 | [dpzjlx](https://data.eastmoney.com/zjlx/dpzjlx.html) | `fflow/daykline` `secid+secid2` | | 个股资金流 | [detail](https://data.eastmoney.com/zjlx/detail.html) | `clist/get` `fid=f62` | | 板块资金流 | [hy](https://data.eastmoney.com/bkzj/hy.html) / [gn](https://data.eastmoney.com/bkzj/gn.html) | `clist/get` + `stat=1` | | 主力净占比排名 | [list](https://data.eastmoney.com/zjlx/list.html) | `clist/get` `fid=f184` | | 资金流监测 | [jlr](https://data.eastmoney.com/bkzj/jlr.html) | `clist/get` f164/f174(及 f170 回退) | | 重点板块成分股 | 涨/跌/资金前五板块详情 | `clist/get` `fs=b:BKxxxx` | | 涨停池等 | [ztb](https://quote.eastmoney.com/ztb/?from=center) | `push2ex` 各 getTopic*Pool | | 首页跑马灯 | 最新消息 + 盘口异动 | `getWebRollNews` / `pkyd/get` | 金额字段:原始单位为「元」,同时提供 `*_yi`(亿)。 涨停概览中的赚钱效应、炸板率由股池与涨跌家数汇总计算。 ## 快照结构(节选) ```json { "ts": "...", "trade_date": "...", "indices": {}, "board_industry": [], "board_concept": [], "board_industry_increase": [], "board_concept_increase": [], "rankings": {}, "moneyflow": { "market_realtime": {}, "stock_main_inflow": [], "industry_board": [], "concept_board": [], "monitor": {}, "focus_boards": { "industry_pct_top5": [], "concept_pct_top5": [], "industry_pct_down_top5": [], "concept_pct_down_top5": [], "industry_inflow_top5": [], "concept_inflow_top5": [] } }, "limit_up": { "overview": {}, "pools": { "ztgc": [], "zrzt": [], "qsgc": [], "cxgc": [], "zbgc": [], "dtgc": [] } }, "marquee": { "latest_news": [], "pkyd": [] }, "meta": { "ok": true, "errors": [], "elapsed_ms": 0 } } ``` 交易系统固定读 `data/latest.json`;Python 版还可查 SQLite: - `moneyflow_market`:每分钟大盘资金 - `moneyflow_market_daily`:按交易日覆盖 - `stock_moneyflow_latest` / `board_*_latest` / `limit_pool_latest` ## Python 与 Go 两版共用根目录 `config.yaml`,成功路径下 JSON 结构与 TopN 规则对齐。差异仅在: | | Python | Go | |---|---|---| | SQLite | 写 `data/market.db` | 不写 | | 推荐场景 | 开发对照 / 探测 | 生产长跑二进制 | ## 探测接口 ```bash python scripts/probe_apis.py ``` ## 说明与风险 - 接口为东财前端同源公开接口,非官方稳定 SLA,可能改参/限流。 - 请控制频率(默认 1 次/分钟),仅供研究与自用系统对接。 - 不构成投资建议。