Open james-stevens opened 1 year ago
I'm seeing this too. It appears to be random. Runs for a while and then gets the 404 error. My current workaround is to put it in a retry loop but this shouldn't be needed.
Server: Windows 11 Python 3.9.16 yahooquery: 2.2.15 - Anaconda3
Interesting, I've had no success, since it started failing
alpine:~/python/yf$ ./yq.py
"HTTP 404 Not Found"
alpine:~/python/yf$ ./yq.py
"HTTP 404 Not Found"
alpine:~/python/yf$ ./yq.py
"HTTP 404 Not Found"
alpine:~/python/yf$ ./yq.py
"HTTP 404 Not Found"
alpine:~/python/yf$ ./yq.py
"HTTP 404 Not Found"
alpine:~/python/yf$ ./yq.py
"HTTP 404 Not Found"
alpine:~/python/yf$ ./yq.py
"HTTP 404 Not Found"
alpine:~/python/yf$ ./yq.py
"HTTP 404 Not Found"
alpine:~/python/yf$ ./yq.py
"HTTP 404 Not Found"
yq.py
is the test script, as above
Looks the same as #178.
Last time the url can back online around 24hrs later...
Looks the same as #178.
Last time the url can back online around 24hrs later...
reading that, the URL changed & the code was updated - I guess wait & see :)
Seems random to me. I’m passing a list of ~140 stock and index symbols and then using the ‘quotes’ entry. I seem to be ok by doing:
ok = False
numRetries = 5
for i in range(numRetries):
tic = Ticker(val,timeout=5)
qts = tic.quotes
if not isinstance(qts,dict):
print(f'ERROR: qts is not a dict\n{qts=}')
print('Retrying {i}')
continue
else:
ok = True
break
Hope this helps!
Charlie
From: James Stevens @.> Sent: Wednesday, May 24, 2023 11:04 AM To: dpguthrie/yahooquery @.> Cc: chfiii @.>; Comment @.> Subject: Re: [dpguthrie/yahooquery] Since about 8pm UTC yesterday, it stopped working (Issue #192)
Interesting, I've had no success, since it started failing
— Reply to this email directly, view it on GitHub https://github.com/dpguthrie/yahooquery/issues/192#issuecomment-1561331128 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACX2GP5KGW5AOXISASDOT3TXHYPOZANCNFSM6AAAAAAYNHDPGE . You are receiving this because you commented.Message ID: @.***>
#! /usr/bin/python3
import json
from yahooquery import Ticker
tickers = Ticker(["AAPL","TSLA"])
print(json.dumps(tickers.quotes,indent=3))
tickers = Ticker(["AAPL","TSLA"])
print(json.dumps(tickers.quotes,indent=3))
tickers = Ticker(["AAPL","TSLA"])
print(json.dumps(tickers.quotes,indent=3))
tickers = Ticker(["AAPL","TSLA"])
print(json.dumps(tickers.quotes,indent=3))
tickers = Ticker(["AAPL","TSLA"])
print(json.dumps(tickers.quotes,indent=3))
tickers = Ticker(["AAPL","TSLA"])
print(json.dumps(tickers.quotes,indent=3))
tickers = Ticker(["AAPL","TSLA"])
print(json.dumps(tickers.quotes,indent=3))
I get 404
every time (UK)
Strange. Your test runs fine for me. I'm only seeing the 404 sporadically and the retry gets it.
Last time it happened it did appear to be a regional thing
FYI I'm in Connecticut, USA
I'm just getting the 404 error as well. From Canada. Also seems random.
I'm just getting the 404 error as well. From Canada. Also seems random.
I'm still getting nothing but 404s here in the UK - so looks like its not going to cure itself in 24 hrs
I noticed it seems to just be the "tickers.quotes" request that is returning a 404 error. The other modules I'm using are still working, i.e. ticker.price, history, option chain, etc.
I noticed it seems to just be the "tickers.quotes" request that is returning a 404 error. The other modules I'm using are still working, i.e. ticker.price, history, option chain, etc.
Well spotted, nice one! - same for me - gonna need to tweak my code now :)
Me too!! Thanks for the heads up!
Thank you so much - I got my code working again now - price
has everything I need.
Super pleased cos I was missing seeing my $NVDA
investment taking off !!!
As far as I concerned this can be closed, but quotes
still doesn't work for me - so its up to you @dpguthrie
It seems that the price module is taking a lot longer that the quotes one. I was averaging about 1.2 seconds for 136 quotes and now its taking ~10 seconds. Anyone else seeing this?
Price works ok for me but missing the day's and 52 week ranges
It seems that the price module is taking a lot longer that the quotes one. I was averaging about 1.2 seconds for 136 quotes and now its taking ~10 seconds. Anyone else seeing this?
I only do a small number - about 27, so it works fine for me - I also update the prices in the background 4 times an hour, so 1s or 10s is really neither here nor there to me
I tend to update around every 90 seconds so I'm still ok but disappointed in the slowdown, especially it seem to be a subset of the quotes output.
quotes
is not working for me in Arizona, either. I concur with every comment except there's no randomness. It fails 100% of the time. I don't find price
to be a suitable replacement because of missing values and slowness.
Agree that the randomness has gone away. It’s dead all the time now. Missing the 52 week high/low, just returning a ‘N/A’ for now. And the price module is 7-10 times slower
Hi everyone, I also get 404 error from "tickers.quotes" request since 25 May from Turkey. There are important KPIs in quotes that are not available elsewhere, like "bookValue" and "priceToBook". Since I am a beginner, do you have any idea if and when this would be fixed? Thanks!
For me, I get a list of 27 via price
in about 0.85s - I can't recall how long it took under quotes
, but seems about the same to me
I pull the list of tickers from a database & pass the entire list to Ticker
in one go.
def get_prices(ticker):
try:
tickers = Ticker(ticker)
return tickers.price
except Exception as exc:
print(f"ERROR: {exc}")
return None
cnx.query("select ticker from tickers")
res = cnx.store_result()
ret = res.fetch_row(maxrows=0, how=1)
tick_list = [ t["ticker"].upper() for t in ret ]
tickers = get_prices(tick_list)
(this is not posted for you to critique my Python :rofl: )
FYI: One thing I noticed when I switched from quotes to price is that the change% needs to be multiplied by 100 to get the true change percentage.
For those looking for other variabale, the data.summary_detail and the data.key_stats are also still working. Here is a sample of the output fields for each..... Summary Detail... fields: algorithm,ask,askSize,averageDailyVolume10Day,averageVolume,averageVolume10days,beta,bid,bidSize,coinMarketCapLink,currency,dayHigh,dayLow,dividendRate,dividendYield,exDividendDate,fiftyDayAverage,fiftyTwoWeekHigh,fiftyTwoWeekLow,fiveYearAvgDividendYield,forwardPE,fromCurrency,lastMarket,marketCap,maxAge,open,payoutRatio,previousClose,priceHint,priceToSalesTrailing12Months,regularMarketDayHigh,regularMarketDayLow,regularMarketOpen,regularMarketPreviousClose,regularMarketVolume,toCurrency,tradeable,trailingAnnualDividendRate,trailingAnnualDividendYield,trailingPE,twoHundredDayAverage,volume Key Stats: Fields: 52WeekChange,beta,bookValue,category,dateShortInterest,earningsQuarterlyGrowth,enterpriseToRevenue,enterpriseValue,floatShares,forwardEps,forwardPE,fundFamily,heldPercentInsiders,heldPercentInstitutions,impliedSharesOutstanding,lastDividendDate,lastDividendValue,lastFiscalYearEnd,lastSplitDate,lastSplitFactor,legalType,maxAge,mostRecentQuarter,netIncomeToCommon,nextFiscalYearEnd,pegRatio,priceHint,priceToBook,profitMargins,SandP52WeekChange,sharesOutstanding,sharesPercentSharesOut,sharesShort,sharesShortPreviousMonthDate,sharesShortPriorMonth,shortPercentOfFloat,shortRatio,trailingEps
Thanks. This does help as I wanted fiftyTwoWeekHigh./Low. Didn't want to use the history,'1y'' as way too much data
Dear @pfuller88,thank you very much!!!! This helps a lot because I did not know about .keystats:)) You saved me hours and hours as some of the kPIs like priceToBook, sharesOutstanding and many useful stuff disappeared in .quotes.
In my case, accessed from Qatar. all_financial_data(frequency='a') still working fine, but all_financial_data(frequency='q') got 'HTTP 404 Not Found.' error.
I noticed it seems to just be the "tickers.quotes" request that is returning a 404 error. The other modules I'm using are still working, i.e. ticker.price, history, option chain, etc.
thx for that .... still unfortunate that quotes isn't reliable, but prize will do the trick for me
While the link blow is not the exact link use in the code but from the comments it seem yahoo quotes api has been disabled. See sub link. https://query2.finance.yahoo.com/v7/finance/quote .
Looks the same as #178.
Last time the url can back online around 24hrs later...
This is indeed the same issue.
I've been able to find everything via ticker.summary_detail
, ticker.asset_profile
and options: https://query1.finance.yahoo.com/v7/finance/options/{symbol}
e.g. https://query1.finance.yahoo.com/v7/finance/options/NHC.AX
Any solution for this issue? I still receive error: {'error': 'HTTP 404 Not Found. Please try again'} for single modules: summary_detail, summary_profile, earning etc
Describe the bug
Ticker("TSLA").quotes
returnsHTTP 404 Not Found
To Reproduce
OUTPUT:
HTTP 404 Not Found
Expected behavior Should return ticker data
Server (please complete the following information):
Additional context Service was working fine for a couple of months until about 8pm UTC 23rd May (yesterday)