yfinance icon indicating copy to clipboard operation
yfinance copied to clipboard

No data found, symbol may be delisted

Open TimurNurlygayanov opened this issue 4 years ago • 21 comments

Hi, thank you for the really useful library!

My code:

data = yf.download(' '.join(TICKERS), start=START_DATE, end=END_DATE,
                                 group_by='ticker')

Sometimes during the downloading of the historical data, I can see some errors like:

- ACHN: No data found, symbol may be delisted
- BID: No data found, symbol may be delisted
- ECA: No data found, symbol may be delisted

So, I suggest we add retry option to try download the data one more time in case it failed. Now I'm doing this workaround in my code:

data = yf.download(' '.join(TICKERS), start=START_DATE, end=END_DATE,
                   group_by='ticker')

tickers_to_retry = []

for ticker in TICKERS:
    download_success = [r for r in data[ticker]['Close'] if r > 0]
    if download_success:
        CASHED_DATA[ticker] = {'close': [r for r in data[ticker]['Close']],
                               'row_data': data[ticker],
                               'low': [r for r in data[ticker]['Low']],
                               'high': [r for r in data[ticker]['High']]}
    else:
        tickers_to_retry.append(ticker)

if tickers_to_retry:
    data = yf.download(' '.join(tickers_to_retry), start=START_DATE, end=END_DATE,
                       group_by='ticker')

for ticker in tickers_to_retry:
    download_success = [r for r in data[ticker]['Close'] if r > 0]
    if download_success:
        CASHED_DATA[ticker] = {'close': [r for r in data[ticker]['Close']],
                               'row_data': data[ticker],
                               'low': [r for r in data[ticker]['Low']],
                               'high': [r for r in data[ticker]['High']]}

So it is better to have retry inside the library and do them automatically at least once.

TimurNurlygayanov avatar Jun 27 '20 06:06 TimurNurlygayanov

Note: it also doesn't help me, but every day I can see different tickers in "delisted" status, and next day these tickers downloading just fine.

TimurNurlygayanov avatar Jun 27 '20 06:06 TimurNurlygayanov

Getting it too but the issue is with Yahoo's API rather than this library. I've found 1000+ tickers that display this behaviour, retrying doesn't really work.

danlinenberg avatar Jul 18 '20 09:07 danlinenberg

I am having the same problem. It happens to me to such an extent that the software overall is not helping me. I hope someone can identify a solution. Maybe need to put in a pause or ?

jtilson avatar Jul 22 '20 00:07 jtilson

Well, I've been working with yfinance now for a few days and for my purposes, I find it to not be useful. I think the marketing of a "reliable" stock reader is untrue. This code randomly fails to fetch me data a large % of the time. I will not spend time trying quantify the many number of ways it fails. I would simply say, try to download 3,000 tickers at one time and tell us how it goes. Doesn't matter if you use threads or not, chunk up tickers into sublists, or not, etc. You will find occasionally (and inconsistently) tickers being declared delisted. Also, at select times ( occasionally) you may get Nans which if you try to read later works fine. I need something that is actually reliable.

jtilson avatar Jul 22 '20 20:07 jtilson

It looks like Yahoo Finance (YF) has started to block requests like these by showing 404 errors; that's why you continue to see "No data found, symbol may be delisted". I've written a YF library that has a built-in retry mechanism as well as a backoff_factor for each successive retry. I was successful retrieving daily YTD data for all Nasdaq tickers. You can see here: https://gist.github.com/dpguthrie/120aeca5bd644cf50fd98b344a307297

dpguthrie avatar Jul 22 '20 23:07 dpguthrie

Thank you for your help. I really wish for yfinance to work for me but the behavior seems even more erratic that I first thought . ( Of course I am not blaming yfinance but that is not material to me) . For example, suppose I have a list of 100 nasdaq tickers. I break them up into chunks of 4 (at most). Time ranges from now to 180 days past. Sometimes a chunk will have a missing entry, which I can believe is rather random event but 'WK" is almost always "lost" unless I call it as a singleton. So the probability of loss seems ticker dependent.

jtilson avatar Jul 24 '20 15:07 jtilson

I'm also getting these even on small batches. Wondering if there are certain times of the day that Yahoo just don't work?

tickers =['FNF', 'ASML', 'GOOGL', 'CVS'] data = yf.download(tickers, group_by="ticker", period='1y')

2 Failed downloads:

  • GOOGL: No data found, symbol may be delisted
  • CVS: No data found, symbol may be delisted

mspacey4415 avatar Jul 29 '20 04:07 mspacey4415

I was wondering the same thing regarding time of day, etc. I agree that the newer library is more resilient. Thanks! But I tend to do bulk downloads ( ~ 3000 tickers) and I experience a pretty high failure rate. I have toggled asynchronous and also do one ticker at a time, now. That seems to help. But, what occurs now, pretty often, for a (for example) 180 day time range, "histories" will only return the last ("now") price. For some reason "WK" is particularly susceptible.

I may have to go old school and put some wait steps into my code. But that will dramatically increase the total execution time. jeff


Jeffrey Tilson

Senior Research Scientist

Renaissance Computing Institute

UNC Chapel Hill

(919) 445-9657


From: mspacey4415 [email protected] Sent: Wednesday, July 29, 2020 12:58 AM To: ranaroussi/yfinance [email protected] Cc: Tilson, Jeffrey L [email protected]; Comment [email protected] Subject: Re: [ranaroussi/yfinance] No data found, symbol may be delisted (#359)

I'm also getting these even on small batches. Wondering if there are certain times of the day that Yahoo just don't work?

tickers =['FNF', 'ASML', 'GOOGL', 'CVS'] data = yf.download(tickers, group_by="ticker", period='1y')

2 Failed downloads:

  • GOOGL: No data found, symbol may be delisted
  • CVS: No data found, symbol may be delisted

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/ranaroussi/yfinance/issues/359#issuecomment-665431091, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB6PWABKDQPI7EBPPZL5RKDR56T7HANCNFSM4OJ4R5VQ.

jtilson avatar Jul 29 '20 12:07 jtilson

2000 requests/ hour per IP might be what is killing us - https://stackoverflow.com/questions/9346582/what-is-the-query-limit-on-yahoos-finance-api

100330706 avatar Jul 29 '20 13:07 100330706

I haven't experienced this issue today, maybe it was fixed. Can anyone confirm?

danlinenberg avatar Aug 14 '20 07:08 danlinenberg

though not sure related to above, I received the error due to no trading day, so no data, and it return empty dataframe. 5105.KL: No data found for this date range, symbol may be delisted

so it possible to happen due to stock temporary suspend,no trade, etc.

mssrr avatar Dec 28 '20 03:12 mssrr

I've only experienced this issue when connected to a VPN. Change the VPN country or disconnect and yfinance works OK.

jeames00 avatar Aug 17 '21 14:08 jeames00

I am getting the same error even to download data for a single symbol! I tried several times giving time gap. But in vain!

R=yf.Ticker('CAPACITE') R.history(start='2021-08-25',end='2021-08-27', actions=False) CAPACITE: No data found, symbol may be delisted Empty DataFrame Columns: [Open, High, Low, Close, Adj Close, Volume] Index: [ ]

This is indeed a big nuisance.

Please help

Blessvskp avatar Aug 27 '21 18:08 Blessvskp

Hi, thank you for the really useful library!

My code:

data = yf.download(' '.join(TICKERS), start=START_DATE, end=END_DATE,
                                 group_by='ticker')

Sometimes during the downloading of the historical data, I can see some errors like:

- ACHN: No data found, symbol may be delisted
- BID: No data found, symbol may be delisted
- ECA: No data found, symbol may be delisted

So, I suggest we add retry option to try download the data one more time in case it failed. Now I'm doing this workaround in my code:

data = yf.download(' '.join(TICKERS), start=START_DATE, end=END_DATE,
                   group_by='ticker')

tickers_to_retry = []

for ticker in TICKERS:
    download_success = [r for r in data[ticker]['Close'] if r > 0]
    if download_success:
        CASHED_DATA[ticker] = {'close': [r for r in data[ticker]['Close']],
                               'row_data': data[ticker],
                               'low': [r for r in data[ticker]['Low']],
                               'high': [r for r in data[ticker]['High']]}
    else:
        tickers_to_retry.append(ticker)

if tickers_to_retry:
    data = yf.download(' '.join(tickers_to_retry), start=START_DATE, end=END_DATE,
                       group_by='ticker')

for ticker in tickers_to_retry:
    download_success = [r for r in data[ticker]['Close'] if r > 0]
    if download_success:
        CASHED_DATA[ticker] = {'close': [r for r in data[ticker]['Close']],
                               'row_data': data[ticker],
                               'low': [r for r in data[ticker]['Low']],
                               'high': [r for r in data[ticker]['High']]}

So it is better to have retry inside the library and do them automatically at least once.

Hey you have to add an extension at the end of the ticker like here in India its 'NS' for NSE (stock exchange). So example 'RELIANCE' is a ticker on NSE so, if I do just yf.Ticker("RELIANCE"). It will do nothing and show the same error but if I do yf.Ticker("RELIANCE.NS"). Its working flawlessly.

deadskull7 avatar Jan 09 '22 09:01 deadskull7

Ticker names must be the yahoo finance link ones so you initially must have placed.ns I don’t think it a yfinance issue It’s simple the way the yahoo finance website assigned ticker names For instance TASE tickets are with .ta suffix

asafravid avatar Jan 09 '22 10:01 asafravid

I'm working on a smart caching wrapper to get round these 'spam limiting' issues. Idea is to only fetch data not in cache, or expired data, and rate-limit requests. Should work perfect for American and Europe markets (currently an issue with Aussie markets that I need to fix): https://github.com/ValueRaider/yfinance-cache

ValueRaider avatar Sep 20 '22 22:09 ValueRaider

@ValueRaider i have some important constructive feedback on your project, DM me

asafravid avatar Sep 21 '22 04:09 asafravid

@asafravid Github doesn't support DM. Create an issue/discussion in the appropriate project.

ValueRaider avatar Sep 21 '22 10:09 ValueRaider

I'll leave the feedback in the https://github.com/ValueRaider/yfinance-cache as issue

asafravid avatar Sep 21 '22 12:09 asafravid

https://github.com/ValueRaider/yfinance-cache/issues/20

asafravid avatar Sep 21 '22 12:09 asafravid

Try using a proper suffix at the end of your tickets, for example, the NSE index has the '.NS' suffix at the end.

Sourabhwitho avatar Dec 20 '22 07:12 Sourabhwitho

I get same error only in Pycharm. But same code work on Jupyter

babak3548 avatar Apr 08 '23 02:04 babak3548

Is this fixed in latest release 0.2.17?

ValueRaider avatar Apr 11 '23 10:04 ValueRaider