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)