Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Since about 8pm UTC yesterday, it started only returning 404 Errors #192

Open
james-stevens opened this issue May 24, 2023 · 33 comments
Open

Comments

@james-stevens
Copy link

Describe the bug
Ticker("TSLA").quotes returns HTTP 404 Not Found

To Reproduce

#! /usr/bin/python3

import json
from yahooquery import Ticker

tickers = Ticker(["AAPL","TSLA"])
print(json.dumps(tickers.quotes,indent=3))

OUTPUT: HTTP 404 Not Found

Expected behavior
Should return ticker data

Server (please complete the following information):

  • OS: Alpine 3.16.5
  • Python: 3.10.11
  • Version: yahooquery v2.3.1

Additional context
Service was working fine for a couple of months until about 8pm UTC 23rd May (yesterday)

@chfiii
Copy link

chfiii commented May 24, 2023

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

@james-stevens
Copy link
Author

james-stevens commented May 24, 2023

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

@james-stevens james-stevens changed the title Since about 8pm UTC yesterday, it stopped working Since about 8pm UTC yesterday, it started only returning 404 Errors May 24, 2023
@maread99
Copy link
Contributor

Looks the same as #178.

Last time the url can back online around 24hrs later...

@james-stevens
Copy link
Author

james-stevens commented May 24, 2023

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 :)

maread99/market_prices#155

@chfiii
Copy link

chfiii commented May 24, 2023 via email

@james-stevens
Copy link
Author

#! /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)

@chfiii
Copy link

chfiii commented May 24, 2023

Strange. Your test runs fine for me. I'm only seeing the 404 sporadically and the retry gets it.

@james-stevens
Copy link
Author

Last time it happened it did appear to be a regional thing

@chfiii
Copy link

chfiii commented May 24, 2023

FYI I'm in Connecticut, USA

@pfuller88
Copy link

I'm just getting the 404 error as well. From Canada. Also seems random.

@james-stevens
Copy link
Author

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

@pfuller88
Copy link

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.

@james-stevens
Copy link
Author

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 :)

@chfiii
Copy link

chfiii commented May 25, 2023

Me too!! Thanks for the heads up!

@james-stevens
Copy link
Author

james-stevens commented May 25, 2023

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

@chfiii
Copy link

chfiii commented May 25, 2023

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?

@chfiii
Copy link

chfiii commented May 25, 2023

Price works ok for me but missing the day's and 52 week ranges

@james-stevens
Copy link
Author

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

@chfiii
Copy link

chfiii commented May 25, 2023

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.

@CraigerBrau
Copy link

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.

@chfiii
Copy link

chfiii commented May 25, 2023

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

@caliskanuzay
Copy link

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!

@james-stevens
Copy link
Author

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 🤣 )

@chfiii
Copy link

chfiii commented May 26, 2023

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.

@pfuller88
Copy link

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

@chfiii
Copy link

chfiii commented May 28, 2023

Thanks. This does help as I wanted fiftyTwoWeekHigh./Low. Didn't want to use the history,'1y'' as way too much data

@caliskanuzay
Copy link

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.

@charlie-delta-003
Copy link

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.

@kajdo
Copy link

kajdo commented Jun 1, 2023

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

@Marcel2059
Copy link

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 .

@benhowell
Copy link

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

@dpguthrie
Copy link
Owner

There's a potential fix to this issue here.

@charlie-delta-003
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests