yahooquery icon indicating copy to clipboard operation
yahooquery copied to clipboard

all_financial_data doesn't work for quarterly data.

Open alBronko opened this issue 1 year ago • 8 comments

all_financial_data doesn't work for quarterly data.

from yahooquery import Ticker aapl = Ticker('aapl') aapl.all_financial_data('q') {'error': 'HTTP 404 Not Found. Please try again'} stopped working on May 15th.

it works like this: from yahooquery import Ticker aapl = Ticker('aapl') aapl.all_financial_data()

Desktop (please complete the following information):

  • linux
  • Python 3.10.6
  • yahooquery-2.3.1

alBronko avatar May 22 '23 09:05 alBronko

Same issue is occurring for me with quotes (only started less than 24 ago):

from yahooquery import Ticker aapl = Ticker('aapl') q = aapl.quotes print(q) HTTP 404 Not Found

Desktop (please complete the following information):

linux
Python 3.10.6
yahooquery-2.3.1

benhowell avatar May 24 '23 10:05 benhowell

same here, any solution for this issue?

Aillian avatar Jun 09 '23 14:06 Aillian

Works for me. Linux, yahooquery 2.3.1, python 3.10.11

ms82494 avatar Jun 28 '23 22:06 ms82494

Works for me. Linux, yahooquery 2.3.1, python 3.10.11

I just re-ran the code above and it still doesn't work. Can you post the output of this code: from yahooquery import Ticker aapl = Ticker('aapl') q = aapl.quotes print(q)

benhowell avatar Jun 29 '23 00:06 benhowell

@benhowell I get HTTP 404 Not Found errors on quotes, too. But this question concerned all_financial_data().

ms82494 avatar Jun 30 '23 02:06 ms82494

@benhowell I get HTTP 404 Not Found errors on quotes, too. But this question concerned all_financial_data().

Ah, sorry, I misread! Thanks for update though, I appreciate it.

The quotes issue is further discussed here: #192

benhowell avatar Jun 30 '23 02:06 benhowell

I just started to notice the same problem. Maybe this is indeed similar to the quotes problem #192, as @benhowell suggested. I tried it with and without YF+ session crumb and with and without user_agent, and neither seems to make a difference.

ms82494 avatar Jun 30 '23 23:06 ms82494

After doing some debugging, it looks like the request is returning a 431 status code due to an incredibly long request header. This endpoint accepts a query parameter type which you then specify in a comma delimited list all of the "types" you want returned. The annual one appears to work because it doesn't hit the same limit as quarterly.

The fix would most likely be to split the list in two and make two separate requests for each symbol. This is probably still slightly better than calling each individual financials method to return the same set of data.

dpguthrie avatar Jul 07 '23 19:07 dpguthrie