Skip to main content

Python interface to unofficial Yahoo Finance API endpoints

Reason this release was yanked:

Bad try/except for 2.7

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.herokuapp.com

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 2.7, 3.5+

  • 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

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.

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

yahooquery-2.2.10.tar.gz (1.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yahooquery-2.2.10-py2.py3-none-any.whl (45.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file yahooquery-2.2.10.tar.gz.

File metadata

  • Download URL: yahooquery-2.2.10.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.0

File hashes

Hashes for yahooquery-2.2.10.tar.gz
Algorithm Hash digest
SHA256 a3f57be7e889724f610ba50a60ece64885e4380b09d9fbb7884a8774b2d83517
MD5 fbf3ed956d5d54a17e6f5cae24cb9e4f
BLAKE2b-256 7e7734083f72d1bbe691a5bc26974da3e49903f956cc0494c533293e307664d7

See more details on using hashes here.

File details

Details for the file yahooquery-2.2.10-py2.py3-none-any.whl.

File metadata

  • Download URL: yahooquery-2.2.10-py2.py3-none-any.whl
  • Upload date:
  • Size: 45.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.0

File hashes

Hashes for yahooquery-2.2.10-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8e66ff962013ad9839c8f46cf638160a2e4271da340b54f62b8eb86b09cc5577
MD5 8da0376b6e50d3ceec53a1a896f387b4
BLAKE2b-256 03374c9f3d80adabd4753a6d6eae84d4c8fa0178608571d7f09a57a86221fe34

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