Closed apunkt closed 11 months ago
The implementation is broken. You need to pass &crumb=<the crumb>
in the url.
how to get the crumb?
getting the same error:
{"finance":{"result":null,"error":{"code":"Unauthorized","description":"Invalid Crumb"}}}
I'm getting the error issue when using the one of the get_* methods
Sorry I have been out on vacation, let me address this issue.
@apunkt @monolidth @jobidon @Edison0019
I just released v1.16 to PyPI, which includes a fix for this issue. My apologies for not getting this out sooner. I'll be keeping an eye out for any further reported problems.
Closing this issue.
oh, you didn't get the memo? You are not allowed to take vacations anymore... Especially in the summer... Ever... jk! Seriously though, thanks so much for looking into this so quickly! Very much appreciated!
Since this morning I get the following error when calling .get_current_price():
in <module> current_price = yahoo_financials.get_current_price() File "/usr/local/lib/python3.8/dist-packages/yahoofinancials/yf.py", line 226, in get_current_price return self._stock_price_data('regularMarketPrice') File "/usr/local/lib/python3.8/dist-packages/yahoofinancials/yf.py", line 162, in _stock_price_data price_data = self.get_stock_price_data() File "/usr/local/lib/python3.8/dist-packages/yahoofinancials/yf.py", line 99, in get_stock_price_data return self.get_clean_data(self.get_stock_tech_data('price'), 'price') File "/usr/local/lib/python3.8/dist-packages/yahoofinancials/etl.py", line 591, in get_stock_tech_data return self.get_stock_data(tech_type=tech_type) File "/usr/local/lib/python3.8/dist-packages/yahoofinancials/etl.py", line 561, in get_stock_data dict_ent = self._create_dict_ent(self.ticker, statement_type, tech_type, report_name, hist_obj) File "/usr/local/lib/python3.8/dist-packages/yahoofinancials/etl.py", line 517, in _create_dict_ent re_data = self._get_historical_data(YAHOO_URL, r_map, tech_type, statement_type) File "/usr/local/lib/python3.8/dist-packages/yahoofinancials/etl.py", line 244, in _get_historical_data self._request_handler(url, config.get("response_field")) File "/usr/local/lib/python3.8/dist-packages/yahoofinancials/etl.py", line 205, in _request_handler raise ManagedException("Server replied with server error code, HTTP " + str(response.status_code) + yahoofinancials.etl.ManagedException: Server replied with server error code, HTTP 401 code while opening the url: https://query2.finance.yahoo.com/v10/finance/quoteSummary/22ua.de?modules=price&formatted=False&lang=en-US®ion=US&corsDomain=finance.yahoo.com
Server response is "Unauthorized" > "Invalid crumb"
.get_historical_price_data() however continues to work.
Please advise.