ranaroussi / yfinance

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

yes i do few requests inside hit intervals but get error #1620

Closed Sandy4321 closed 1 year ago

Sandy4321 commented 1 year ago

yf.version '0.2.22' Python 3.10.11 windows 11 sorry can not understand what is it Run code with debug logging enabled and post the full output.

I run python code from IDE image

Yahoo Finance free service has rate-limiting depending on request type - roughly 60/minute for prices, 10/minute for info. Once limit hit, Yahoo can delay, block, or return bad data -> not a yfinance bug. yes i do few requests inside hit intervals but get error but still get error will try tomorrow again

but for now i get aapl = yf.Ticker("aapl") aapl.info['forwardPE'] Traceback (most recent call last): Debug Console, prompt 135, line 1 import os File "c:\my_py_environments\py310_torch_cuda_july2023\lib\site-packages\yfinance\ticker.py", line 138, in info return self.get_info() File "c:\my_py_environments\py310_torch_cuda_july2023\lib\site-packages\yfinance\base.py", line 1501, in get_info data = self._quote.info File "c:\my_py_environments\py310_torch_cuda_july2023\lib\site-packages\yfinance\scrapers\quote.py", line 563, in info self._fetch(self.proxy) File "c:\my_py_environments\py310_torch_cuda_july2023\lib\site-packages\yfinance\scrapers\quote.py", line 592, in _fetch result = self._data.get_raw_json( File "c:\my_py_environments\py310_torch_cuda_july2023\lib\site-packages\yfinance\data.py", line 75, in get_raw_json response.raise_for_status() File "c:\my_py_environments\py310_torch_cuda_july2023\lib\site-packages\requests\models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://query2.finance.yahoo.com/v10/finance/quoteSummary/AAPL?modules=summaryProfile%2CfinancialData%2CquoteType%2CdefaultKeyStatistics%2CassetProfile%2CsummaryDetail&ssl=true

al

IMPORTANT

Read and follow these instructions carefully. Help us help you.

Are you up-to-date?

Upgrade to the latest version and confirm the issue/bug is still there.

$ pip install yfinance --upgrade --no-cache-dir

Confirm by running:

import yfinance as yf ; print(yf.__version__)

and comparing against PIP.

Does Yahoo actually have the data?

Are you spelling symbol exactly same as Yahoo?

Then visit finance.yahoo.com and confirm they have the data you want. Maybe your symbol was delisted, or your expectations of yfinance are wrong.

Are you spamming Yahoo?

Yahoo Finance free service has rate-limiting depending on request type - roughly 60/minute for prices, 10/minute for info. Once limit hit, Yahoo can delay, block, or return bad data -> not a yfinance bug.

Still think it's a bug?

Delete these instructions and replace with your bug report, providing the following as best you can:

ValueRaider commented 1 year ago

Read this section again

Are you up-to-date?

This is the third time. Must I block you?

Sandy4321 commented 1 year ago

pls not block me i just not expected you update your code so frequently I recently installed yfinance but you already created new version!!

Installing collected packages: yfinance Attempting uninstall: yfinance Found existing installation: yfinance 0.2.22 Uninstalling yfinance-0.2.22: Successfully uninstalled yfinance-0.2.22 Successfully installed yfinance-0.2.25

now some functions started to work image

but not tsla.recommendations.tail(5) though some capability is coded image