AKShare: A Python Interface Library for Chinese Market Data
AKShare is an elegant and simple financial data interface library for Python, built for human beings.
At a glance
- What is it?
- AKShare wraps hundreds of Chinese financial data endpoints behind one-line Python functions, with an offline interface registry for lookup. It is a scraper-backed library, so interface availability tracks the upstream sites rather than the release cycle.
- Who is it for?
- Adopt AKShare if you need pandas DataFrames of Chinese market data and can accept interfaces that depend on third-party sites. Do not adopt it if you need a contractual data SLA or non-Chinese coverage as the primary source.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 1 day ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 13, 2026, and from our analysis. They are not legal advice.
Star history
- akfamily/akshare23,331 ★ · +650
| Repository | 2026-09-21 | 2026-11-13 |
|---|---|---|
| akfamily/akshare | 22.7k | 23.3k |
650 Stars in the last 53 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
What AKShare Replaces for a Python Analyst
The problem AKShare addresses is narrow and practical. Chinese market data is spread across exchange pages, data portals and vendor sites, each with its own request shape, encoding and column names. AKShare collects those endpoints behind functions that return pandas DataFrames, so a backtest script does not need one parser per source. The README's own example is a single call that returns daily bars for a mainland stock, and the printed frame carries Chinese column headers such as 日期, 开盘, 收盘, 最高, 振幅, 涨跌幅 and 换手率.
The audience is quantitative researchers, students and analysts working in Python who need Chinese equities, bonds, funds, futures, options, currencies and macro series in one namespace. The package metadata lists stock, option, futures, fund, bond, index and air among its keywords. That combination suggests coursework and research prototyping more than production trading infrastructure.
The library is not a data vendor. It is a client layer. That distinction drives most of the limitations below.
How the Interface Layer Is Organized
Every dataset is exposed as a module-level function on the akshare package. The README shows ak.stock_zh_a_hist for mainland A-share history and ak.stock_us_daily for US daily bars, and the naming follows a source-and-subject convention: stock_zh_a_hist, bond_cb_jsl, bond_zh_hs_cov_min, fund_etf_spot_em. The suffix often names the upstream provider, so the function name tells you which site the data came from.
Underneath, the dependencies in pyproject.toml describe the mechanism: requests and curl_cffi for HTTP, beautifulsoup4, lxml and html5lib for parsing, openpyxl and xlrd for spreadsheets, and mini-racer (or py-mini-racer and akracer on Linux) for JavaScript execution. A JavaScript engine in the dependency list is the clearest signal that some interfaces must run page scripts to obtain data. That is a scraping architecture, not a database replica.
AKShare also ships an offline interface registry. ak.search performs keyword matching over that registry, and ak.interface_info returns the parameters, output columns and a usage example for a named interface. The README is explicit that this is keyword matching rather than semantic search, and it points at the registry documentation for the boundaries. For an LLM-driven program that must resolve a description into a callable name, this avoids a network round trip.
Installing AKShare and Pulling a First DataFrame
The package requires 64-bit Python 3.11 or higher. The README recommends `uv pip install akshare --upgrade`, and also gives a plain pip command and China mirror variants.
pip install akshare --upgradeIf you are installing from inside China, the README offers the Tsinghua mirror instead.
pip install akshare --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simpleThe first real use is a historical price pull. The README's example takes a symbol, a period, a date range and an adjust flag, and returns a DataFrame with one row per trading day.
import akshare as ak
stock_zh_a_hist_df = ak.stock_zh_a_hist(symbol="000001", period="daily", start_date="20170301", end_date="20231022", adjust="")
print(stock_zh_a_hist_df)Expect one row per trading day in the range. Before writing that call into a pipeline, resolve the name through the registry: ak.search takes a keyword and a limit, and ak.interface_info takes a full interface name and returns its metadata.
import akshare as ak
search_df = ak.search("可转债 实时行情", limit=5)
print(search_df)
interface_info_dict = ak.interface_info("bond_cb_jsl")
print(interface_info_dict)The README notes that passing a full interface name always ranks that interface first, which makes the registry a reliable way to confirm a half-remembered name.
Where AKShare Breaks: Upstream Dependence
The main failure mode follows from the architecture. Each interface reads a third-party site, so when a page changes its markup, its request parameters or its rate limits, the corresponding function stops returning useful data until maintainers patch it. The release cadence supports that reading: the repository shows v1.20.24 and v1.20.23 on 2026-11-03 and v1.20.22 on 2026-11-02. Frequent patch releases are what you would expect from a library whose inputs are other people's web pages.
If your job depends on a series being complete every morning, you are relying on an upstream site's stability and on the maintainers noticing a break.
Two more boundaries matter. First, coverage is concentrated on Chinese markets; the US daily example exists, but the interface vocabulary is dominated by mainland sources. Second, treat the data as research input rather than a licensed feed for redistribution.
AKShare is the wrong tool when you need guaranteed delivery, or when a compliance review requires a named data provider with a contract.
AKShare vs Tushare and yfinance
Tushare and yfinance differ from AKShare on the axis that matters here: who owns the data path.
Tushare is a data service with a token-based API and an account. Data is served from the provider's own infrastructure, which gives a consistent schema and a point of accountability, and typically gates higher-frequency or wider history behind points or a paid tier. AKShare has no token and no account in the documented install path: you install the package and call a function. The trade is that you inherit each upstream site's behaviour, including its limits and its changes.
yfinance covers global markets with an emphasis outside China. If your universe is US or European equities, yfinance is the more direct fit. AKShare's strength is the Chinese instrument set: A-shares, convertible bonds, ETFs, futures and macro series that yfinance does not carry. Choosing between them is mostly a question of which market you are modelling, not which library is better.
A practical pattern is to use AKShare for the Chinese series and a second source for anything else, keeping the two behind your own loading functions so a single upstream break does not touch the rest of the pipeline.
Maintenance, Licensing and Upgrade Cost
The repository is not archived, and the last push was on 2026-11-01. Releases land close together, which means the upgrade path is frequent rather than annual. Because interfaces track live sites, a pinned version can go stale even though nothing in your own code changed. The practical cost of upgrading is re-checking the interfaces you call after each bump, since a patch release may fix one interface and change another.
Development tooling is kept out of the published package. The pyproject.toml comments explain that development dependencies moved to PEP 735 dependency groups rather than an extra, because extras ship with the package and a dev extra would install pre-commit, sphinx and ruff for end users. That is a small but deliberate packaging decision, and it keeps a plain pip install akshare lean.
The license is MIT, declared in both the repository and pyproject.toml. MIT is permissive: it allows commercial use and modification with the copyright notice retained. What the license does not do is grant you rights to the underlying data. The data comes from third-party sites, and their terms are separate from the library's license. Check the terms of the specific sources behind the interfaces you use before redistributing anything; that is a question for your own counsel, not something the MIT text answers.
Editorial conclusion
Adopt AKShare if you need pandas DataFrames of Chinese market data and can accept interfaces that depend on third-party sites. Do not adopt it if you need a contractual data SLA or non-Chinese coverage as the primary source. Before committing, verify that the specific interface names you plan to call are listed in the registry and check the returned columns on a short date range.
Frequently asked questions
What is AKShare?
AKShare is a Python financial data interface library that wraps many Chinese market data endpoints behind functions returning pandas DataFrames. It requires 64-bit Python 3.11 or higher and installs from PyPI.
How do I install AKShare?
The README gives pip install akshare --upgrade, with uv recommended and a Tsinghua mirror variant for installs from China.
How does AKShare differ from yfinance?
yfinance covers global markets with an emphasis outside China, while AKShare's interface vocabulary is dominated by mainland sources such as A-shares, convertible bonds and ETFs. The choice is mostly about which market you are modelling.
How does AKShare differ from baostock?
On AKShare's side, it exposes each dataset through its own named function and ships an offline registry for looking those names up.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/akfamily-akshare)Star history chart for your README
[](https://hysenlabs.com/projects/akfamily-akshare)Was this useful?