AKShare

1.18.54 · active · verified Fri Apr 10

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.

Warnings

Install

Imports

Quickstart

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())

view raw JSON →