Skip to main content

FinchX

FinchX 是面向 A 股的 Python 数据接口,提供行情、资金流、公司与财务资料,以及新闻、公告、研报等数据。完整接口、参数和业务字段见 API 文档。

接口直接返回原生 dict 或 list,便于查询、分析和接入自己的交易研究流程。

FinchX 3.0

FinchX 3.0 相对旧版有重大更新:重构接口架构与业务分类,统一参数规范,重新核对数据字段、单位和来源语义,并加强完整性校验与错误处理。强烈推荐旧版用户升级到 3.1。

3.0 的接口、参数和返回结构与 2.x 不兼容。 请保留旧环境,在独立环境按 API 文档逐项迁移调用和字段读取。

3.1 新增 fx.reports.fetch,按关键词聚合爱股票、东方财富和易观研报,自动获取来源提供的摘要或正文及 PDF 链接。

3.1.1 新增 fx.reports.agp_fetch、fx.reports.em_fetch 和 fx.reports.analysys_fetch,支持各来源无关键词目录获取和关键词搜索。四个研报接口统一按完全相同的标题、机构和发布日期去重,保留跨日同名报告;三个独立接口的客户端超时按每次 HTTP 请求计算。原 fx.reports.agp_list 和 fx.reports.agp_get 已由 fx.reports.agp_fetch 替代,自动完成目录和详情读取。

3.1.2 新增 fx.fupan.jygs_replay_ego,复用 Ego Lite 中的韭研公社登录状态,返回结构与原复盘接口相同。热榜接受来源提供的合法正整数市场类别,修复市场值 22 导致整榜失败的问题。论坛接口新增可选 on_missing_reply 回调,可处理官网主题页和精确回复页均成功读取但目标回复缺失的情况。

**3.1.2 热榜返回字段有变化:**股票、可转债和 ETF 热榜删除 exchange,板块热榜删除 related_etf_exchange;读取这些字段的调用代码需要同步调整。ETF 同热度时按证券代码、完整来源市场身份稳定排序。详细字段与回调规则见 API 文档。

3.1.3 为 fx.market.ohlcv 增加同花顺 HXKline 日线来源,可通过 source="tonghuashun" 选择,原有调用仍默认使用腾讯。FinchX(use_proxy=False) 可让该实例的 HTTP 请求绕过系统和环境代理,默认仍使用代理。

3.1.5 优化偏离值交易日历查询,并改善同花顺和爱股票文章的来源字段兼容性。

安装

安装:

python -m pip install finchx

需要 Python 3.10 或更新版本。建议使用独立虚拟环境。

已有用户升级到 3.1.5:

python -m pip install --upgrade 'finchx==3.1.5'

按需安装可选依赖:calendar 用于离线交易日历及自动日历回退,pdf 用于 PDF 文字层和原生书签提取,jygs 用于原韭研复盘接口 fx.fupan.jygs_replay。可组合安装,只保留需要的项:

python -m pip install --upgrade 'finchx[calendar,pdf,jygs]==3.1.5'

使用 fx.fupan.jygs_replay 还须在同一 Python 环境安装 Chromium,并在调用时传入自己的 SESSION:

python -m playwright install chromium

使用 fx.fupan.jygs_replay_ego 时,先安装并启动 Ego Lite,确保 ego-browser 命令可用,并在 Ego Lite 中登录韭研公社。

快速开始

查询当前涨幅排名前五的股票:

from finchx import FinchX

fx = FinchX(timeout=15.0)
rows = fx.market.ranking(limit=5)
print(rows)

每次调用重新取数,不提供结果缓存或文件保存。字段、单位、缺失值和认证要求请按各接口文档处理。

Metadata

Release files for finchx 3.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for finchx 3.1.5
File Size Uploaded Provenance Actions
finchx-3.1.5.tar.gz 883.0 kB With provenance Details for finchx-3.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for finchx 3.1.5
File Interpreter ABI Platform Actions
finchx-3.1.5-py3-none-any.whl Python 3 none any Details for finchx-3.1.5-py3-none-any.whl

Total release size: 1.1 MB

Release files / finchx-3.1.5.tar.gz

Download URL finchx-3.1.5.tar.gz
Size 883.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6be5e048af38f8ba0a8f6fd0c3b44c046a412a11a07a7f96cffd79c40bb4761d
BLAKE2b-256 checksum
How to use checksums
52d1c62a44ae187825f8f000a7a68a85ccab1a143a07e92b895caa873d893c1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / finchx-3.1.5-py3-none-any.whl

Download URL finchx-3.1.5-py3-none-any.whl
Size 219.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26117251319fce469bff8b2cbf9bdeb22ae84c22b9c01ec001bfde6d7180f326
BLAKE2b-256 checksum
How to use checksums
04a2ba02008e4a1c796882db22674da553501e2c317aa03e1944140d689ed241
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Security for finchx 3.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for finchx-3.1.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page