Skip to content

Error messages claim "possibly delisted" even when Yahoo explains the real cause #2902

Closed

Description

@vignesh-nagarajan-vn

Describe bug

Every YFPricesMissingError message starts with $TICKER: possibly delisted; ..., even when Yahoo's response contains an explicit reason that has nothing to do with delisting. Example, a 30m request older than Yahoo's 60 day intraday window:

$SPY: possibly delisted; no price data found  (30m 2026-03-16 -> 2026-03-23) (Yahoo error = "15m data not available for startTime=1773633600 and endTime=1774238400. The requested range must be within the last 60 days.") (30m resampled from 15m)

SPY is not delisted. The request was outside the allowed range, and Yahoo said so in the quoted error. The speculation sends users down the wrong path (see #1713, #1797, #2044, #2052 for examples of the confusion). When a ticker really is dead, Yahoo's own description already says "No data found, symbol may be delisted", so the prefix adds nothing there either.

Suggested fix

When history() has an explicit error description from Yahoo, suppress the "possibly delisted" prefix and let Yahoo's stated reason stand. Keep the prefix where Yahoo returns nothing and delisting is a plausible explanation. Happy to submit a PR, as a follow-up to #2900 which fixed the interval part of this same message.

Simple code that reproduces your problem

import yfinance as yf
import datetime as dt
start = dt.date.today() - dt.timedelta(days=120)
yf.Ticker("SPY").history(start=start, end=start + dt.timedelta(days=7), interval="30m", raise_errors=True)

Debug log with debug logging enabled

Traceback (most recent call last):
  File "<string>", line 9, in <module>
  File "yfinance\utils.py", line 124, in wrapper
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "yfinance\base.py", line 129, in history
    return self._lazy_load_price_history().history(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "yfinance\utils.py", line 124, in wrapper
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "yfinance\scrapers\history.py", line 299, in history
    raise _exception
yfinance.exceptions.YFPricesMissingError: $SPY: possibly delisted; no price data found  (30m 2026-03-16 -> 2026-03-23) (Yahoo error = "15m data not available for startTime=1773633600 and endTime=1774238400. The requested range must be within the last 60 days.") (30m resampled from 15m)

Bad data proof

No response

yfinance version

dev (a9de4ba)

Python version

No response

Operating system

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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