501379
1.Tusharehttps://tushare.pro/
Tushare是一个数据丰富、获取简单的金融数据社区。Tushare免费提供各类数据,助力量化研究。Tushare提供快速便捷的金融数据接口。
2.Tushare调用与Tushare Pro
Tushare 旧版为Tushare。Tushare 新版为Tushare Pro。Tushare旧版与Tushare Pro(新版)调用命令有所不同。现调用部分帖子中的旧版命令,Tushare Pro会出现报错:
“
本接口即将停止更新,请尽快使用Pro版接口:https://tushare.pro/document/2
”
3.Tushare Pro(新版)接口调用方法:
注册账户 https://tushare.pro,右上角【注册】获取token 登录成功>>个人主页>>用户中心>>接口token>>复制token调取数据 (Python)
(1)初始化pro接口
import tushare as tspro = ts.pro_api('your token')
(2)数据调取
例如:SH建设银行601939 周线行情
# 拉取数据df = pro.weekly(**{"ts_code": "601939.SH","trade_date": "","start_date": "","end_date": "","limit": "","offset": ""}, fields=["ts_code","trade_date","close","open","high","low","pre_close","change","pct_chg","vol","amount"])print(df)
注:Tushare提供了更加方便的数据工具,可设置参数直接生成调用代码。
网页入口在【数据工具】中
4.Tushare 数据资源目录一览
行情数据:
资讯数据:
5. 高校师生免费支持
在校学生和高校老师,加入Tushare高校群 ,登录Pro个人主页提交个人和单位信息可获得免费支持。Tushare大数据社区