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

Uploaded Python 3

File details

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

File metadata

  • Download URL: ybankinplay-2.3.8.3.tar.gz
  • Upload date:
  • Size: 49.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Linux/6.14.4-zen1-2-zen

File hashes

Hashes for ybankinplay-2.3.8.3.tar.gz
Algorithm Hash digest
SHA256 9a14cb7705bad6ddc20415df5a45bca6eba40797e481e112bf04b93147c5e15e
MD5 f36e7625bb0efc11694af4c250c667f6
BLAKE2b-256 f8fbb8e65da7b52020adcd517de116aee2a70a68680d947a9d19ba323c825c80

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ybankinplay-2.3.8.3-py3-none-any.whl
  • Upload date:
  • Size: 53.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Linux/6.14.4-zen1-2-zen

File hashes

Hashes for ybankinplay-2.3.8.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3bebb3c41f49e5373420df6a5362576155e810dae00dc6f4c26f291b0c725b08
MD5 78741f3e561074fb3a26efcee144f699
BLAKE2b-256 789c171fdeaa850d0f7b18bc0f5879c5e4d3addb14cb33778a6a47fd6b46bde5

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