MCPcopy Index your code
hub / github.com/dpguthrie/yahooquery

github.com/dpguthrie/yahooquery @v2.4.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.4.1 ↗ · + Follow
232 symbols 603 edges 19 files 103 documented · 44% 2 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
<a href="#"><img src="https://github.com/dpguthrie/yahooquery/raw/v2.4.1/docs/docs/img/full.png"></a>






<em>Python wrapper for an unofficial Yahoo Finance API</em>






<a href="https://codecov.io/gh/dpguthrie/yahooquery" target="_blank">
    <img src="https://img.shields.io/codecov/c/github/dpguthrie/yahooquery" alt="Coverage">
</a>
<a href="https://pypi.org/project/yahooquery" target="_blank">
    <img src="https://badge.fury.io/py/yahooquery.svg" alt="Package version">
</a>
<a href="https://pepy.tech/project/yahooquery" target="_blank">
    <img src="https://pepy.tech/badge/yahooquery" alt="Downloads">
</a>

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:

  • 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+ - Versions on or after 2.4.0 require 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 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 yahooquery[premium]

Otherwise, omit the premium argument:

pip install yahooquery

You can also install with uv if you have that installed:

uv 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.

Core symbols most depended-on inside this repo

_quote_summary
called by 24
yahooquery/ticker.py
_get_data
called by 17
yahooquery/base.py
_financials
called by 15
yahooquery/ticker.py
_quote_summary_dataframe
called by 11
yahooquery/ticker.py
history_dataframe
called by 6
yahooquery/utils.py
reports
called by 6
yahooquery/research.py
_wait
called by 6
docs/docs/js/termynal.js
_chunk_symbols
called by 5
yahooquery/base.py

Shape

Method 154
Function 70
Class 8

Languages

Python91%
TypeScript9%

Modules by API surface

yahooquery/ticker.py79 symbols
tests/test_ticker.py53 symbols
yahooquery/base.py17 symbols
docs/docs/js/termynal.js15 symbols
yahooquery/research.py10 symbols
tests/test_research.py9 symbols
yahooquery/screener.py8 symbols
tests/test_miscellaneous.py7 symbols
docs/docs/js/custom.js7 symbols
yahooquery/utils.py6 symbols
yahooquery/misc.py6 symbols
yahooquery/headless.py4 symbols

Used by 2 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add yahooquery \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact