Incorrect Timeout rate API.

Sort:
Pawnlings

I will list a few here. I cannot list the thousands I have. 
Stats page = SP
@6jjifgm - API - 52%, SP = 40%

@bananapeelmaster123- API - 25%, SP = 47.06%

@bigcalvin10- API - 62%, SP = N/A% (Last timeout was May 4th, 2024)

@bishoponthedot- API - 100%, SP = N/A% (100% of their games are timeouts but these are back from February. The API should only be 90 days)

@chessplayer279237498- API - 100%, SP = 55.81%

@david007008- API - 21%, SP = 33.33%

@droovybala- API - 71%, SP = Unrated%

@etan2015- API - 87%, SP = Says unrated but they have timeout rates in custom chess going from back January of 2023 which should not appear in the endpoint.

@excellentrsl- API - 25%, SP = 2.74%

@little1bar- API - 100%, SP = N/A% (Timed out their only game back in December 2023. This should not appear in the endpoint.)

@owlhh- API - 40%, SP = 50%

@pliny_the_elder1- API - 45%, SP = 100%

@shyguywowow12- API - 5%, SP = 70%

@bigbertha- API - 65%, SP = 27.74%

I excluded the majority of ones that had a high timeout but their stats page said nothing. I also didn't bother to add anyone in the list that had less than a 10% difference. From what I checked though, out of 100 players, maybe 2 were correct.

It seems by the looks of it at least that the Stats endpoint is grabbing the player's total timeout rate for all games ever played and not filtering by the 90 days in many cases.

I am sure everyone knows how to verify this but you can check the api for a specific member by using this, https://api.chess.com/pub/player/someUsername/stats and passing in one of the above usernames.

Martin_Stahl

The Public API stats endpoint is pulling older games if there's not at least 20 games in the last 90 days.. in that case, it pulls the last 20 games and bases the timeout value on those results. Otherwise it's based on the games in he last 90 days

I'll have to ask but I think the values in the profile are going to be pulling that same data eventually.

Martin_Stahl

I believe the intent is that will be a more accurate representation of a player's propensity to timeout on daily games.

ImperfectAge
Martin_Stahl wrote:

The Public API stats endpoint is pulling older games if there's not at least 20 games in the last 90 days.. in that case, it pulls the last 20 games and bases the timeout value on those results. Otherwise it's based on the games in he last 90 days

I'll have to ask but I think the values in the profile are going to be pulling that same data eventually.

Can this be documented in the API description? Then we will be able to verify if that is actually what it does. At present it just appears unreliable (and often incorrect) since it doesn't match the doc or what is shown in the UI.

Tricky_Dicky
Martin_Stahl wrote:

The Public API stats endpoint is pulling older games if there's not at least 20 games in the last 90 days.. in that case, it pulls the last 20 games and bases the timeout value on those results. Otherwise it's based on the games in he last 90 days

I'll have to ask but I think the values in the profile are going to be pulling that same data eventually.

If that is correct and it hasn't been documented, announced or published in the change log then it's a disgrace. How can the devs change the action of the PUBLIC API without telling the users. The PUBLIC.

stephen_33

I don't say so much about the CHANGELOG because it hasn't been updated by any member of staff since @andreamorandini posted on 30/July/2018, so we probably shouldn't hold our collective breath to see something there?

But for me there's nothing new about this because I was commenting on the dreadful communication this site has with members several years before the API was even brought into operation.

Martin_Stahl
ImperfectAge wrote:
Martin_Stahl wrote:

The Public API stats endpoint is pulling older games if there's not at least 20 games in the last 90 days.. in that case, it pulls the last 20 games and bases the timeout value on those results. Otherwise it's based on the games in he last 90 days

I'll have to ask but I think the values in the profile are going to be pulling that same data eventually.

Can this be documented in the API description? Then we will be able to verify if that is actually what it does. At present it just appears unreliable (and often incorrect) since it doesn't match the doc or what is shown in the UI.

Once I validate what the intent is for profiles, I'll see about getting that updated to match the current definition

Martin_Stahl

I'm also trying to validate which value is being used for tournaments.

Pawnlings

If the endpoint is not retrieving a player's timeout rate based on the last 90 days, it may not be so useful.

Historically, it's always operated off that 90 day period. It has only been in the past 2 months that it's run into trouble.

I messaged chess.com about it about a month and a half ago.

Martin_Stahl

There have been some definition changes and I believe the profile is going to start using the new definition.

It will still be based on 90 days if the member has 20+ games in that timeframe so there's no change on that. However, members that don't play as many games will have theirs calculated based on their last 20 games.

Pawnlings

Hmm, so in essence, the 90 days is a bit meaningless with this new definition. It'll just take the last 20 games worth

Pawnlings

This adjustment will also make it no longer useful for admins looking to filter out players from matches based on their timeout rate in the last 90 days. It could be that the player timed out ten years ago but they're still held to that.

Martin_Stahl
Pawnlings wrote:

Hmm, so in essence, the 90 days is a bit meaningless with this new definition. It'll just take the last 20 games worth

If they have 20 or more games in the last 90 days it takes all of them into account.

Martin_Stahl
Pawnlings wrote:

This adjustment will also make it no longer useful for admins looking to filter out players from matches based on their timeout rate in the last 90 days. It could be that the player timed out ten years ago but they're still held to that.

My guess is really large gaps are going to be relatively rare and playing a few Daily games should be able to offset that more quickly unless most of their last 20 games were timeouts.

ImperfectAge

The new logic seems harder to infer meaning from, since implicit in the new calculation is "it depends" 🤔

Does the API have another field to report on the number of a player's daily games in the last 90 days? Can it be added? I think, given this change, that would be useful.

stephen_33

I think whatever algorithm is used to calculate a member's timeout rate, the important thing is that the endpoint values agree with those in the webpages.

It's not so very complicated to understand that all games played within the past 90 days are used to calculate the timeout rate but should the total be less than 20, additional games are examined until the count is 20.

Martin_Stahl
ImperfectAge wrote:

The new logic seems harder to infer meaning from, since implicit in the new calculation is "it depends" 🤔

Does the API have another field to report on the number of a player's daily games in the last 90 days? Can it be added? I think, given this change, that would be useful.

A lot of the data is being migrated to a different storage location and I believe the new definition is the standard going forward. So the option is that and all-time, based on the information I have seen from devs.

My guess is another value for the same thing is unlikely.

stephen_33

So is it the case now that player-stats timeout values are more or less correct? This player was brought to my notice....

https://api.chess.com/pub/player/sinanko/stats

"timeout_percent": 65

That corresponds closely with the webpage value (66% Last 90 days) but the one given in this match...

https://api.chess.com/pub/match/1666315

... shows: "timeout_percent": 0 !

Should we use only player/xxxx/stats endpoints for the time being?

stephen_33

At the other extreme:-

Same match: https://api.chess.com/pub/match/1666315

"username": "alexandru1001",
"rating": 1170,
"timeout_percent": 100

..but here: https://api.chess.com/pub/player/alexandru1001/stats

"timeout_percent": 0

which seems to correspond with the webpage (no value given)

How is it possible that the value given in that match can indicate 100% timeout rate when the player actually has a zero rate? You have to go back to 5/Nov. of last year to find a single timeout!

The value given in the match is complete garbage.

Martin_Stahl

It should not be assumed that the profile and stats endpoint are the same yet. I don't think the fix has been deployed yet and the one I have been tracking doesn't.

As to the match endpoint, I haven't reheard where it's getting it's data from to know if that in particular is being fixed.