AKShare is an open-source financial data interface library based on Python, with the goal of making obtaining financial data simple and the slogan "Write less, get more!". It requires 64-bit Python 3.11.5 or higher.
Main capabilities: AKShare provides approximately 950 interfaces, covering 15 categories: stock, index, fund, futures, option, bond, fx, macro, interest_rate, spot, energy, crypto, calendar, research, alternative. The interface naming structure is <category><market or entity><topic>_<data source>, for example stock_zh_a_hist_em means stocks, China A-shares, historical quotes, data source East Money. Among quote interfaces, those with daily in the name are daily-only; interfaces with a period parameter (daily, weekly, monthly) are called hist.
Usage: After installing as a Python library, call the interfaces in Python code to obtain data. AKShare comes with an offline interface registry, allowing interface search by keyword without an internet connection, which is suitable for large-model-driven programs to map natural language descriptions to callable interface names. Search is keyword matching rather than semantic retrieval.
Companion project AKTools: AKShare itself does not provide MCP services. AKTools provides MCP services and is registered in the official MCP registry as io.github.akfamily/aktools. AI assistants such as Claude Code, Claude Desktop, and Cursor can find and call all AKShare interfaces based on natural language questions. AKTools does not register the approximately 950 interfaces one by one as tools; instead, it provides 3 general read-only tools that the AI assistant calls in sequence; in stdio mode there is also a 4th tool, save_data (since AKTools 0.1.12), which can save complete data as a local CSV file, not subject to the 1000-row limit of get_data; it writes files and is not markedas read-only. The service started with python -m aktools is at http://127.0.0.1:8080/mcp The above 3 read-only tools are provided via Streamable HTTP, and save_data is not provided; the complete data can be obtained through the CSV download URL returned by get_data. For settings of HTTP mode, proxy, access token, and LAN access, see the MCP Usage Guide. Installation only requires uv, and no other software needs to be installed separately; for uv installation and virtual environment creation, see uv Environment Configuration.
Version changes: From 1.20.41 to 1.20.54, all interfaces were unified under naming rules, and about 320 interfaces were renamed (for example, stock_zh_a_hist was changed to stock_zh_a_hist_em, and stock_zh_index_daily was changed to index_zh_daily_sina); a few parameters were unified as symbol, date, start_date, and end_date, and interfaces whose upstream data sources have been closed were removed. The old names were not retained as aliases, but when called, a hint about where to go will be provided; when calling ak.search with an old name, the current name is also ranked first. For the complete comparison of old and new names, see the interface renaming list at the end of the changelog.
Applicable scenarios: Suitable for scenarios such as quantitative investment research, financial data analysis, and academic research that need to obtain Chinese and global financial data; it is convenient to combine with other programs to customize code, relying on the Python data science ecosystem.
Limitations and notes: The data provided by AKShare is for academic research only, is for reference only, and does not constitute any investment advice; investors who conduct research based on AKShare should pay attention to data risks; affected by uncontrollable factors, some data interfaces may be removed; please comply with the open source license. AKShare is still under continuous development, and issues and pull requests are welcome; before submitting, please read the contribution guide. The project uses Ruff to format code.