YFRateLimitError('Too Many Requests. Rate limited. Try after a while.')

Hello Community,

I am implementing an application on Streamlit Cloud, but I am unable to use Yahoo Finance. There is a message regarding the rate limit. I do not have this issue on Streamlit Local with the same code.

I would appreciate any help/comments.

Link: https://fundamentalanalysis-llrxumzq9aujn47c4dtmmz.streamlit.app/

Here is the requirements.txt:

pandas
datetime
plotly
matplotlib
numpy
yfinance==0.2.56
data
streamlit
scipy
psutil

I tried different versions of Yahoo Finance, but it did not work.

Thanks.

1 Like

Yahoo can limit your access in any way, at any time, for any reason. This includes applying different limits to requests coming from different computers.

We can only speculate. Yahoo will give no explanations. If it doesn’t work, it doesn’t work. You don’t know when, or if, it will.

Note that many apps in streamlit cloud may be, or have been in the past, making requests to yahoo finance. From yahoo’s point of view, these requests seem to come from just a bunch of IP addresses. It may be that these IPs have been blocked permanently or for a long time, due to high traffic coming from them.

Or it can be something else.

Hi Luiz,

Please let me know if you find a solution. I have also tried the latest yfinance version.

Hello,

Thank you for your message.

Unfortunately, we do not have a solution for this limit. But this issue only occurs on Streamlit Cloud. On my computer, Streamlit Local is working fine.

tks

Hello,

Thanks for your message. I have a workaround, which is to load all the yf datasets on my computer. I save the data and upload it to GitHub.

If I want this application to be updated, I need to do this process every day. This is not practical, but it is a workaround.

Thanks.

Please check this one: YFRateLimitError('Too Many Requests · Issue #2422 · ranaroussi/yfinance · GitHub
It worked for me.

Is it possible it’s a streamlit issue?

I dont have this issue in my local machine, but I do get it in the cloud version of my app.

Github: GitHub - gooneraki/streamlit-portfolio
Cloud: https://gooneraki-portfolio.streamlit.app/Portfolio_View

I’m in the same situation, locally yfinance works, but on streamlit cloud not.

1 Like

I think it might be a specific connection rule between Streamlit Cloud and Yahoo Finance that we are not aware of.

1 Like

yes maybe, I watched some streamlit applications on Hugging Face with yfinance and they work. What a pity there is no more opportunity to deploy with streamlit on HF.
from this morning on streamlit cloud always the same situation


locally it works

It looks like it may be a change on the yfinance side – you might try and see if this fixes it for you YFRateLimitError('Too Many Requests · Issue #2422 · ranaroussi/yfinance · GitHub

thank you for suggestion