Pandas-datareader: ImmediateDeprecationError of Google Finance data

Created on 4 Oct 2018  Â·  33Comments  Â·  Source: pydata/pandas-datareader

Hello,
I want to get the financial crisis data from 2006 to 2016 of Bank of America.
So i used the following way:--

from pandas_datareader import data, wb
BAC = data.DataReader("BAC", 'google', start, end)

It state error:--
ImmediateDeprecationError:
Google finance has been immediately deprecated due to large breaks in the API without the
introduction of a stable replacement. Pull Requests to re-enable these data
connectors are welcome.

Most helpful comment

try this:
df = web.DataReader(
selected_dropdown_value, data_source='yahoo',
start=dt(2017, 1, 1), end=dt.now())

change 'google' for 'yahoo'

All 33 comments

Google Finance has discontinued their API, and as such this feature is deprecated (marked for removal) in Pandas Datareader. Alternatives to Google Finance include Alpha Vantage, Quandl, and IEX.

try this:
df = web.DataReader(
selected_dropdown_value, data_source='yahoo',
start=dt(2017, 1, 1), end=dt.now())

change 'google' for 'yahoo'

Hi I tried using 'yahoo' instead of 'google', but it looks like the 'yahoo' api is deprecated as well.
"Yahoo Daily has been immediately deprecated due to large breaks in the API without the
introduction of a stable replacement. Pull Requests to re-enable these data
connectors are welcome."

Any alternative solution to extract the data?

@harishb049 please see my original comment. Alternatives include:

IEX

df = web.DataReader("BAC", "iex", start, end)

Quandl

df = web.DataReader("BAC", "quandl", start, end)

Can as well do:

BAC = data.DataReader("BAC", "iex", start, end)

@Valvandi obrigado realmente seu comentário foi de grande ajuda...

Google discontinued the API, use IEX instead, that lets you obtain the data for the past 5 years

same issue

This solution work.
BAC = data.DataReader("BAC", 'quandl', start, end,access_key="YOUR API KEY FROM QUANDL")

guys , iam using below but data is not fetching
PG = wb.DataReader('PG', 'quandl', start='2018-01-01', end='2018-01-31',access_key='')

guys , iam using below but data is not fetching
PG = wb.DataReader('PG', 'quandl', start='2018-01-01', end='2018-01-31',access_key='')

PG = data.DataReader('PG', 'quandl', start='2018-01-01', end='2018-01-31',access_key='**')

not working
import numpy as np
import pandas_datareader as pd
from pandas_datareader import data as wb
import matplotlib.pyplot as plt

PG = wb.DataReader('PG', 'quandl', start='2018-01-01', end='2018-01-01',access_key=' access key was put ')

not any data is fetching

not working
import numpy as np
import pandas_datareader as pd
from pandas_datareader import data as wb
import matplotlib.pyplot as plt

PG = wb.DataReader('PG', 'quandl', start='2018-01-01', end='2018-01-01',access_key=' access key was put ')

not any data is fetching

Your import is wrong.
from pandas_datareader import data, wb

well print command is miss it, now data is importing.
but i need code how to import NSE 50 company data in one go.

www.nseindia.com
NSE is index in consist of 50 top performing companies

Hello,

the IEX source works, but there are no adjusted values; I get the following columns:

  • date, open, high, low, close, volume

whereas from quandl I was getting 12 columns:

  • Date, Open, High, Low, Close, Volume, Ex-Dividend, Split Ratio, Adj. Open, Adj. High, Adj. Low, Adj. Close, Adj. Volume

Am I missing something, or are the adjusted prices simply not available from IEX?
I have briefly looked here: https://pandas-datareader.readthedocs.io/en/latest/readers/iex.html but I could not quite understand if perhaps it's a matter of additional parameters to be set.

Thank you in advance!

import pandas_datareader as pdr
import datetime

start = datetime.datetime(2006,1,1)
ends = datetime.datetime(2017,1,1)

bac = pdr.get_data_yahoo('BAC',start,ends)
print(bac.head())

It still gives only the adjusted close:
"High Low Open Close Volume Adj Close"
while still missing "Ex-Dividend, Split Ratio, Adj Open, Adj High, Adj Low, Adj Volume"

If it can be relevant, I am using the pandas-datareader shipped via pip3:

pdr.__version__
'0.7.0'

The below should work:
import datetime as dt
from pandas_datareader import data
stocks = data.DataReader(name="GOOG",data_source="yahoo", start=dt.date(2000, 1, 1), end=dt.datetime.now())
stocks.head(3)

Unfortunately, the data_source from 'google' does not work so we have to use the yahoo one for the time being as mabusalah has said.

See my comment above:

Google Finance has discontinued their API, and as such this feature is deprecated (marked for removal) in Pandas Datareader. Alternatives to Google Finance include Alpha Vantage, Quandl, and IEX.

This is not an issue for pandas_datareader. Please close.

@Shayan-Asgari , @mabusalah , thank you for the code snippet, but it works exactly like mine, and it does not answer to my question :)

I am comparing the output of "yahoo" (that gives "High Low Open Close Volume Adj Close") to the one of quandl (that gives the same columns, PLUS the columns "Ex-Dividend, Split Ratio, Adj Open, Adj High, Adj Low, Adj Volume").

My question is how can I get those additional columns with the "yahoo" data source: the code you pasted works the same way as the one i posted above works, i.e. only partially (giving only the Close as adjusted quantity).

Is there a way of using the "yahoo" data source AND get the additional columns? If not, why? Can I just infer the adjustment factor from adj_close/close and apply it to the other columns? I am not familiar on whether the different adjusted quantities are adjusted (i.e. a common adjustment factor or different factors per-column).

Please use belo code

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from pandas_datareader import data as WB
PG=WB.DataReader('PG','quandl',start='2015-12-01',end='2018-12-31',acess_key='')
print(PG)

Hello @vischia,
I am not entirely, however, you can get the extra/other columns into a DataFrame and then use Pandas built in concatenate method with axis=1 to concatenate it with a final DataFrame to have all your desired values. Or better yet, if there are subtle discrepancies between the information of the two data source websites you can use the apply method which perhaps takes the mean of each of the values from each of the two website's data.

Hopefully this helps and sorry if it does not as I have just started to get into Data Science/Machine Learning.

Regards,
Shayan Asgari

I obtained an API Key from Quandl, I dont know why this error keeprs popping up:

TypeError: __init__() got an unexpected keyword argument 'max_rows'

Can anyone help pls?

Give full code

On Fri, Feb 1, 2019, 9:10 PM olubadmus <[email protected] wrote:

I obtained an API Key from Quandl, I dont know why this error keeprs
popping up:

TypeError: init() got an unexpected keyword argument 'max_rows'

Can anyone help pls?

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/pydata/pandas-datareader/issues/587#issuecomment-459764367,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AooKsjmqLoLPVU-5xYN0khGI52j06Dspks5vJGAKgaJpZM4XH6I4
.

BAC = wb.DataReader('BAC', 'quandl', access_key=' _provided key_ ', start=2017, 1, 1, end=2018, 1, 12)

"iex" can be used only for past of maximum 5 years from the actual moment. But "get_data_yahoo" can retrieve data for any period of time. For example:
from pandas_datareader import data,wb
import pandas as pd
import datetime

srt = datetime.datetime(2006,1,1)
end = datetime.datetime(2016,1,1)
BAC = data.get_data_yahoo('BAC',start,end)
BAC.head()

  Date            High           Low                         Open              Close              Volume              Adj Close

2006-01-03 47.180000 46.150002 46.919998 47.080002 16296700.0 36.332104
2006-01-04 47.240002 46.450001 47.000000 46.580002 17757900.0 35.946239
2006-01-05 46.830002 46.320000 46.580002 46.639999 14970700.0 35.992565
2006-01-06 46.910000 46.349998 46.799999 46.570000 12599800.0 35.938522
2006-01-09 46.970001 46.360001 46.720001 46.599998 15619400.0 35.961674

i think this is the easy way to do this

from pandas_datareader import data, wb
import datetime
start=datetime.datetime(2006,1,1)
end=datetime.datetime(2016,1,1)
BAC=data.DataReader("BAC",'yahoo',start,end)
BAC.head()

"iex" can be used only for past of maximum 5 years from the actual moment. But "get_data_yahoo" can retrieve data for any period of time. For example:
from pandas_datareader import data,wb
import pandas as pd
import datetime

srt = datetime.datetime(2006,1,1)
end = datetime.datetime(2016,1,1)
BAC = data.get_data_yahoo('BAC',start,end)
BAC.head()

  Date            High             Low                         Open              Close              Volume              Adj Close                     

2006-01-03 47.180000 46.150002 46.919998 47.080002 16296700.0 36.332104
2006-01-04 47.240002 46.450001 47.000000 46.580002 17757900.0 35.946239
2006-01-05 46.830002 46.320000 46.580002 46.639999 14970700.0 35.992565
2006-01-06 46.910000 46.349998 46.799999 46.570000 12599800.0 35.938522
2006-01-09 46.970001 46.360001 46.720001 46.599998 15619400.0 35.961674

You are right on the money. IDX does returns forbidden and qunadl requires an API key. Yahoo has open data. Are there other data sources available besides Yahoo that work?

IEX as a source returns this error even within the constrains of 5 years:

RemoteDataError: Unable to read URL: https://api.iextrading.com/1.0/stock/market/batch?symbols=GOOGL&types=chart&range=5y
Response Text:
b'Forbidden'

Closing as answered

import pandas_datareader as pdr
import datetime

start = datetime.datetime(2006,1,1)
ends = datetime.datetime(2017,1,1)

bac = pdr.get_data_yahoo('BAC',start,ends)
print(bac.head())

it works.

from pandas.datareader import data
from datetime import datetime

start = datetime(yyyy, mm, dd)
end = datetime(yyyy, mm, dd)

BAC = data.DataReader("BAC",'yahoo',start, end)
BAC.head()

or if you are trying to get data from different banks using their ticker symbol then you can also do it as:

df = data.DataReader(["BAC", "C", "MS"], "yahoo",start, end)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hmz123 picture hmz123  Â·  6Comments

PLAYER69 picture PLAYER69  Â·  7Comments

paintdog picture paintdog  Â·  7Comments

Chandrak1907 picture Chandrak1907  Â·  4Comments

nashtgc picture nashtgc  Â·  7Comments