Package: akshare
AKShare VIP 交流群欢迎大家的加入，加群方式请点击【加群】相关视频教程已经发布：《AKShare-初阶-使用教学》、《AKShare-初阶-实战应用》、《AKShare-源码解析》、《开源项目巡礼》，详情请访问课程查看更多课程信息！AKQuant 量化教程请访问：利用 PyBroker 进行量化投资本次发布AKTools作为 AKShare 的 HTTP API 版本，突破 Python 语言的限制，欢迎各位小伙伴试用并提出更好的意见或建议！ 点击AKTools查看使用指南。另外提供awesome-data方便各位小伙伴查询各种数据源。OverviewAKSharerequires Python(64 bit) 3.8 or greater, aims to make fetch financial data as convenient as possible.Write less, get more!Documentation:中文文档InstallationGeneralpipinstallakshare--upgradeChinapipinstallakshare-ihttp://mirrors.aliyun.com/pypi/simple/--trusted-host=mirrors.aliyun.com--upgradePRPlease check outdocumentationif you want to contribute to AKShareDockerPull imagesdockerpullregistry.cn-shanghai.aliyuncs.com/akfamily/aktools:jupyterRun Containerdockerrun-itregistry.cn-shanghai.aliyuncs.com/akfamily/aktools:jupyterpythonTestimportakshareasakprint(ak.__version__)UsageDataCodeimportakshareasakstock_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)Output日期          开盘   收盘    最高  ...  振幅   涨跌幅  涨跌额  换手率
0     2017-03-01   9.49   9.49   9.55  ...  0.84  0.11  0.01  0.21
1     2017-03-02   9.51   9.43   9.54  ...  1.26 -0.63 -0.06  0.24
2     2017-03-03   9.41   9.40   9.43  ...  0.74 -0.32 -0.03  0.20
3     2017-03-06   9.40   9.45   9.46  ...  0.74  0.53  0.05  0.24
4     2017-03-07   9.44   9.45   9.46  ...  0.63  0.00  0.00  0.17
          ...    ...    ...    ...  ...   ...   ...   ...   ...
1610  2023-10-16  11.00  11.01  11.03  ...  0.73  0.09  0.01  0.26
1611  2023-10-17  11.01  11.02  11.05  ...  0.82  0.09  0.01  0.25
1612  2023-10-18  10.99  10.95  11.02  ...  1.00 -0.64 -0.07  0.34
1613  2023-10-19  10.91  10.60  10.92  ...  3.01 -3.20 -0.35  0.61
1614  2023-10-20  10.55  10.60  10.67  ...  1.51  0.00  0.00  0.27
[1615 rows x 11 columns]PlotCodeimportakshareasakimportmplfinanceasmpf# Please install mplfinance as follows: pip install mplfinancestock_us_daily_df=ak.stock_us_daily(symbol="AAPL",adjust="qfq")stock_us_daily_df=stock_us_daily_df[["open","high","low","close","volume"]]stock_us_daily_df.columns=["Open","High","Low","Close","Volume"]stock_us_daily_df.index.name="Date"stock_us_daily_df=stock_us_daily_df["2020-04-01":"2020-04-29"]mpf.plot(stock_us_daily_df,type='candle',mav=(3,6,9),volume=True,show_nontrading=False)OutputCommunicationPay attention to数据科学实战Official Accounts to get more information about Quant, ML, DS and so on, please visit数据科学实战for more information:Pay attention to数据科学实战WeChat Official Accounts to get theAKShareupdated info:Application to addAKShare-VIP QQ groupand talk aboutAKShareissues, please contactAKShare-小助手 QQ: 1254836886FeaturesEasy of use: Just one line code to fetch the data;Extensible: Easy to customize your own code with other application;Powerful: Python ecosystem.TutorialsOverviewInstallationTutorialData DictSubjectsContributionAKShareis still under developing, feel free to open issues and pull requests:Report or fix bugsRequire or publish interfaceWrite or fix documentationAdd test casesNotice: We useBlackto format the codeStatementAll data provided byAKShareis just for academic research purpose;The data provided byAKShareis for reference only and does not constitute any investment proposal;Any investor based onAKShareresearch should pay more attention to data risk;AKSharewill insist on providing open-source financial data;Based on some uncontrollable factors, some data interfaces inAKSharemay be removed;Please follow the relevant open-source protocol used byAKShare;Provide HTTP API for the person who uses other program language:AKTools.Show your styleUse the badge in your project's README.md:[![Data: akshare](https://img.shields.io/badge/Data%20Science-AKShare-green)](https://github.com/akfamily/akshare)Using the badge in README.rst:.. image:: https://img.shields.io/badge/Data%20Science-AKShare-green
    :target: https://github.com/akfamily/akshareLooks like this:CitationPlease use thisbibtexif you want to cite this repository in your publications:@misc{akshare,
    author = {Albert King},
    title = {AKShare},
    year = {2019},
    publisher = {GitHub},
    journal = {GitHub repository},
    howpublished = {\url{https://github.com/akfamily/akshare}},
}AcknowledgementSpecial thanksFuSharefor the opportunity of learning from the project;Special thanksTuSharefor the opportunity of learning from the project;Thanks for the data provided by生意社网站;Thanks for the data provided by奇货可查网站;Thanks for the data provided by中国银行间市场交易商协会网站;Thanks for the data provided by99期货网站;Thanks for the data provided by英为财情网站;Thanks for the data provided by中国外汇交易中心暨全国银行间同业拆借中心网站;Thanks for the data provided by金十数据网站;Thanks for the data provided by和讯财经网站;Thanks for the data provided by新浪财经网站;Thanks for the data provided byOxford-Man Institute 网站;Thanks for the data provided byDACHENG-XIU 网站;Thanks for the data provided by上海证券交易所网站;Thanks for the data provided by深证证券交易所网站;Thanks for the data provided by北京证券交易所网站;Thanks for the data provided by中国金融期货交易所网站;Thanks for the data provided by上海期货交易所网站;Thanks for the data provided by大连商品交易所网站;Thanks for the data provided by郑州商品交易所网站;Thanks for the data provided by上海国际能源交易中心网站;Thanks for the data provided byTimeanddate 网站;Thanks for the data provided by河北省空气质量预报信息发布系统网站;Thanks for the data provided by南华期货网站;Thanks for the data provided byEconomic Policy Uncertainty 网站;Thanks for the data provided by微博指数网站;Thanks for the data provided by百度指数网站;Thanks for the data provided by谷歌指数网站;Thanks for the data provided by申万指数网站;Thanks for the data provided by真气网网站;Thanks for the data provided by财富网站;Thanks for the data provided by中国证券投资基金业协会网站;Thanks for the data provided byExpatistan 网站;Thanks for the data provided by北京市碳排放权电子交易平台网站;Thanks for the data provided by国家金融与发展实验室网站;Thanks for the data provided byIT桔子网站;Thanks for the data provided by东方财富网站;Thanks for the data provided by义乌小商品指数网站;Thanks for the data provided by中国国家发展和改革委员会网站;Thanks for the data provided by163网站;Thanks for the data provided by丁香园网站;Thanks for the data provided by百度新型肺炎网站;Thanks for the data provided by百度迁徙网站;Thanks for the data provided by新型肺炎-相同行程查询工具网站;Thanks for the data provided by新型肺炎-小区查询网站;Thanks for the data provided by商业特许经营信息管理网站;Thanks for the data provided by慈善中国网站;Thanks for the data provided by思知网站;Thanks for the data provided byCurrencyscoop 网站;Thanks for the data provided by新加坡交易所网站;Thanks for the tutorials provided by微信公众号: Python大咖谈.Backer and Sponsor