使用 Python 模块从 Yahoo! Finance 获取股票数据
Yahoo!, Y!Finance 和 Yahoo! finance 是 Yahoo, Inc. 的注册商标。 yhoo-finance 并非由 Yahoo, Inc. 认可或审核,而是一款开源工具,利用了 Yahoo 公开提供的 API,旨在用于研究和教育目的。 有关您使用实际下载的数据的权利,请参阅雅虎的使用条款(https://policies.yahoo.com/us/en/yahoo/terms/product-atos/apiforydn/index.htm, https://legal.yahoo.com/us/en/yahoo/terms/otos/index.html, https://policies.yahoo.com/us/en/yahoo/terms/index.htm)。请记住,雅虎财务 API 仅供个人使用。
了解问题 ------------
Yahoo! Finance 后端为 http://datatables.org/. 如果此服务处于停止状态或存在网络问题,您将收到来自 YQL 组的错误,例如 YQLQueryError。
从 yahoo_finance 中导入 Share yahoo = Share('YHOO') print yahoo.get_open() '36.60' print yahoo.get_price() '36.84' print yahoo.get_trade_datetime() '2014-02-05 20:50:00 UTC+0000' 从市场刷新数据 .. 代码:: Python yahoo.refresh() print yahoo.get_price() '36.87' print yahoo.get_trade_datetime() '2014-02-05 21:00:00 UTC+0000' 历史数据 .. 代码:: Python print yahoo.get_historical('2014-04-25', '2014-04-29') [{u'Volume': u'28720000', u'Symbol': u'YHOO', u'Adj
暂无开放 Issues,或尚未同步最近议题。