electkismet/eltdx

通达信A股行情协议 Python 库,MCP,支持快照、分时、逐笔、K 线、集合竞价、特殊指标等接口。适合作为量化数据源,支持其他语言通过HTTP或WebSocket调用

What it solves

eltdx is a high-performance Python API and client for accessing TongdaXing (TDX) quantitative data. It allows users to retrieve A-share market data, including real-time quotes, K-lines, trade details, and company information (F10), without needing to build the protocol implementation from scratch.

How it works

The project provides a modular Python API that interfaces with TDX online market protocols. In version 3.0, the core logic—including packet construction, parsing, connection pooling, and heartbeat management—has been migrated to a Rust engine for improved performance. It supports multiple access methods:

  • Python API: Direct usage via TdxClient or F10Client.
  • MCP Tool Service: Provides market data and F10 capabilities to MCP clients.
  • Cross-Language Gateway: A FastAPI-based gateway that exposes data via HTTP JSON and WebSocket RPC for languages like Java, Go, and Node.js.

Who it’s for

It is designed for quantitative researchers, traders, and developers who need programmatic access to A-share market data for non-commercial research and learning purposes.

Highlights

  • Rust-Powered Core: Core protocol handling is implemented in Rust for high efficiency.
  • Comprehensive Data Coverage: Access to K-lines (with various adjustment types), real-time 5-level depth, trade details, auction data, and F10 company profiles.
  • Flexible Deployment: Can be used as a library, an MCP tool, or a standalone HTTP/WebSocket server.
  • Modular API: Organized by data type (quotes, bars, minutes, trades, corporate, etc.) for intuitive access.

Related

  • Project
  • Project