Skip to content
A util for US stock market
Python
Branch: master
Clone or download
Latest commit 99ef040 May 7, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
openstock sync May 6, 2019
LICENSE sync May 6, 2019
README.md sync README.md May 7, 2019

README.md

A util for US stock market

简介

一个美股行情工具包,可以用来获取美股股票列表、实时行情、历史k线数据。

环境

python 3.x

安装

pip install openstock

使用

  • 初始化
from openstock.stock.client import StockClient

token = '8aa9be32f402301d' 
stock_client = StockClient(token)

token申请地址: https://stock.mypython.me/app/apply_token

  • 获取美股代码列表
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)
You can’t perform that action at this time.