Python 3 获取 股票期权等数据

Posted bruce_he

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python 3 获取 股票期权等数据相关的知识,希望对你有一定的参考价值。

1. 获取 API 

1)注册 https://tushare.pro/

 

2. Python 安装 tushare 库 

"pip install tushare"

 

 

3. 通过接口获取数据

https://tushare.pro/document/2?doc_id=25

import tushare as ts

pro = ts.pro_api(\'xxxxxxxx\')  #tushare token

df = pro.daily(ts_code = \'000001.SZ\', start_date = \'20181201\', end_date = \'20181220\')

print(df)

data = pro.query(\'stock_basic\', exchange=\'\', list_status=\'L\', fields=\'ts_code,symbol,name,area,industry,list_date\')
print(data)
View Code

 

以上是关于Python 3 获取 股票期权等数据的主要内容,如果未能解决你的问题,请参考以下文章