Git Product home page Git Product logo

yahooquery's Introduction

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:

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

yahooquery's People

Contributors

dpguthrie avatar maread99 avatar dependabot[bot] avatar dsaouda avatar lrabbade avatar ms32035 avatar rmisaki avatar rodrigobercini avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.