Scripts2026年7月17日·1 分钟阅读

A-Stock-Data — Full-Stack Data Toolkit for China A-Share Markets

Open-source Python data toolkit covering 43 endpoints and 15 data sources for comprehensive China A-share stock market analysis.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
A-Stock-Data Overview
直接安装命令
npx -y tokrepo@latest install d5128596-81fb-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

A-Stock-Data is an open-source Python toolkit that provides comprehensive data access for the China A-share stock market. With 43 endpoints across 15 data sources, it covers real-time quotes, research reports, capital flows, chip distribution, company announcements, ETF options, and market sentiment — all with built-in fallback sources for reliability.

What A-Stock-Data Does

  • Fetches real-time and historical price data for all A-share listed stocks
  • Retrieves institutional research reports and analyst ratings
  • Tracks capital flows including northbound (QFII) and block trade data
  • Provides chip distribution and shareholder concentration analysis
  • Aggregates company announcements, financial statements, and board activity

Architecture Overview

The toolkit uses a 10-layer architecture with data source adapters at the bottom, a normalization layer that standardizes output across sources, a caching layer for rate-limit management, and a clean Python API at the top. Each endpoint has up to 3 fallback data sources that activate automatically on failure. Data is returned as pandas DataFrames for easy integration with analysis workflows.

Self-Hosting & Configuration

  • Install from PyPI with pip install a-stock-data
  • No API keys required for basic market data from public sources
  • Configure premium data sources (e.g., Wind, Choice) in config.yaml if available
  • Built-in request rate limiting respects source quotas automatically
  • Works as a library in scripts or as an MCP server for agent integration

Key Features

  • 43 endpoints covering quotes, fundamentals, technicals, sentiment, and alternatives
  • 15 integrated data sources with automatic failover and degradation
  • Pandas DataFrame output for seamless integration with data science workflows
  • Built-in rate limiting and caching for responsible data access
  • MCP server mode for direct use by AI agents in research workflows

Comparison with Similar Tools

  • Tushare — popular A-share data library but requires registration and has strict rate limits; A-Stock-Data offers more fallback sources
  • AkShare — broad financial data library; A-Stock-Data focuses deeper on A-share with more endpoints per category
  • baostock — free A-share data with limited real-time support; A-Stock-Data adds real-time quotes and sentiment data
  • Wind/Choice API — commercial terminals with comprehensive data; A-Stock-Data provides a free open-source alternative
  • yfinance — designed for US markets; A-Stock-Data is purpose-built for China A-shares

FAQ

Q: Is an API key required? A: No, basic endpoints use publicly available data sources. Premium sources can be optionally configured.

Q: How real-time is the data? A: Real-time quotes have a typical delay of 1-3 seconds depending on the source, matching most free data APIs.

Q: Can I use this for backtesting? A: Yes, historical data endpoints provide daily, weekly, and minute-level OHLCV data suitable for backtesting frameworks.

Q: Does it support Hong Kong or US stocks? A: The primary focus is China A-shares (Shanghai and Shenzhen exchanges). Some endpoints include Hong Kong Connect data.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产