Home > front end >  Python, Pandas, Yahoo Finance API
Python, Pandas, Yahoo Finance API

Time:03-10

Having trouble getting Pandas data reader to retrieve price quotes from Yahoo’s API. The most up to date answer seems to be:

"pip install --upgrade pandas pip install --upgrade pandas-datareader

However, for the time being I will be using Google Collab and its Python platform, does anyone know how to update the pandas here? Or has the API truly just been discontinued?

CodePudding user response:

In Colab you need to put a ! before pip

CodePudding user response:

Okay, so I found the answer! Just as PythonPerfection said above ^ the code does require a ! before the pip.

However, Google Colab only has pandas update up until 1.3.5:

ERROR: Could not find a version that satisfies the requirement pandas==1.4.1 (from versions: 0.1, 0.2, 0.3.0, 0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.5.0, 0.6.0, 0.6.1, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.8.0, 0.8.1, 0.9.0, 0.9.1, 0.10.0, 0.10.1, 0.11.0, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.14.1, 0.15.0, 0.15.1, 0.15.2, 0.16.0, 0.16.1, 0.16.2, 0.17.0, 0.17.1, 0.18.0, 0.18.1, 0.19.0, 0.19.1, 0.19.2, 0.20.0, 0.20.1, 0.20.2, 0.20.3, 0.21.0, 0.21.1, 0.22.0, 0.23.0, 0.23.1, 0.23.2, 0.23.3, 0.23.4, 0.24.0, 0.24.1, 0.24.2, 0.25.0, 0.25.1, 0.25.2, 0.25.3, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5) ERROR: No matching distribution found for pandas==1.4.1

Checking Pandas website I can see they actually have a release up to 1.4.1: https://pandas.pydata.org/pandas-docs/stable/whatsnew/index.html

This may be the issue - but I would still like to know if Yahoo has discontinued it API?

CodePudding user response:

Yahoo API works for me. Not sure which wrapper you're using (there are a ton). Try yfinance.

From Colab: !pip install yfinance

import yfinance as yf
msft = yf.Ticker("MSFT")
msft.info

Great docs here.

  • Related