Skip to content

period="max" fails with multiple intervals #2451

Description

@cole-st-john

Describe bug

Should:

Intuitively, when downloading price history, i am expecting using period="max" should return all available data for any interval.

Is:

Mode1 - Bug (what I want to focus on here): Currently, yfinance fails on a number of intervals - returning an empty dataframe.
Mode2 - Feature: I would expect for 1m, requests would be chunked so that the entirety of the available (30 day period) data would be requested in chunks and unioned into a single result.

Simple code that reproduces your problem

import yfinance as yf

INTRADAY_INTERVALS = ["1m", "2m", "5m", "15m", "30m", "60m", "1h", "90m"]
DAY_PLUS_INTERVALS = ["1d", "5d", "1wk", "1mo", "3mo"]
INTERVALS = [*INTRADAY_INTERVALS, *DAY_PLUS_INTERVALS]
TICKERS = ["EURUSD=X"]

for interval in INTERVALS:
    df = yf.download(tickers=TICKERS, period="max", interval=interval, progress=False)
    print(f"failed for {interval}") if df.empty else print(f"passed for {interval}")

Debug log from yf.enable_debug_mode()

DEBUG    Entering download()
YF.download() has changed argument auto_adjust default to True
DEBUG     Disabling multithreading because DEBUG logging enabled
DEBUG     Using User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
DEBUG     Entering history()
DEBUG      Entering history()
DEBUG       EURUSD=X: Yahoo GET parameters: {'period1': '2025-04-29 13:11:21+01:00', 'period2': '2025-05-06 13:11:21+01:00', 'interval': '1m', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG       Entering get()
DEBUG        Entering _make_request()
DEBUG         url=https://query2.finance.yahoo.com/v8/finance/chart/EURUSD=X
DEBUG         params={'period1': 1745928681, 'period2': 1746533481, 'interval': '1m', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG         Entering _get_cookie_and_crumb()
DEBUG          cookie_mode = 'basic'
DEBUG          Entering _get_cookie_and_crumb_basic()
DEBUG           crumb = '0w/UBpoHw5u'
DEBUG          Exiting _get_cookie_and_crumb_basic()
DEBUG         Exiting _get_cookie_and_crumb()
DEBUG         response code=200
DEBUG        Exiting _make_request()
DEBUG       Exiting get()
DEBUG       EURUSD=X: yfinance received OHLC data: 2025-04-29 12:12:00 -> 2025-05-06 12:11:00
DEBUG       EURUSD=X: OHLC after cleaning: 2025-04-29 13:12:00+01:00 -> 2025-05-06 13:11:00+01:00
DEBUG       EURUSD=X: OHLC after combining events: 2025-04-29 13:12:00+01:00 -> 2025-05-06 13:11:00+01:00
DEBUG       EURUSD=X: yfinance returning OHLC: 2025-04-29 13:12:00+01:00 -> 2025-05-06 13:10:00+01:00
DEBUG      Exiting history()
DEBUG     Exiting history()
DEBUG    Exiting download()
passed for 1m
DEBUG    Entering download()
DEBUG     Disabling multithreading because DEBUG logging enabled
DEBUG     Entering history()
DEBUG      Entering history()
DEBUG       EURUSD=X: Yahoo GET parameters: {'period1': '1926-05-31 13:11:22+01:00', 'period2': '2025-05-06 13:11:22+01:00', 'interval': '2m', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG       Entering get()
DEBUG        Entering _make_request()
DEBUG         url=https://query2.finance.yahoo.com/v8/finance/chart/EURUSD=X
DEBUG         params={'period1': -1375530518, 'period2': 1746533482, 'interval': '2m', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG         Entering _get_cookie_and_crumb()
DEBUG          cookie_mode = 'basic'
DEBUG          Entering _get_cookie_and_crumb_basic()
DEBUG           reusing crumb
DEBUG          Exiting _get_cookie_and_crumb_basic()
DEBUG         Exiting _get_cookie_and_crumb()
DEBUG         response code=422
DEBUG         toggling cookie strategy basic -> csrf
DEBUG         Entering _get_cookie_and_crumb()
DEBUG          cookie_mode = 'csrf'
DEBUG          Entering _get_crumb_csrf()
DEBUG           csrfToken = laxcvdTVann3RdyrEOSzCIyvWe8vOpPz
DEBUG           sessionId='1_cc-session_d4d85dd7-fd79-4735-aebd-211b8bd96c55
DEBUG           crumb = 'gYxcmqGbT0U'
DEBUG          Exiting _get_crumb_csrf()
DEBUG         Exiting _get_cookie_and_crumb()
DEBUG         response code=422
DEBUG        Exiting _make_request()
DEBUG       Exiting get()
ERROR     
          1 Failed download:
ERROR     ['EURUSD=X']: YFPricesMissingError('possibly delisted; no price data found  (2m 1926-05-31 13:11:22+01:00 -> 2025-05-06 13:11:22+01:00) (Yahoo error = "2m data not available for startTime=1070236800 and endTime=1746533482. The requested range must be within the last 60 days.")')
DEBUG     ['EURUSD=X']: Traceback (most recent call last):
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/multi.py", line 280, in _download_one
              data = Ticker(ticker).history(
                     ^^^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/utils.py", line 102, in wrapper
              result = func(*args, **kwargs)
                       ^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/base.py", line 92, in history
              return self._lazy_load_price_history().history(*args, **kwargs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/utils.py", line 102, in wrapper
              result = func(*args, **kwargs)
                       ^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/scrapers/history.py", line 248, in history
              raise _exception
          yfinance.exceptions.YFPricesMissingError: possibly delisted; no price data found  (2m 1926-05-31 13:11:22+01:00 -> 2025-05-06 13:11:22+01:00) (Yahoo error = "2m data not available for startTime=1070236800 and endTime=1746533482. The requested range must be within the last 60 days.")
          
DEBUG    Exiting download()
failed for 2m
DEBUG    Entering download()
DEBUG     Disabling multithreading because DEBUG logging enabled
DEBUG     Entering history()
DEBUG      Entering history()
DEBUG       EURUSD=X: Yahoo GET parameters: {'period1': '2025-03-07 12:11:27+00:00', 'period2': '2025-05-06 13:11:27+01:00', 'interval': '5m', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG       Entering get()
DEBUG        Entering _make_request()
DEBUG         url=https://query2.finance.yahoo.com/v8/finance/chart/EURUSD=X
DEBUG         params={'period1': 1741349487, 'period2': 1746533487, 'interval': '5m', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG         Entering _get_cookie_and_crumb()
DEBUG          cookie_mode = 'csrf'
DEBUG          Entering _get_crumb_csrf()
DEBUG           reusing crumb
DEBUG          Exiting _get_crumb_csrf()
DEBUG         Exiting _get_cookie_and_crumb()
DEBUG         response code=422
DEBUG         toggling cookie strategy csrf -> basic
DEBUG         Entering _get_cookie_and_crumb()
DEBUG          cookie_mode = 'basic'
DEBUG          Entering _get_cookie_and_crumb_basic()
DEBUG           crumb = 'ZDBHWppHHXt'
DEBUG          Exiting _get_cookie_and_crumb_basic()
DEBUG         Exiting _get_cookie_and_crumb()
DEBUG         response code=422
DEBUG        Exiting _make_request()
DEBUG       Exiting get()
ERROR     
          1 Failed download:
ERROR     ['EURUSD=X']: YFPricesMissingError('possibly delisted; no price data found  (5m 2025-03-07 12:11:27+00:00 -> 2025-05-06 13:11:27+01:00) (Yahoo error = "5m data not available for startTime=1741349487 and endTime=1746533487. The requested range must be within the last 60 days.")')
DEBUG     ['EURUSD=X']: Traceback (most recent call last):
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/multi.py", line 280, in _download_one
              data = Ticker(ticker).history(
                     ^^^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/utils.py", line 102, in wrapper
              result = func(*args, **kwargs)
                       ^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/base.py", line 92, in history
              return self._lazy_load_price_history().history(*args, **kwargs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/utils.py", line 102, in wrapper
              result = func(*args, **kwargs)
                       ^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/scrapers/history.py", line 248, in history
              raise _exception
          yfinance.exceptions.YFPricesMissingError: possibly delisted; no price data found  (5m 2025-03-07 12:11:27+00:00 -> 2025-05-06 13:11:27+01:00) (Yahoo error = "5m data not available for startTime=1741349487 and endTime=1746533487. The requested range must be within the last 60 days.")
          
DEBUG    Exiting download()
failed for 5m
DEBUG    Entering download()
DEBUG     Disabling multithreading because DEBUG logging enabled
DEBUG     Entering history()
DEBUG      Entering history()
DEBUG       EURUSD=X: Yahoo GET parameters: {'period1': '2025-03-07 12:11:28+00:00', 'period2': '2025-05-06 13:11:28+01:00', 'interval': '15m', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG       Entering get()
DEBUG        Entering _make_request()
DEBUG         url=https://query2.finance.yahoo.com/v8/finance/chart/EURUSD=X
DEBUG         params={'period1': 1741349488, 'period2': 1746533488, 'interval': '15m', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG         Entering _get_cookie_and_crumb()
DEBUG          cookie_mode = 'basic'
DEBUG          Entering _get_cookie_and_crumb_basic()
DEBUG           reusing crumb
DEBUG          Exiting _get_cookie_and_crumb_basic()
DEBUG         Exiting _get_cookie_and_crumb()
DEBUG         response code=422
DEBUG         toggling cookie strategy basic -> csrf
DEBUG         Entering _get_cookie_and_crumb()
DEBUG          cookie_mode = 'csrf'
DEBUG          Entering _get_crumb_csrf()
DEBUG           csrfToken = DnDL0bkDJXfgGiZtvUI1FlyaMjXZ4vJH
DEBUG           sessionId='1_cc-session_92ddfe53-dc78-47d9-9425-e7c2d1a8b764
DEBUG           crumb = 'VVOYILmfhAS'
DEBUG          Exiting _get_crumb_csrf()
DEBUG         Exiting _get_cookie_and_crumb()
DEBUG         response code=422
DEBUG        Exiting _make_request()
DEBUG       Exiting get()
ERROR     
          1 Failed download:
ERROR     ['EURUSD=X']: YFPricesMissingError('possibly delisted; no price data found  (15m 2025-03-07 12:11:28+00:00 -> 2025-05-06 13:11:28+01:00) (Yahoo error = "15m data not available for startTime=1741349488 and endTime=1746533488. The requested range must be within the last 60 days.")')
DEBUG     ['EURUSD=X']: Traceback (most recent call last):
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/multi.py", line 280, in _download_one
              data = Ticker(ticker).history(
                     ^^^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/utils.py", line 102, in wrapper
              result = func(*args, **kwargs)
                       ^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/base.py", line 92, in history
              return self._lazy_load_price_history().history(*args, **kwargs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/utils.py", line 102, in wrapper
              result = func(*args, **kwargs)
                       ^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/scrapers/history.py", line 248, in history
              raise _exception
          yfinance.exceptions.YFPricesMissingError: possibly delisted; no price data found  (15m 2025-03-07 12:11:28+00:00 -> 2025-05-06 13:11:28+01:00) (Yahoo error = "15m data not available for startTime=1741349488 and endTime=1746533488. The requested range must be within the last 60 days.")
          
DEBUG    Exiting download()
failed for 15m
DEBUG    Entering download()
DEBUG     Disabling multithreading because DEBUG logging enabled
DEBUG     Entering history()
DEBUG      Entering history()
DEBUG       EURUSD=X: Yahoo GET parameters: {'period1': '2025-03-07 12:11:32+00:00', 'period2': '2025-05-06 13:11:32+01:00', 'interval': '15m', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG       Entering get()
DEBUG        Entering _make_request()
DEBUG         url=https://query2.finance.yahoo.com/v8/finance/chart/EURUSD=X
DEBUG         params={'period1': 1741349492, 'period2': 1746533492, 'interval': '15m', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG         Entering _get_cookie_and_crumb()
DEBUG          cookie_mode = 'csrf'
DEBUG          Entering _get_crumb_csrf()
DEBUG           reusing crumb
DEBUG          Exiting _get_crumb_csrf()
DEBUG         Exiting _get_cookie_and_crumb()
DEBUG         response code=422
DEBUG         toggling cookie strategy csrf -> basic
DEBUG         Entering _get_cookie_and_crumb()
DEBUG          cookie_mode = 'basic'
DEBUG          Entering _get_cookie_and_crumb_basic()
DEBUG           crumb = '0Bc1pR4UV4m'
DEBUG          Exiting _get_cookie_and_crumb_basic()
DEBUG         Exiting _get_cookie_and_crumb()
DEBUG         response code=422
DEBUG        Exiting _make_request()
DEBUG       Exiting get()
ERROR     
          1 Failed download:
ERROR     ['EURUSD=X']: YFPricesMissingError('possibly delisted; no price data found  (15m 2025-03-07 12:11:32+00:00 -> 2025-05-06 13:11:32+01:00) (Yahoo error = "15m data not available for startTime=1741349492 and endTime=1746533492. The requested range must be within the last 60 days.")')
DEBUG     ['EURUSD=X']: Traceback (most recent call last):
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/multi.py", line 280, in _download_one
              data = Ticker(ticker).history(
                     ^^^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/utils.py", line 102, in wrapper
              result = func(*args, **kwargs)
                       ^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/base.py", line 92, in history
              return self._lazy_load_price_history().history(*args, **kwargs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/utils.py", line 102, in wrapper
              result = func(*args, **kwargs)
                       ^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/scrapers/history.py", line 248, in history
              raise _exception
          yfinance.exceptions.YFPricesMissingError: possibly delisted; no price data found  (15m 2025-03-07 12:11:32+00:00 -> 2025-05-06 13:11:32+01:00) (Yahoo error = "15m data not available for startTime=1741349492 and endTime=1746533492. The requested range must be within the last 60 days.")
          
DEBUG    Exiting download()
failed for 30m
DEBUG    Entering download()
DEBUG     Disabling multithreading because DEBUG logging enabled
DEBUG     Entering history()
DEBUG      Entering history()
DEBUG       EURUSD=X: Yahoo GET parameters: {'period1': '2023-05-07 13:11:33+01:00', 'period2': '2025-05-06 13:11:33+01:00', 'interval': '60m', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG       Entering get()
DEBUG        Entering _make_request()
DEBUG         url=https://query2.finance.yahoo.com/v8/finance/chart/EURUSD=X
DEBUG         params={'period1': 1683461493, 'period2': 1746533493, 'interval': '60m', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG         Entering _get_cookie_and_crumb()
DEBUG          cookie_mode = 'basic'
DEBUG          Entering _get_cookie_and_crumb_basic()
DEBUG           reusing crumb
DEBUG          Exiting _get_cookie_and_crumb_basic()
DEBUG         Exiting _get_cookie_and_crumb()
DEBUG         response code=422
DEBUG         toggling cookie strategy basic -> csrf
DEBUG         Entering _get_cookie_and_crumb()
DEBUG          cookie_mode = 'csrf'
DEBUG          Entering _get_crumb_csrf()
DEBUG           csrfToken = MBiC_4ZJpa6JQh2K7f5OSz79UTN4ozp2
DEBUG           sessionId='1_cc-session_66d3cbb0-8ede-48f2-a8bc-236219515d8a
DEBUG           crumb = 'vwT926H7DzD'
DEBUG          Exiting _get_crumb_csrf()
DEBUG         Exiting _get_cookie_and_crumb()
DEBUG         response code=422
DEBUG        Exiting _make_request()
DEBUG       Exiting get()
ERROR     
          1 Failed download:
ERROR     ['EURUSD=X']: YFPricesMissingError('possibly delisted; no price data found  (60m 2023-05-07 13:11:33+01:00 -> 2025-05-06 13:11:33+01:00) (Yahoo error = "1h data not available for startTime=1683461493 and endTime=1746533493. The requested range must be within the last 730 days.")')
DEBUG     ['EURUSD=X']: Traceback (most recent call last):
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/multi.py", line 280, in _download_one
              data = Ticker(ticker).history(
                     ^^^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/utils.py", line 102, in wrapper
              result = func(*args, **kwargs)
                       ^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/base.py", line 92, in history
              return self._lazy_load_price_history().history(*args, **kwargs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/utils.py", line 102, in wrapper
              result = func(*args, **kwargs)
                       ^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/scrapers/history.py", line 248, in history
              raise _exception
          yfinance.exceptions.YFPricesMissingError: possibly delisted; no price data found  (60m 2023-05-07 13:11:33+01:00 -> 2025-05-06 13:11:33+01:00) (Yahoo error = "1h data not available for startTime=1683461493 and endTime=1746533493. The requested range must be within the last 730 days.")
          
DEBUG    Exiting download()
failed for 60m
DEBUG    Entering download()
DEBUG     Disabling multithreading because DEBUG logging enabled
DEBUG     Entering history()
DEBUG      Entering history()
DEBUG       EURUSD=X: Yahoo GET parameters: {'period1': '2023-05-07 13:11:36+01:00', 'period2': '2025-05-06 13:11:36+01:00', 'interval': '1h', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG       Entering get()
DEBUG        Entering _make_request()
DEBUG         url=https://query2.finance.yahoo.com/v8/finance/chart/EURUSD=X
DEBUG         params={'period1': 1683461496, 'period2': 1746533496, 'interval': '1h', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG         Entering _get_cookie_and_crumb()
DEBUG          cookie_mode = 'csrf'
DEBUG          Entering _get_crumb_csrf()
DEBUG           reusing crumb
DEBUG          Exiting _get_crumb_csrf()
DEBUG         Exiting _get_cookie_and_crumb()
DEBUG         response code=422
DEBUG         toggling cookie strategy csrf -> basic
DEBUG         Entering _get_cookie_and_crumb()
DEBUG          cookie_mode = 'basic'
DEBUG          Entering _get_cookie_and_crumb_basic()
DEBUG           crumb = '66ZcuVkTQMf'
DEBUG          Exiting _get_cookie_and_crumb_basic()
DEBUG         Exiting _get_cookie_and_crumb()
DEBUG         response code=422
DEBUG        Exiting _make_request()
DEBUG       Exiting get()
ERROR     
          1 Failed download:
ERROR     ['EURUSD=X']: YFPricesMissingError('possibly delisted; no price data found  (1h 2023-05-07 13:11:36+01:00 -> 2025-05-06 13:11:36+01:00) (Yahoo error = "1h data not available for startTime=1683461496 and endTime=1746533496. The requested range must be within the last 730 days.")')
DEBUG     ['EURUSD=X']: Traceback (most recent call last):
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/multi.py", line 280, in _download_one
              data = Ticker(ticker).history(
                     ^^^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/utils.py", line 102, in wrapper
              result = func(*args, **kwargs)
                       ^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/base.py", line 92, in history
              return self._lazy_load_price_history().history(*args, **kwargs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/utils.py", line 102, in wrapper
              result = func(*args, **kwargs)
                       ^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/scrapers/history.py", line 248, in history
              raise _exception
          yfinance.exceptions.YFPricesMissingError: possibly delisted; no price data found  (1h 2023-05-07 13:11:36+01:00 -> 2025-05-06 13:11:36+01:00) (Yahoo error = "1h data not available for startTime=1683461496 and endTime=1746533496. The requested range must be within the last 730 days.")
          
DEBUG    Exiting download()
failed for 1h
DEBUG    Entering download()
DEBUG     Disabling multithreading because DEBUG logging enabled
DEBUG     Entering history()
DEBUG      Entering history()
DEBUG       EURUSD=X: Yahoo GET parameters: {'period1': '2025-03-07 12:11:37+00:00', 'period2': '2025-05-06 13:11:37+01:00', 'interval': '90m', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG       Entering get()
DEBUG        Entering _make_request()
DEBUG         url=https://query2.finance.yahoo.com/v8/finance/chart/EURUSD=X
DEBUG         params={'period1': 1741349497, 'period2': 1746533497, 'interval': '90m', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG         Entering _get_cookie_and_crumb()
DEBUG          cookie_mode = 'basic'
DEBUG          Entering _get_cookie_and_crumb_basic()
DEBUG           reusing crumb
DEBUG          Exiting _get_cookie_and_crumb_basic()
DEBUG         Exiting _get_cookie_and_crumb()
DEBUG         response code=422
DEBUG         toggling cookie strategy basic -> csrf
DEBUG         Entering _get_cookie_and_crumb()
DEBUG          cookie_mode = 'csrf'
DEBUG          Entering _get_crumb_csrf()
DEBUG           csrfToken = ySDA7CSylpwEnoaCgguzRhjH0yfkqfzn
DEBUG           sessionId='1_cc-session_4f8dda70-6b83-4fdf-b009-a1ce4aba99aa
DEBUG           crumb = 'S7v.JcMWKDU'
DEBUG          Exiting _get_crumb_csrf()
DEBUG         Exiting _get_cookie_and_crumb()
DEBUG         response code=422
DEBUG        Exiting _make_request()
DEBUG       Exiting get()
ERROR     
          1 Failed download:
ERROR     ['EURUSD=X']: YFPricesMissingError('possibly delisted; no price data found  (90m 2025-03-07 12:11:37+00:00 -> 2025-05-06 13:11:37+01:00) (Yahoo error = "90m data not available for startTime=1741349497 and endTime=1746533497. The requested range must be within the last 60 days.")')
DEBUG     ['EURUSD=X']: Traceback (most recent call last):
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/multi.py", line 280, in _download_one
              data = Ticker(ticker).history(
                     ^^^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/utils.py", line 102, in wrapper
              result = func(*args, **kwargs)
                       ^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/base.py", line 92, in history
              return self._lazy_load_price_history().history(*args, **kwargs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/utils.py", line 102, in wrapper
              result = func(*args, **kwargs)
                       ^^^^^^^^^^^^^^^^^^^^^
            File "/home/cole/coding/python/github/yfinance/.venv/lib/python3.12/site-packages/yfinance/scrapers/history.py", line 248, in history
              raise _exception
          yfinance.exceptions.YFPricesMissingError: possibly delisted; no price data found  (90m 2025-03-07 12:11:37+00:00 -> 2025-05-06 13:11:37+01:00) (Yahoo error = "90m data not available for startTime=1741349497 and endTime=1746533497. The requested range must be within the last 60 days.")
          
DEBUG    Exiting download()
failed for 90m
DEBUG    Entering download()
DEBUG     Disabling multithreading because DEBUG logging enabled
DEBUG     Entering history()
DEBUG      Entering history()
DEBUG       EURUSD=X: Yahoo GET parameters: {'period1': '1926-05-31 13:11:44+01:00', 'period2': '2025-05-06 13:11:44+01:00', 'interval': '1d', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG       Entering get()
DEBUG        Entering _make_request()
DEBUG         url=https://query2.finance.yahoo.com/v8/finance/chart/EURUSD=X
DEBUG         params={'period1': -1375530496, 'period2': 1746533504, 'interval': '1d', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG         Entering _get_cookie_and_crumb()
DEBUG          cookie_mode = 'csrf'
DEBUG          Entering _get_crumb_csrf()
DEBUG           reusing crumb
DEBUG          Exiting _get_crumb_csrf()
DEBUG         Exiting _get_cookie_and_crumb()
DEBUG         response code=200
DEBUG        Exiting _make_request()
DEBUG       Exiting get()
DEBUG       EURUSD=X: yfinance received OHLC data: 2003-12-01 00:00:00 -> 2025-05-06 12:11:21
DEBUG       EURUSD=X: OHLC after cleaning: 2003-12-01 00:00:00+00:00 -> 2025-05-06 13:11:21+01:00
DEBUG       EURUSD=X: OHLC after combining events: 2003-12-01 00:00:00+00:00 -> 2025-05-06 00:00:00+01:00
DEBUG       EURUSD=X: yfinance returning OHLC: 2003-12-01 00:00:00+00:00 -> 2025-05-06 00:00:00+01:00
DEBUG      Exiting history()
DEBUG     Exiting history()
DEBUG    Exiting download()
passed for 1d
DEBUG    Entering download()
DEBUG     Disabling multithreading because DEBUG logging enabled
DEBUG     Entering history()
DEBUG      Entering history()
DEBUG       EURUSD=X: Yahoo GET parameters: {'period1': '1926-05-31 13:11:45+01:00', 'period2': '2025-05-06 13:11:45+01:00', 'interval': '5d', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG       Entering get()
DEBUG        Entering _make_request()
DEBUG         url=https://query2.finance.yahoo.com/v8/finance/chart/EURUSD=X
DEBUG         params={'period1': -1375530495, 'period2': 1746533505, 'interval': '5d', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG         Entering _get_cookie_and_crumb()
DEBUG          cookie_mode = 'csrf'
DEBUG          Entering _get_crumb_csrf()
DEBUG           reusing crumb
DEBUG          Exiting _get_crumb_csrf()
DEBUG         Exiting _get_cookie_and_crumb()
DEBUG         response code=200
DEBUG        Exiting _make_request()
DEBUG       Exiting get()
DEBUG       EURUSD=X: yfinance received OHLC data: 2003-12-01 00:00:00 -> 2025-05-06 12:11:21
DEBUG       EURUSD=X: OHLC after cleaning: 2003-12-01 00:00:00+00:00 -> 2025-05-06 13:11:21+01:00
DEBUG       EURUSD=X: OHLC after combining events: 2003-12-01 00:00:00+00:00 -> 2025-05-06 00:00:00+01:00
DEBUG       EURUSD=X: yfinance returning OHLC: 2003-12-01 00:00:00+00:00 -> 2025-05-06 00:00:00+01:00
DEBUG      Exiting history()
DEBUG     Exiting history()
DEBUG    Exiting download()
passed for 5d
DEBUG    Entering download()
DEBUG     Disabling multithreading because DEBUG logging enabled
DEBUG     Entering history()
DEBUG      Entering history()
DEBUG       EURUSD=X: Yahoo GET parameters: {'period1': '1926-05-31 13:11:45+01:00', 'period2': '2025-05-06 13:11:45+01:00', 'interval': '1wk', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG       Entering get()
DEBUG        Entering _make_request()
DEBUG         url=https://query2.finance.yahoo.com/v8/finance/chart/EURUSD=X
DEBUG         params={'period1': -1375530495, 'period2': 1746533505, 'interval': '1wk', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG         Entering _get_cookie_and_crumb()
DEBUG          cookie_mode = 'csrf'
DEBUG          Entering _get_crumb_csrf()
DEBUG           reusing crumb
DEBUG          Exiting _get_crumb_csrf()
DEBUG         Exiting _get_cookie_and_crumb()
DEBUG         response code=200
DEBUG        Exiting _make_request()
DEBUG       Exiting get()
DEBUG       EURUSD=X: yfinance received OHLC data: 2003-12-01 00:00:00 -> 2025-05-06 12:11:21
DEBUG       EURUSD=X: OHLC after cleaning: 2003-12-01 00:00:00+00:00 -> 2025-05-06 13:11:21+01:00
DEBUG       EURUSD=X: OHLC after combining events: 2003-12-01 00:00:00+00:00 -> 2025-05-06 00:00:00+01:00
DEBUG       EURUSD=X: yfinance returning OHLC: 2003-12-01 00:00:00+00:00 -> 2025-05-05 00:00:00+01:00
DEBUG      Exiting history()
DEBUG     Exiting history()
DEBUG    Exiting download()
passed for 1wk
DEBUG    Entering download()
DEBUG     Disabling multithreading because DEBUG logging enabled
DEBUG     Entering history()
DEBUG      Entering history()
DEBUG       EURUSD=X: Yahoo GET parameters: {'period1': '1926-05-31 13:11:46+01:00', 'period2': '2025-05-06 13:11:46+01:00', 'interval': '1mo', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG       Entering get()
DEBUG        Entering _make_request()
DEBUG         url=https://query2.finance.yahoo.com/v8/finance/chart/EURUSD=X
DEBUG         params={'period1': -1375530494, 'period2': 1746533506, 'interval': '1mo', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG         Entering _get_cookie_and_crumb()
DEBUG          cookie_mode = 'csrf'
DEBUG          Entering _get_crumb_csrf()
DEBUG           reusing crumb
DEBUG          Exiting _get_crumb_csrf()
DEBUG         Exiting _get_cookie_and_crumb()
DEBUG         response code=200
DEBUG        Exiting _make_request()
DEBUG       Exiting get()
DEBUG       EURUSD=X: yfinance received OHLC data: 2003-12-01 00:00:00 -> 2025-05-06 12:11:21
DEBUG       EURUSD=X: OHLC after cleaning: 2003-12-01 00:00:00+00:00 -> 2025-05-06 13:11:21+01:00
DEBUG       EURUSD=X: OHLC after combining events: 2003-12-01 00:00:00+00:00 -> 2025-05-06 00:00:00+01:00
DEBUG       EURUSD=X: yfinance returning OHLC: 2003-12-01 00:00:00+00:00 -> 2025-05-01 00:00:00+01:00
DEBUG      Exiting history()
DEBUG     Exiting history()
DEBUG    Exiting download()
passed for 1mo
DEBUG    Entering download()
DEBUG     Disabling multithreading because DEBUG logging enabled
DEBUG     Entering history()
DEBUG      Entering history()
DEBUG       EURUSD=X: Yahoo GET parameters: {'period1': '1926-05-31 13:11:46+01:00', 'period2': '2025-05-06 13:11:46+01:00', 'interval': '3mo', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG       Entering get()
DEBUG        Entering _make_request()
DEBUG         url=https://query2.finance.yahoo.com/v8/finance/chart/EURUSD=X
DEBUG         params={'period1': -1375530494, 'period2': 1746533506, 'interval': '3mo', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG         Entering _get_cookie_and_crumb()
DEBUG          cookie_mode = 'csrf'
DEBUG          Entering _get_crumb_csrf()
DEBUG           reusing crumb
DEBUG          Exiting _get_crumb_csrf()
DEBUG         Exiting _get_cookie_and_crumb()
DEBUG         response code=200
DEBUG        Exiting _make_request()
DEBUG       Exiting get()
DEBUG       EURUSD=X: yfinance received OHLC data: 2003-12-01 00:00:00 -> 2025-05-06 12:11:21
DEBUG       EURUSD=X: OHLC after cleaning: 2003-12-01 00:00:00+00:00 -> 2025-05-06 13:11:21+01:00
DEBUG       EURUSD=X: OHLC after combining events: 2003-12-01 00:00:00+00:00 -> 2025-05-06 00:00:00+01:00
DEBUG       EURUSD=X: yfinance returning OHLC: 2003-12-01 00:00:00+00:00 -> 2025-03-01 00:00:00+00:00
DEBUG      Exiting history()
DEBUG     Exiting history()
DEBUG    Exiting download()
passed for 3mo

Bad data proof

YF.download() has changed argument auto_adjust default to True
passed for 1m

1 Failed download:
['EURUSD=X']: YFPricesMissingError('possibly delisted; no price data found  (2m 1926-05-31 13:07:33+01:00 -> 2025-05-06 13:07:33+01:00) (Yahoo error = "2m data not available for startTime=1070236800 and endTime=1746533253. The requested range must be within the last 60 days.")')
failed for 2m

1 Failed download:
['EURUSD=X']: YFPricesMissingError('possibly delisted; no price data found  (5m 2025-03-07 12:07:40+00:00 -> 2025-05-06 13:07:40+01:00) (Yahoo error = "5m data not available for startTime=1741349260 and endTime=1746533260. The requested range must be within the last 60 days.")')
failed for 5m

1 Failed download:
['EURUSD=X']: YFPricesMissingError('possibly delisted; no price data found  (15m 2025-03-07 12:07:41+00:00 -> 2025-05-06 13:07:41+01:00) (Yahoo error = "15m data not available for startTime=1741349261 and endTime=1746533261. The requested range must be within the last 60 days.")')
failed for 15m

1 Failed download:
['EURUSD=X']: YFPricesMissingError('possibly delisted; no price data found  (15m 2025-03-07 12:07:45+00:00 -> 2025-05-06 13:07:45+01:00) (Yahoo error = "15m data not available for startTime=1741349265 and endTime=1746533265. The requested range must be within the last 60 days.")')
failed for 30m

1 Failed download:
['EURUSD=X']: YFPricesMissingError('possibly delisted; no price data found  (60m 2023-05-07 13:07:46+01:00 -> 2025-05-06 13:07:46+01:00) (Yahoo error = "1h data not available for startTime=1683461266 and endTime=1746533266. The requested range must be within the last 730 days.")')
failed for 60m

1 Failed download:
['EURUSD=X']: YFPricesMissingError('possibly delisted; no price data found  (1h 2023-05-07 13:07:50+01:00 -> 2025-05-06 13:07:50+01:00) (Yahoo error = "1h data not available for startTime=1683461270 and endTime=1746533270. The requested range must be within the last 730 days.")')
failed for 1h

1 Failed download:
['EURUSD=X']: YFPricesMissingError('possibly delisted; no price data found  (90m 2025-03-07 12:07:51+00:00 -> 2025-05-06 13:07:51+01:00) (Yahoo error = "90m data not available for startTime=1741349271 and endTime=1746533271. The requested range must be within the last 60 days.")')
failed for 90m
passed for 1d
passed for 5d
passed for 1wk
passed for 1mo
passed for 3mo

yfinance version

yfinance-0.2.58

Python version

3.12.10

Operating system

wsl - ubuntu

Next Steps:

I would be happy to debug and create a PR - I do see that there have been some issues / features identified in the past with period="max" being one of the arguments, but none purely focusing on the root cause issues around the implemented logic around period "max".

Thanks,
Cole

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions