pmorissette / ffn

ffn - a financial function library for Python
pmorissette.github.io/ffn
MIT License
1.9k stars 284 forks source link

Cannot Download Data Due to "RemoteDataError" #148

Closed arthurzllu closed 3 years ago

arthurzllu commented 3 years ago

Hi all,

Two days ago, I tried to use ffn to get data from yahoo finance (by default), but the program left this error message to me.

My statement was:

aapl = ffn.get("aapl", start = "2020-05-06")

The program showed me:

RemoteDataError: Unable to read URL: https://finance.yahoo.com/quote/aapl/history?period1=1588737600&period2=1625371199&interval=1d&frequency=1d&filter=history

I have tried different ticks and doublechecked the usage manual to see if any API is changed, but in vain. So would you please help me solve this issue? Thank you.

BR, Arthur

timkpaine commented 3 years ago

We rely on pandas-datareader for this functionality

arthurzllu commented 3 years ago

We rely on pandas-datareader for this functionality

Hi timkpaine,

Thank you for quick reply. I run my program with ffn in Colab. However, I check my version of pandas-datareader on Colab and it is 0.9, satisfied with the requirement of ffn. I will check if I could run ffn in the host machine, instead of Colab. Thank you again.

arthurzllu commented 3 years ago

We rely on pandas-datareader for this functionality

Hi timkpaine,

Thank you for quick reply. I run my program with ffn in Colab. However, I check my version of pandas-datareader on Colab and it is 0.9, satisfied with the requirement of ffn. I will check if I could run ffn in the host machine, instead of Colab. Thank you again.

I've tried the testing programs wit ffn on Windows 10 and Fedora. Neither case is successful. The error is still RemoteDataError:

Traceback (most recent call last): File "/media/sf_R_DRIVE/pyf_4_factor_models.py", line 117, in df_Ri = ffn.get(selected_ticks[0], start = "2016-01-01", end = "2019-04-30") File "", line 2, in get File "/usr/local/lib/python3.9/site-packages/ffn/utils.py", line 34, in _memoize cache[key] = result = func(args, kw) File "/usr/local/lib/python3.9/site-packages/ffn/data.py", line 76, in get data[ticker] = provider(ticker=t, field=f, mrefresh=mrefresh, kwargs) File "", line 2, in yf File "/usr/local/lib/python3.9/site-packages/ffn/utils.py", line 34, in _memoize cache[key] = result = func(args, *kw) File "/usr/local/lib/python3.9/site-packages/ffn/data.py", line 140, in yf tmp = pdata.get_data_yahoo(ticker, start=start, end=end) File "/usr/local/lib/python3.9/site-packages/pandas_datareader/data.py", line 86, in get_data_yahoo return YahooDailyReader(args, **kwargs).read() File "/usr/local/lib/python3.9/site-packages/pandas_datareader/base.py", line 253, in read df = self._read_one_data(self.url, params=self._get_params(self.symbols)) File "/usr/local/lib/python3.9/site-packages/pandas_datareader/yahoo/daily.py", line 153, in _read_one_data resp = self._get_response(url, params=params) File "/usr/local/lib/python3.9/site-packages/pandas_datareader/base.py", line 181, in _get_response raise RemoteDataError(msg) pandas_datareader._utils.RemoteDataError: Unable to read URL: https://finance.yahoo.com/quote/1316.tw/history?period1=1451592000&period2=1556654399&interval=1d&frequency=1d&filter=history

(... ignore the html content below)

timkpaine commented 3 years ago

https://github.com/pydata/pandas-datareader/issues

arthurzllu commented 3 years ago

https://github.com/pydata/pandas-datareader/issues

Got it. Thank you.