ranaroussi / yfinance

Download market data from Yahoo! Finance's API
https://aroussi.com/post/python-yahoo-finance
Apache License 2.0
13.15k stars 2.33k forks source link

No data found for this date range, symbol may be delisted(July 26th,2022): But, it works again now #998

Closed LeeChunley closed 1 year ago

LeeChunley commented 2 years ago

I run yfiance codes, and it went well before! Also, I checked the same Issues which other friends talked about. It is not helpful. My codes as fellow:

StartDate="2022-05-16" EndDate="2022-05-23"

SYMBOL="QQQ" data=yf.Ticker(SYMBOL)

DATE_CHECK=data.history(interval="1m",start=StartDate,end=EndDate)

print(DATE_CHECK) sys.exit(0)

Errors show as fellow:

Somebody to help me?

Arrjaan commented 2 years ago

Same problem, used to work but currently I am unable to fetch historical data.

Arrjaan commented 2 years ago

Update: I am using eventlet. Including these lines at the start of the document solved this problem for me:

import eventlet eventlet.monkey_patch()

LeeChunley commented 2 years ago

Update: I am using eventlet. Including these lines at the start of the document solved this problem for me:

import eventlet eventlet.monkey_patch()

Hi, Arrjaan, thanks a lot. But, I want to run yfinance stlll. To sart a new python codes package is not the best for me. Could you find out and sweep this problem in yfinance?

Arrjaan commented 2 years ago

It seems the problem lies in your code, not in the yfinance package. If I run a separate file with just your code it works as intended. You might need to review the rest of your code to figure out why it is not working.

LeeChunley commented 2 years ago

It seems the problem lies in your code, not in the yfinance package. If I run a separate file with just your code it works as intended. You might need to review the rest of your code to figure out why it is not working.

Thanks again! I attach a photo of my all codes about this! It prints nothing still. I ran it very well for the same codes before, and it printed nothing just recently and I did not updated any words. 屏幕截图 2022-05-14 223839

lyj0209 commented 2 years ago

Hey I confronted the same problem and i suppose it is because Yahoo Finance can never be accessible in China mainland any more.

LeeChunley commented 2 years ago

Hey I confronted the same problem and i suppose it is because Yahoo Finance can never be accessible in China mainland any more.

Hi, thanks! You supposed? Did u get messages? U have proved it?

lyj0209 commented 2 years ago

Yes when U visit the Yahoo Finance from China Mainland U will see the notification.

发自我的iPhone

------------------ Original ------------------ From: LeeS @.> Date: Wed,Jun 8,2022 0:06 PM To: ranaroussi/yfinance @.> Cc: lyj0209 @.>, Comment @.> Subject: Re: [ranaroussi/yfinance] No data found for this date range, symbolmay be delisted(Jun 8th,2022) (Issue #998)

Hey I confronted the same problem and i suppose it is because Yahoo Finance can never be accessible in China mainland any more.

Hi, thanks! You supposed? Did u get messages? U have proved it?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

cecil0221 commented 2 years ago

Hi, I'm facing the same issue. Looks like it might be a problem in China Mainland. Even though I connect to a VPN using proxy mode, I still fetch nothing using yfinance and pandas-datareader.

I can browse Yahoo Finance with VPN but not working for Python libraries. Anyone has better ideas?

LeeChunley commented 2 years ago

Thanks Arrjaan, lyi0209, cecil0221! Thanks you all! Actually, I worry about the problem which comes from yfinance package itself. It is possible that the writer have not updated it for long time. ....... Expect he will find out it and fix it.

LeeChunley commented 2 years ago

Hi, every one here! 1 minute data, it works again @ yfinance. I don't know way! Thank for you all!

alitrack commented 1 year ago

@LeeChunley still need proxy, right?

tyePhDCandy commented 1 year ago

I'm from mainland, china. I understand yahoo finance could only be accessed by vpn. So, I add proxy parameter to my code. But , still the error persists " No data found for this date range, symbol may be delisted"

import pandas_datareader as web
import yfinance as yf
import datetime as datetime
data = yf.download("IBM", start="2022-04-10", end="2022-05-11", threads=False, proxy="http://127.0.0.1:7890")
print(data)

The output text is as follows.

[*********************100%***********************]  1 of 1 completed

1 Failed download:
- IBM: No data found for this date range, symbol may be delisted
Empty DataFrame
Columns: [Open, High, Low, Close, Adj Close, Volume]
Index: []
ValueRaider commented 1 year ago

This is a bug, proxy handling was broken in many places. Can you try branch hotfix/proxy and report back.

dkdk-ddk commented 1 year ago

@ValueRaider @tyePhDCandy The fixed branch seems to have solved this issue. I checked the implementation, this was indeed caused by mssing proxy param in requests.get()

tyePhDCandy commented 1 year ago

thanks ! good news ! i will try it, when i have time.

ValueRaider commented 1 year ago

Can someone try Ticker.isin(), we're not sure it works with proxy #1399