yfinance.download#

yfinance.download(tickers, start=None, end=None, actions=False, threads=True, ignore_tz=None, group_by='column', auto_adjust=False, back_adjust=False, repair=False, keepna=False, progress=True, period='max', interval='1d', prepost=False, proxy=None, rounding=False, timeout=10, session=None, multi_level_index=True) DataFrame | None#

Download yahoo tickers

Parameters:
  • tickers (str or list) – List of tickers to download.

  • period (str) – Time period to download. Valid periods are: ‘1d’, ‘5d’, ‘1mo’, ‘3mo’, ‘6mo’, ‘1y’, ‘2y’, ‘5y’, ‘10y’, ‘ytd’, ‘max’. Either use period or specify start and end.

  • interval (str) – Data interval. Valid intervals are: ‘1m’, ‘2m’, ‘5m’, ‘15m’, ‘30m’, ‘60m’, ‘90m’, ‘1h’, ‘1d’, ‘5d’, ‘1wk’, ‘1mo’, ‘3mo’. Intraday data is limited to the last 60 days.

  • start (str) – Start date (YYYY-MM-DD) or _datetime, inclusive. Default is 99 years ago. Example: For start=”2020-01-01”, the first data point will be “2020-01-01”.

  • end (str) – End date (YYYY-MM-DD) or _datetime, exclusive. Default is the current date. Example: For end=”2023-01-01”, the last data point will be “2022-12-31”.

  • group_by (str) – Group data by ‘ticker’ or ‘column’. Default is ‘column’.

  • prepost (bool) – Include pre and post market data in results? Default is False.

  • auto_adjust (bool) – Automatically adjust all OHLC data? Default is False.

  • repair (bool) – Detect and repair currency unit mixups (e.g., 100x errors)? Default is False.

  • keepna (bool) – Keep rows with NaN values returned by Yahoo? Default is False.

  • actions (bool) – Download dividend and stock split data? Default is False.

  • threads (bool or int) – Number of threads for mass downloading. Default is True (automatically determines the number of threads).

  • ignore_tz (bool) – Ignore timezones when combining data across timezones? Default depends on the interval. For intraday intervals, the default is False. For daily and above, the default is True.

  • proxy (str, optional) – URL of the proxy server. Default is None.

  • rounding (bool, optional) – Round values to two decimal places? Default is False.

  • timeout (None or float, optional) – Maximum time to wait for a response, in seconds. Can be a fraction of a second (e.g., 0.01). Default is None.

  • session (None or Session, optional) – Pass a custom session object for all requests. Default is None.

  • multi_level_index (bool) – Optional. Always return a MultiIndex DataFrame? Default is False

Returns:

pd.DataFrame or None