yfinance README

The project's README from github.com/ranaroussi/yfinance. As one markdown file: README.md.

Download market data from Yahoo! Finance's API

Python version PyPi version PyPi status PyPi downloads Star this repo Follow me on twitter

ranaroussi%2Fyfinance | Trendshift

yfinance offers a Pythonic way to fetch financial & market data from Yahoo!Ⓡ finance.


[!IMPORTANT]
Yahoo!, Y!Finance, and Yahoo! finance are registered trademarks of Yahoo, Inc.

yfinance is not affiliated, endorsed, or vetted by Yahoo, Inc. It's an open-source tool that uses Yahoo's publicly available APIs, and is intended for research and educational purposes.

You should refer to Yahoo!'s terms of use (here, here, and here) **for details on your rights to use the actual data downloaded.

Remember - the Yahoo! finance API is intended for personal use only.**


[!TIP] THE NEW DOCUMENTATION WEBSITE IS NOW LIVE! 🤘

Visit ranaroussi.github.io/yfinance


Main components

Installation

Install yfinance from PYPI using pip:

$ pip install yfinance

To install without curl_cffi for requests fallback, see Advanced ▸ Installation.

yfinance relies on the community to investigate bugs and contribute code. Here's how you can help.


Star History Chart


yfinance is distributed under the Apache Software License. See the LICENSE.txt file in the release for details.

AGAIN - yfinance is not affiliated, endorsed, or vetted by Yahoo, Inc. It's an open-source tool that uses Yahoo's publicly available APIs, and is intended for research and educational purposes. You should refer to Yahoo!'s terms of use (here, here, and here) for details on your rights to use the actual data downloaded.


P.S.

Please drop me a note with any feedback you have.

Ran Aroussi

yfinance (ranaroussi/yfinance)

Searching Database…

25.5K ·GitHub
这是什么东西?yfinance 是一个 Python 库,可以直接在 Python 代码里从 Yahoo! Finance 的 API 下载金融和市场数据——股票行情、实时数据流、搜索和筛选查询等。
它是我导入到自己代码里用的库,还是一个托管服务?它是一个 Python 库:从 PyPI 安装后在代码里调用即可,不需要运行任何服务器或应用。
怎么把它加到我的项目里?用 pip 从 PyPI 安装(pip install yfinance)。完整文档在专门网站 ranaroussi.github.io/yfinance 上。
除了 Python,我还需要安装别的东西吗?不需要单独的服务——pip 会把所有依赖一起装好。默认安装包含 curlcffi(用于请求的备用方案);文档在 Advanced ▸ Installation 下介绍了不安装它的方法。
这是 Yahoo 的官方产品吗?不是——yfinance 与 Yahoo 没有任何隶属、认可或审核关系。它是一个独立的开源工具,使用 Yahoo 公开提供的 API,因此 Yahoo 对此不做任何保证。
许可证允许什么——对代码和对数据分别是怎么规定的?代码采用 Apache 软件许可证(Apache-2.0)。但 Yahoo! finance API 仅限个人使用,下载的数据的权利由 Yahoo 的使用条款约束。
可以一次获取多只股票的数据吗?可以。Tickers 对象可以处理多个代码,download 函数一次调用就能获取多个代码的市场数据;单个 Ticker 只对应一个代码。
它提供实时价格,还是只有历史数据?也有实时数据:yfinance 除了常规下载之外,还附带 WebSocket 和 AsyncWebSocket 组件,用于实时数据流。
能搜索行情和新闻,或者按条件筛选股票吗?可以——Search 组件返回搜索到的行情和新闻,EquityQuery 和 Screener 可以构建查询来筛选市场,Sector 和 Industry 组件则提供板块和行业信息。
这是个成熟的项目,还是周末随便写的小玩意?它从 2017 年 5 月就存在了,在 GitHub 上有超过 25,000 颗星。维护由社区驱动:README 中说 yfinance 依靠社区来调查 bug 并贡献代码。
Creator
ranaroussi
Size
10 MB
Stars
25.5K
Age
9y
Commits · 90 Days