topcan5
topcan5

Reputation: 1707

yfinance.download() super slow

I am just writing some simple code to download data from yfinance. It was working fine when I first started it. But it's getting very slow now. I mean it takes like 20 mins to download 15 tickers for below call. Am I missing anything?

import yfinance as yf
df = yf.download(tickers, period = "10d", interval = "1wk")

Upvotes: 1

Views: 3659

Answers (1)

alicea_r
alicea_r

Reputation: 31

This is happening for me too. The best idea I have is that the request limit got triggered and the connection is throttled. Not positive though.

The connection limit for yahoo is something like 10k requests per hour and my download slowed to a crawl after about 1500. I used to download data for a lot of tickers without a problem (~20mins with 4 threads). Now it is taking over an hour for about 100 now.

Edit: It seems that the rate limit is actually 2000 requests per hour over a public connection. But the real answer which got mine working is simpler. yfinance has bugs (sometimes). As of my writing this, the latest version which appears to be bug-free is 0.1.62. Just run pip install yfinance=<last.stable.release> and you will have better results.

Upvotes: 2

Related Questions