Tushare的主力就是python!很多时候,我没有安装,或者无法安装pandas ,tushare,但我想要获取股票数据
我用python演示一下!其他语言也可以!
import requests
import json
targetURL = 'http://api.waditu.com'dataR = {}
dataR["api_name"] = "daily"
dataR["token"] = "点击注册一个token"
dataR["params"] = {"trade_date": "20210415", "adj": "qfq"}
dataR["fields"] = "close,open,ts_code"
r = requests.post(targetURL, data=json.dumps(dataR))r = r.json()
print(r['data']["items"])