Skip to main content

Python wrapper for an unofficial Yahoo Finance API

Project description

Python wrapper for an unofficial Yahoo Finance API

Build Status Coverage Package version Downloads


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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ybankinplay-2.3.8.5.tar.gz (49.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ybankinplay-2.3.8.5-py3-none-any.whl (53.0 kB view details)

Uploaded Python 3

File details

Details for the file ybankinplay-2.3.8.5.tar.gz.

File metadata

  • Download URL: ybankinplay-2.3.8.5.tar.gz
  • Upload date:
  • Size: 49.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for ybankinplay-2.3.8.5.tar.gz
Algorithm Hash digest
SHA256 edb69c81fafb3b6bdeddcd29f0967b5fa4ee4e784b279c62c54a4d275384d75e
MD5 df23990644aaeddfb56b578d95a90b4b
BLAKE2b-256 1b30aceefa00bf76d6486f6ac66d64713616f64fbc83b787338c9fc232477373

See more details on using hashes here.

File details

Details for the file ybankinplay-2.3.8.5-py3-none-any.whl.

File metadata

  • Download URL: ybankinplay-2.3.8.5-py3-none-any.whl
  • Upload date:
  • Size: 53.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for ybankinplay-2.3.8.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9f95249cb3a12b8ef99a9536759d8343de4b0c75e7433b9bdb1ca84a4cdf482d
MD5 ad2b2eba13bbab5ab2b0364015a4cb30
BLAKE2b-256 3b0ebd9ea1caf1f74615f1ada1075edec243a437baf360cdfb4e5506ab576f4c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page