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.4.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.4-py3-none-any.whl (53.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ybankinplay-2.3.8.4.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.4.tar.gz
Algorithm Hash digest
SHA256 f46c76fdb1bad770aec4effdabf50b175ccdf62f1ca304f06c50e7293f3332ff
MD5 2f3473412d03554d008b01a1395715c3
BLAKE2b-256 293601f17e3beeef3762c34fc92646b6d1bf2255922cd2aeed7378d6474f826a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ybankinplay-2.3.8.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 dd27a6a6d77b6e0d774e3641a0d67fc6b548e14d4d1ea4e2fd0083ada94cd2bc
MD5 afb01f7d5e7beb2bdf400bbc67b77d40
BLAKE2b-256 efdace3cb006e2b80fd929a601c42359214b4d5cb251421552087304d74783fe

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