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

Uploaded Python 3

File details

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

File metadata

  • Download URL: ybankinplay-2.3.8.6.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.6.tar.gz
Algorithm Hash digest
SHA256 ce260bbf55036256aaedc7fbd31a503e15507345bfba3f3187c70a608e90749c
MD5 c540349814c5f1de4ee3d0aff45a02a9
BLAKE2b-256 874b21d61ec326939a444fdee94331cb1fa9114504b6773449a2993a3b56f39f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ybankinplay-2.3.8.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 15565cdaf845ecf95770fb870359199bc8ed30efdb04b2c1c59091338910cc3f
MD5 b5bd67fcda38f798670b4deefc24be2b
BLAKE2b-256 00af0407945199b23044acc1335cfd5650c7384d9781e371f13ac13b39ecb6d0

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