Error 404 on any request

Sort:
AlexeyChess

After fixing recent issue with user-agent in python, my code worked for about 2h

Now after 1-3 seconds delay I've got an error, tested different locations, different e-mails, different API calls

<class 'chessdotcom.types.ChessDotComError'>(status_code=404, text={"code":0,"message":"An internal error has occurred. Please contact Chess.com Developer's Forum for further help https://www.chess.com/club/chess-com-developer-community ."})

Looks like blocking the default user-agent was just a beginning

stephen_33

I'm not having any problem with club/matches or match endpoints at the moment.

Do you have an example of an endpoint that's returning 404?

Martin_Stahl

404 means it can't be found. Examples where you're seeing issues, as @stephen_33 suggested, may help

AlexeyChess

Situation is dynamic, there are some considerable changes even from my post (1h ago)

At start I was thinking they implement some additional restrictions to lower the load, but now first idea – they are having internal problem with database exposed via API

Now on get_player_games_by_month I have 8% API calls returning error 404, and this doesn’t look like rate limit, as those errors are persistent

Examples:
https://api.chess.com/pub/player/momo564/games/2023/06

https://api.chess.com/pub/player/BlueAura991/games/2022/05

https://api.chess.com/pub/player/kaushalcd/games/2021/08

I checked all 3 on chess.com, they all had games in their respective months

8% (26 errors on 316 calls) is huge (was less than 0.1 2 days ago), but recently number was close to 100, that’s why I gave such title to the topic, as number of errors provided an impression of total malfunction

Fingers crossed in hope they will fix it

MasterMatthew52

I have that happen for a few tournament endpoints on occasion. Posted something on it a while back and I think it was related to a timeout issue. There's 1 member request that always does the same.

If that's the case here, not much you can do on your end.

AlexeyChess

Consistency between website and API was never ideal, but this whole new level, at least for players games

stephen_33
Martin_Stahl wrote:

404 means it can't be found. Examples where you're seeing issues, as @stephen_33 suggested, may help

But is it possible to identify what's wrong? Even if a problem can't be fixed readily (if at all) it would help to know why a particular endpoint request keeps failing.

YankeeBastid

This is how I deal with the 404 error using php5.5 :

$txt = "https://api.chess.com/pub/player/$CID/games/$yr/$mo"; 
$data = json_decode(file_get_contents($txt), true);
$headers = get_headers($txt);
$http_status = intval(substr($headers[0], 9, 3));
if ($http_status == 301) {
code
}
if ($http_status == 404) {
code
} else {
code }
} else {
code
 }
sjbfan
YankeeBastid wrote:

This is how I deal with the 404 error using php5.5 :

$txt = "https://api.chess.com/pub/player/$CID/games/$yr/$mo"; 
$data = json_decode(file_get_contents($txt), true);
$headers = get_headers($txt);
$http_status = intval(substr($headers[0], 9, 3));
if ($http_status == 301) {
code
}
if ($http_status == 404) {
code
} else {
code }
} else {
code
 }

This doesn't actually solve anything, it just tells your code how to process the error

YankeeBastid

is it an error? I thought 404 meant no data found.

sjbfan
YankeeBastid wrote:

is it an error? I thought 404 meant no data found.

yes but that's chess.com's issue. there should be data there. that's why this thread exists. people are requesting data and the 404 is returned due to no data when there should be data

YankeeBastid

Thanks for the correction. I have not encountered that issue yet that I know of.

AlexeyChess

Now it’s back to normal, 404 turned into 503 and rate of errors drops to usual