Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python pandas datareader no longer works for yahoo-finance changed url

Since yahoo discontinued their API support pandas datareader now fails

import pandas_datareader.data as web
import datetime
start = datetime.datetime(2016, 1, 1)
end = datetime.datetime(2017, 5, 17)
web.DataReader('GOOGL', 'yahoo', start, end)

HTTPError: HTTP Error 401: Unauthorized

is there any unofficial library allowing us to temporarily work around the problem? Anything on Quandl maybe?

like image 449
Scilear Avatar asked May 18 '17 10:05

Scilear


1 Answers

The name of the fix_yahoo_finance package has been changed to yfinance. So you can try this code

import yfinance as yf
data = yf.download('MSFT', start = '2012-01-01', end='2017-01-01')
like image 124
Kamaldeep Singh Avatar answered Oct 19 '22 13:10

Kamaldeep Singh