Skip to main content

Python wrapper for an unofficial Yahoo Finance API

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:

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

Metadata

Release files for yahooquery 2.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yahooquery 2.4.1
File Size Uploaded Provenance Actions
yahooquery-2.4.1.tar.gz 1.1 MB Without provenance Details for yahooquery-2.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for yahooquery 2.4.1
File Interpreter ABI Platform Actions
yahooquery-2.4.1-py3-none-any.whl Python 3 none any Details for yahooquery-2.4.1-py3-none-any.whl

Total release size: 1.2 MB

Release files / yahooquery-2.4.1.tar.gz

Download URL yahooquery-2.4.1.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
1903c65eae6a12d95e9450063479216c07846f013bae2a23917913531b7fae5b
BLAKE2b-256 checksum
How to use checksums
302165f662871ecdcdab695ee9277b1f9299980cc23ce3edb8ff827dda25b27d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.7.3

Release files / yahooquery-2.4.1-py3-none-any.whl

Download URL yahooquery-2.4.1-py3-none-any.whl
Size 50.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ee6ff9b9c4ab6a34125e1d55c6412a616948559401267e61724e8dbda98a2d8b
BLAKE2b-256 checksum
How to use checksums
ab98bd176685b2175fa7a5283e2fc73a9a7338715015849c904cca6eb69b5082
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.7.3

Security for yahooquery 2.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.4.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page