ranaroussi / yfinance

Download market data from Yahoo! Finance's API
https://aroussi.com/post/python-yahoo-finance
Apache License 2.0
14.93k stars 2.45k forks source link

fix - "period=max" returns "failed download" #919

Closed snafu4 closed 2 years ago

snafu4 commented 2 years ago

period='max' should adjust for interval. For example,

yf.download(ticker, interval='1h', period='max')

returns

1h data not available for startTime=1070236800 and endTime=1640909113. The requested range must be within the last 730 days.

In the above case, it should return the last 730 days worth of data.

mdkberry commented 2 years ago

you probably found it by now, but I ended up here with the same problem before I saw this but the period="max" is still not working to honor hourly data:

"Please note: Yahoo Finance currently limits historical data downloads depending on the resolution of data required:

Minute Data: 7 days
2 Minute Data: 60 days
5 Minute Data: 60 days
15 Minute Data: 60 days
30 Minute Data: 60 days
Hourly Data: 730 days
Daily/Weekly/Monthly: No _limit"
ValueRaider commented 2 years ago

You can workaround this with e.g. period="60d". If you really need yfinance to convert max then consider submitting a fix.