yfinance icon indicating copy to clipboard operation
yfinance copied to clipboard

After so many requests, the timeout limit is always reached

Open BoeingConstrictor opened this issue 2 years ago • 5 comments

*** READ BEFORE POSTING ***

Before posting an issue - please upgrade to the latest version and confirm the issue/bug is still there.

Upgrade using: $ pip install yfinance --upgrade --no-cache-dir

Bug still there? Delete this content and submit your bug report here...

I am running analysis each day on 8-10 stocks over a 365 day period, and after about 90 days of analysis the ticker.history function is continually reaching the timeout limit of 5 seconds, and returns nothing. Is this an issue with the scraper, or some sort of Yahoo internal limit?

BoeingConstrictor avatar May 21 '22 17:05 BoeingConstrictor

My understanding is this is Yahoo rate-limiting API access. So you have to rate-limit your own data requests, implement some form of caching.

... which is why I'm working on a caching wrapper for yf, because everyone has this issue. Smart caching that only contacts Yahoo if enough time has passed for new data, and then only requests the new data and integrates it into cache. Not simply caching http requests. Not quite ready yet but close, so feel free to follow me.

ValueRaider avatar Jun 03 '22 20:06 ValueRaider

Hi @ValueRaider, I'm searching a cache solution too on YF. Did you release yours ?

AnatoleT avatar Jul 14 '22 20:07 AnatoleT

Hi @ValueRaider, I'm searching a cache solution too on YF. Did you release yours ?

It's almost ready. Just fixing some type issues (date vs datetime vs pd.Timestamp)

ValueRaider avatar Jul 14 '22 20:07 ValueRaider

@AnatoleT Actually I also need one significant yfinance fix to be tested, can you volunteer? Info here: https://github.com/ranaroussi/yfinance/issues/954#issuecomment-1182558587

ValueRaider avatar Jul 14 '22 20:07 ValueRaider

Hi @ValueRaider, I'm searching a cache solution too on YF. Did you release yours ? It's almost ready. Just fixing some type issues (date vs datetime vs pd.Timestamp)

Awesome, excited to try your new versions. Sure, I'll clone your branch and give you some feedback.

AnatoleT avatar Jul 14 '22 22:07 AnatoleT