Fetch daily historical price data for any Chinese A-share stock to backtest a quantitative trading strategy.
Get real-time quotes and five-level order book data for live analysis of Shanghai and Shenzhen stocks.
Access industry classifications and concept group memberships for stock screening and filtering.
Build a data pipeline that automatically switches between TongHuaShun and EastMoney if one source becomes unavailable.
Install with a single pip command, all documentation is in Chinese, which may require translation for non-Chinese speakers.
AData is a free, open-source Python library that provides access to Chinese A-share stock market data, built for people constructing quantitative trading strategies. "A-shares" are the domestic stocks listed on the Shanghai and Shenzhen stock exchanges inside mainland China. The library gives you a consistent Python interface to fetch prices, trading history, and company information for those stocks. The library covers a wide range of data types: daily, weekly, and monthly price histories (called K-line data in Chinese financial convention), real-time quotes, intraday minute-level data, dividend records, industry classifications, concept group memberships, stock index compositions, and the official trading calendar. Most of this data is assembled by pulling from several public Chinese financial data providers, including TongHuaShun and EastMoney, and merging them automatically. If one source becomes unavailable the library can switch to another, which the project describes as its main strategy for keeping data accessible. You can also configure a proxy to route requests through a different IP address if the public sources impose access limits. Installation is a single pip command. Once installed, a call like adata.stock.info.all_code() returns a table of every listed A-share code and company name. A call like adata.stock.market.get_market() with a stock code and date range returns the full daily price history for that ticker as a data table ready to work with in Python. Other calls cover real-time snapshots, five-level order book data, ETF and fund data, and macro indicators. The project focuses entirely on A-shares and is not aimed at US, Hong Kong, or other markets. Its stated goal is to support individual quantitative traders who want clean, reliable data without paying for a commercial data subscription. The README and all documentation are written in Chinese, reflecting its primary audience.
← 1nchaos on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.