Registry / data / akshare

akshare

JSON →
library1.18.94pypypi✓ verified 24d ago

AKShare is an elegant and simple financial data interface library for Python, built for human beings! It provides a comprehensive set of tools for acquiring fundamental, real-time, and historical market data for various financial products like stocks, futures, options, funds, foreign exchange, bonds, and cryptocurrencies. The library is actively developed with frequent releases, often multiple minor versions per day, to adapt to changes in data sources.

pip install akshare --upgrade
INSTALL
IMPORT
SIG · AKSHARE
A
akshare
datapythonv1.18.94
Install
12.5s avg
Import
2051ms
Disk
283MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.18.88 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 2.132s · 284.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 12.5s · import 1.970s · 277MB
283MB installed
● package 283MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ak
import akshare as ak

This quickstart fetches historical daily A-share stock data for a specified symbol and date range using the `stock_zh_a_hist` interface. The `adjust` parameter can be used for different ex-dividend adjustments.

import akshare as ak # Fetch historical A-share stock data for a specific symbol # Replace '000001' with your desired stock code stock_data = ak.stock_zh_a_hist(symbol="000001", period="daily", start_date="20230101", end_date='20231231', adjust="") print(stock_data.head())
Debug
Known issues
breakingDue to its web scraping nature, underlying data sources frequently change their website layouts, leading to API breakage or interface name changes. Users must frequently update the library.
fix
Regularly run `pip install akshare --upgrade` and consult the official documentation for updated interface names (e.g., check the '接口更名一览表' section for changes).
affects: All versions, ongoing issue.
gotchaAKShare data is intended for academic research and reference purposes only. It is not designed for real-time, low-latency, or high-frequency trading due to potential delays and interruptions in data acquisition.
fix
Understand the limitations of scraped data and use dedicated broker APIs for high-frequency or production trading systems.
affects: All versions.
gotchaSpecific Python versions are required. While `requires_python` states `>=3.9`, the official documentation recommends Python `3.13.x` or higher for optimal compatibility and performance.
fix
Ensure your Python environment is `3.9` or higher, ideally `3.13.x`.
affects: <3.9, sub-optimal on 3.9-3.12.
gotchaSome interfaces might not support `start_date` and `end_date` parameters, returning all available data for a given symbol. Users need to manually filter dataframes for specific date ranges.
fix
Check interface documentation for parameter availability; if not present, filter the returned DataFrame using Pandas after data retrieval.
affects: All versions, specific interfaces.
gotchaNaming local Python script files as `akshare.py` will cause import conflicts with the installed `akshare` library.
fix
Avoid naming your Python script files `akshare.py`. Choose a different, descriptive name for your scripts.
affects: All versions.
gotchaNetwork-related errors such as `ReadTimeout` or IP blocking can occur due to frequent data scraping from various sources. Using proxies or reducing request frequency might be necessary.
fix
Implement retry logic, utilize a proxy server (if configured), or decrease the rate of data requests to mitigate these issues.
affects: All versions.
gotchaSome functionalities, especially when running on Linux systems, may require an external JavaScript runtime environment (like `Node.js`) to be installed and available in the system path.
fix
If encountering `execjs._exceptions.RuntimeUnavailableError`, install `Node.js` in your environment.
affects: All versions, specific environments/interfaces.
Upgrade
Version history
1.18.94latest on PyPI · released Aug 21, 2026
Audit
Dependencies
pandasrequiredRequired for data processing and DataFrame manipulation (version >=0.25.2, recommended >=1.0).
nodejsoptionalRequired for some data interfaces that rely on JavaScript execution, especially on Linux systems.
Agent activity
231 hits · last 30 days
node
214
OpenAI (training)
2
Perplexity
1
panscient.com
1
Resources
akshare — pip install akshare · libregistry