yfinance icon indicating copy to clipboard operation
yfinance copied to clipboard

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

Open snafu4 opened this issue 3 years ago • 1 comments

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.

snafu4 avatar Dec 31 '21 00:12 snafu4

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"

mdkberry avatar Aug 09 '22 04:08 mdkberry

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

ValueRaider avatar Oct 28 '22 14:10 ValueRaider