Open mattpabi opened 4 months ago
Each command-line Python re-run will fetch a new crumb to initialise the new data singleton. But Jupyter persists Python state so no re-fetch happens? That could explain random difference.
Each command-line Python re-run will fetch a new crumb to initialise the new data singleton. But Jupyter persists Python state so no re-fetch happens? That could explain random difference.
Thanks, I see. Any way to solve this issue though? It's quite troublesome to scrape on-demand with this error.
Especially since I can't find anyone who has had this YFtz
error with a fix
I have been having the same issue. The data return randomly, I have also been using just the endpoint daily for the last 3 years and same thing there. This has been happening for about one month now. And same as you, when I run my code on Jupiter note book the data is more consistent, but still takes quite a bit longer than it used to. If you play with Yahoo Finance itself (pulling up a ticket and changing timeframes) the data is inconsistent there too.
the same to me
same issue
same issue
Spamming "same" not helping, use the reaction feature.
https://github.com/ranaroussi/yfinance#developers-want-to-contribute
Can we assume this is an issue from Yahoo's API, and not the yfinance
package?
Experienced the same problem with version 0.2.41
(with python 3.12.2) , and for the same code somehowever I got a '0.2.28' version in a different environment(with python 3.12.4) working perfectly well....
Only 1 request change since 0.2.28: adding cookie & crumb in 0.2.32, 9 months ago. Cookie is cached, but cache might not work in Jupyter so cookie fresh in each notebook.
After some heavy testing, it appears Yahoo has blocked some of my requests.
On the failed machine (a Linux server) it got the 403 Forbidden Error, whilst the working machine(a Mac) also using wget
method would complain Openssl error instead.
same problem
I had the same issue. Traced the issue back to my ad blocker. After I whitelisted fc.yahoo.com it all worked as expected.
I was using Pi-hole, and this domain was blocked. I requested that the maintainer remove it from the block list, and it worked fine.
I am having the same issue. It occurs more often when pulling a large number of tickers. And sometimes a ticker works and sometimes it doesn't. The ticket is still open, so I guess no solution has been found yet, correct? Btw. I do not have an ad-blocker. I only got Google Chrome, which already includes some form of an ad-blocker. I whiteliste finance.yahoo.com and yahoo.com but the problem still persists.
I've left ticket open because ideally YF would detect that fc.yahoo.com
is blocked and handle gracefully (nice message), not blow up.
@ValueRaider Many thanks for the info!
When typing in "fc.yahoo.com" into the browser, it opens yahoo.com. Is this normal or does this mean I am being re-directed?
I am facing the following problem:
I am downloading a large number of tickers (Russell3000 stocks).
Platform used: Colab.Resarch.Google.com
After 600 or 700 tickers, it fails to download the tickers, giving the following error messages: [**** 26% ] 699 of 2677 completedERROR:yfinance:Failed to get ticker 'AVDL' reason: Expecting value: line 1 column 1 (char 0) [**** 26% ] 701 of 2677 completedERROR:yfinance:Failed to get ticker 'CMCL' reason: Expecting value: line 1 column 1 (char 0) [**** 26% ] 702 of 2677 completedERROR:yfinance:Failed to get ticker 'RBA' reason: Expecting value: line 1 column 1 (char 0) [**** 26% ] 702 of 2677 completedERROR:yfinance:Failed to get ticker 'DAKT' reason: Expecting value: line 1 column 1 (char 0) [**** 26% ] 704 of 2677 completedERROR:yfinance:Failed to get ticker 'IMXI' reason: Expecting value: line 1 column 1 (char 0) [**** 26% ] 705 of 2677 completedERROR:yfinance:Failed to get ticker 'SJM' reason: Expecting value: line 1 column 1 (char 0) ERROR:yfinance:Failed to get ticker 'RDN' reason: Expecting value: line 1 column 1 (char 0) [**** 26% ] 707 of 2677 completedERROR:yfinance:Failed to get ticker 'FSS' reason: Expecting value: line 1 column 1 (char 0) ERROR:yfinance:Failed to get ticker 'AWI' reason: Expecting value: line 1 column 1 (char 0) [**** 26% ] 708 of 2677 completedERROR:yfinance:Failed to get ticker 'AVD' reason: Expecting value: line 1 column 1 (char 0) ERROR:yfinance:Failed to get ticker 'RDNT' reason: Expecting value: line 1 column 1 (char 0) [***** 27% ] 710 of 2677 completedERROR:yfinance:Failed to get ticker 'CRS' reason: Expecting value: line 1 column 1 (char 0) ERROR:yfinance:Failed to get ticker 'AEIS' reason: Expecting value: line 1 column 1 (char 0)
However, when downloading each ticker individually, it works! For example, AVDL can be downloaded when it is downloaded alone.
Any support is deeply appreciated! Many thanks in advance!
Just a quick note: it seems like yf.download stopped being able to handle a ticket list with more than 600 or 700 tickers. So it does not work anymore that a ticket list with 3000 tickers is downloaded at once. I have to split this large ticket list into multiple ticket list (each one with 500 tickers). This works!
This issue manifests itself with even 1 ticker. Example:
import yfinance as yf
ticker = "AAPL"
start_date = "2024-11-01"
end_date = "2024-11-15"
data = yf.download(ticker, start=start_date, end=end_date)
print(data.head())
data.to_csv(f"{ticker}_stock_data.csv")
Output:
Failed to get ticker 'AAPL' reason: HTTPSConnectionPool(host='fc.yahoo.com', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x10e714590>: Failed to establish a new connection: [Errno 61] Connection refused'))
[*********************100%***********************] 1 of 1 completed
1 Failed download:
['AAPL']: YFTzMissingError('$%ticker%: possibly delisted; no timezone found')
Empty DataFrame
Columns: [(Adj Close, AAPL), (Close, AAPL), (High, AAPL), (Low, AAPL), (Open, AAPL), (Volume, AAPL)]
Index: []
And this was my first try in 24 hours, so it's not that I'm exceeding any limit here.
Describe bug
Hi, this was an issue I have not seen anybody raise:
YFTzMissingError
. I have been using yfinance for about 2 years now without ever encountering this issue too.When using
yf.download(ticker)
, a timezone not found error is raised, and it says that the request timed out. It's weird as the code seems to randomly work (without any intervention) every few minutes..py
script.Thanks in advance.
Simple code that reproduces your problem
Debug log
Bad data proof
No response
yfinance
version0.2.41
Python version
3.12.4
Operating system
No response