efficiently download info for multiple symbols
Author: Courvoisier13Created Aug 2, 2023Updated Aug 24, 2026
yf.download downloads only prices and it has a threads option making the download very fast.
However, if I want to download info for multiple symbols, I have to use Tickers and when I loop through the results it seems to be downloading the entire API results (inc prices), which is very slow and there is no parallelization option.
minimal example:
import yfinance as yf
def __filter_dict(bigdict, sub_key):
return {k: bigdict.get(k, None) for k in sub_key}
fields = ['symbol', 'quoteType', 'shortName', 'longName', 'annualReportExpenseRatio']
ticker_list = ['QQQ', 'SPY']
tickers = yf.Tickers(ticker_list)
tickers_items = tickers.tickers.items()
list_dict = [__filter_dict(value.info, fields) for key, value in tickers_items]The loop for key, value in tickers_items is triggering a full download of all the assets in tickers_items, inc prices, which I am downloading using yf.download in a different place.
Any ideas on how to improve the efficiency and speed of this?
thanks
Source: ranaroussi/yfinance