dpguthrie / yahooquery

Python wrapper for an unofficial Yahoo Finance API
https://yahooquery.dpguthrie.com
MIT License
774 stars 137 forks source link
api api-wrapper finance market-data pandas python stock-data stock-market yahoo-finance yahoo-finance-api

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

Yahooquery is a python interface to unofficial Yahoo Finance API endpoints. The package allows a user to retrieve nearly all the data visible via the Yahoo Finance front-end.

Some features of yahooquery:

Requirements

Python 2.7, 3.5+

Yahoo Finance 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 yahooquery[premium]

Otherwise, omit the premium argument:

pip install yahooquery

Example

The majority of the data available through the unofficial Yahoo Finance API is related to a company, which is represented in yahooquery 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 yahooquery 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 yahooquery 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.