Skip to content

AKShare

Python library for fetching Chinese and global financial data with simple function calls.

Stars
23.2k
Forks
3.6k
Licence
MIT
Language
Python
Last update
4 days ago
Type
Library

What it is

AKShare is a Python library that gives you functions to download financial data, such as stock price history, bonds, funds and futures, in a few lines of code. It returns the data as tables you can analyze or chart. People use it for academic research and personal financial data analysis, and its README notes the data is for reference only, not investment advice.

  • Download daily price history for a China A-share stock with ak.stock_zh_a_hist
  • Search for an interface by keyword with ak.search to find the right data function
  • Look up parameters and output columns of a single interface with ak.interface_info
  • Plot candlestick charts of US stock data together with the mplfinance package

Great for

  • Python users doing academic or personal research on Chinese financial markets
  • Data analysts who want historical stock price tables without writing scrapers
  • Students learning data analysis with real financial data
  • Developers who want to feed financial data to other tools or AI assistants via the companion AKTools project

Not ideal for

  • Anyone needing guaranteed, licensed, production-grade market data, since the README says some interfaces may be removed and data is for reference only
  • Users who do not use Python, unless they run the separate AKTools HTTP service
  • Investors looking for ready-made trading advice, since the project explicitly disclaims investment recommendations
Step-by-step guide: how to use AKShareInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Python 3.11 or higher (64-bit)

    Install with pip

    pip install akshare --upgrade

    Install with uv (recommended by README)

    uv pip install akshare --upgrade
  2. 2

    Run it

    • Install Python 3.11 or higher
    • Run the install command with pip or uv
    • Open a Python session and run: import akshare as ak
    • Call a function such as ak.stock_zh_a_hist(symbol="000001", period="daily", start_date="20170301", end_date="20231022", adjust="") and print the result
  3. 3

    Get the most out of it

    • Use ak.search("keywords", limit=5) to discover the right interface name before coding
    • Use ak.interface_info("name") to read parameters and output columns for an interface
    • Install mplfinance to chart the returned price data as candlesticks
    • Use the AKTools project to access the data over HTTP or through an MCP server for AI assistants

Downloads

Strengths

  • Simple, one-line function calls to fetch data, as described in the README
  • Offline keyword search helps find interface names without network access
  • MIT licensed and actively pushed, with a large user base (23,127 stars)

Trade-offs

  • Data comes from third-party sources such as Eastmoney, and the README warns some interfaces may be removed for uncontrollable reasons
  • Interface search is keyword matching, not semantic search, so you must know roughly what to look for
  • Documentation is primarily in Chinese; the README links to a Chinese docs site

How it compares

ProjectStarsTypeLevelUpdatedBest for
akshare (this)23.2kLibrarybeginner4 days agoPython users doing academic or personal research on Chinese financial markets
awesome-bigdata14.7kCurated listbeginner7 days agoDevelopers looking for an overview of big data tools to evaluate
awesome-public-datasets79.9kCurated listbeginner9 days agoData analysts looking for a starting point on a new topic
llama_index52.8kLibraryintermediate11 days agoPython developers building retrieval-augmented generation (RAG) apps over private documents
qlib49.9kLibraryadvanced7 days agoQuant researchers who want a structured ML workflow for stock data
Data-Science-For-Beginners37.9kLearning resourcebeginner16 days agoComplete beginners who want a guided, week-by-week data science course

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.