Python wrapper for an unofficial Yahoo Finance API
Documentation: https://yahooquery.dpguthrie.com
Interactive Demo: https://yahooquery.streamlit.app/
Source Code: https://github.com/dpguthrie/yahooquery
Blog Post: https://towardsdatascience.com/the-unofficial-yahoo-finance-api-32dcf5d53df
Overview
ybankinplay is a python interface to unofficial Yahoo Finance API endpoints based in yahooquery. The package allows a user to retrieve nearly all the data visible via the Yahoo Finance front-end.
Some features of ybankinplay:
- Fast: Data is retrieved through API endpoints instead of web scraping. Additionally, asynchronous requests can be utilized with simple configuration
- Simple: Data for multiple symbols can be retrieved with simple one-liners
- User-friendly: Pandas Dataframes are utilized where appropriate
- Premium: Yahoo Finance premium subscribers are able to retrieve data available through their subscription
Requirements
Python 3.9+
- Pandas - Fast, powerful, flexible and easy to use open source data analysis and manipulation tool
- Requests - The elegant and simple HTTP library for Python, built for human beings.
- Requests-Futures - Asynchronous Python HTTP Requests for Humans
Yahoo Finance Premium Subscribers
-
Selenium - Web browser automation
Selenium is only utilized to login to Yahoo, which is done when the user passes certain keyword arguments. Logging into Yahoo enables users who are subscribers to Yahoo Finance Premium to retrieve data only accessible to premium subscribers.
Installation
If you're a Yahoo Finance premium subscriber and would like to retrieve data available through your subscription, do the following:
pip install ybankinplay[premium]
Otherwise, omit the premium argument:
pip install ybankinplay
Example
The majority of the data available through the unofficial Yahoo Finance API is related to a company, which is represented in ybankinplay as a Ticker. You can instantiate the Ticker class by passing the company's ticker symbol. For instance, to get data for Apple, Inc., pass aapl as the first argument to the Ticker class:
from ybankinplay import Ticker
aapl = Ticker('aapl')
aapl.summary_detail
Multiple Symbol Example
The Ticker class also makes it easy to retrieve data for a list of symbols with the same API. Simply pass a list of symbols as the argument to the Ticker class.
from ybankinplay import Ticker
symbols = ['fb', 'aapl', 'amzn', 'nflx', 'goog']
faang = Ticker(symbols)
faang.summary_detail
License
This project is licensed under the terms of the MIT license.
Metadata
Release files for ybankinplay 2.3.8.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ybankinplay-2.3.8.6.tar.gz | 49.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ybankinplay-2.3.8.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 102.7 kB
Release files / ybankinplay-2.3.8.6.tar.gz
| Download URL | ybankinplay-2.3.8.6.tar.gz |
|---|---|
| Size | 49.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ce260bbf55036256aaedc7fbd31a503e15507345bfba3f3187c70a608e90749c
|
|
BLAKE2b-256 checksum How to use checksums |
874b21d61ec326939a444fdee94331cb1fa9114504b6773449a2993a3b56f39f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Release files / ybankinplay-2.3.8.6-py3-none-any.whl
| Download URL | ybankinplay-2.3.8.6-py3-none-any.whl |
|---|---|
| Size | 53.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
15565cdaf845ecf95770fb870359199bc8ed30efdb04b2c1c59091338910cc3f
|
|
BLAKE2b-256 checksum How to use checksums |
00af0407945199b23044acc1335cfd5650c7384d9781e371f13ac13b39ecb6d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Security for ybankinplay 2.3.8.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.