一個美股行情工具包,能夠用來獲取美股股票列表、實時行情、歷史k線數據。python
python 3.xgit
pip install openstock
複製代碼
from openstock.stock.client import StockClient
token = '8aa9be32f402301d'
stock_client = StockClient(token)
複製代碼
token申請地址: stock.mypython.me/app/apply_t…github
stock_list = stock_client.get_stock_list()
print(stock_list)
複製代碼
stock_quote = stock_client.get_stock_quote(query=['BABA','JD'])
print(stock_quote)
複製代碼
stock_bars = stock_client.get_stock_bars(query=['BABA','JD'])
print(stock_bars)
複製代碼