title: What is the fastest way to iterate through a list of yfinance tickers?
body: <p>Im using the python yfinance yahoo API for stock data retrieval. Right now im getting the peg ratio, which is an indicator of a company price related to its growth and earnings. I have a csv downloaded from here: <a href="https://www.nasdaq.com/market-activity/stocks/screener" rel="nofollow noreferrer">https://www.nasdaq.com/market-activity/stocks/screener</a>.
  It has exactly 8000 stocks.</p>
  <p>What I do is get the symbol list, and iterate it to access to the yahoo ticker. Then I get a use the ticker.info method which returns a dictionary. I iterate this process through the 8000 symbols. It goes at a speed of 6 symbols per minute, which is not viable. Is there a faster way with another API or another structure? I dont care about the API as long as I can get basic info as the growth, earnings, EPS and those things.</p>
  <p>Here is the code:</p>
  <pre><code>import pandas as pd
  import yfinance as yf
  
  
  data = pd.read_csv(&quot;data/stock_list.csv&quot;)
  symbols = data['Symbol']
  for symbol in symbols:
      stock = yf.Ticker(symbol)
      try:
          if stock.info['pegRatio']:
              print(stock.info['shortName'] + &quot; : &quot; + str(stock.info['pegRatio']))
      except KeyError:
          pass
  </code></pre>