Enhancement request for the stats endpoint

Sort:
skelos

Hi,

In discussing a report with some other admins, it's come up that it would sometimes be useful to know when someone last played a team match.

The stats endpoint gives "last" for chess_daily, chess960_daily, chess_blitz etc with timestamp, rating and Glicko RD. That's all good.

I am unsure how much I want this (probably less than I want, say, a vote chess endpoint) and definitely less than a bug or two out there (rating inconsistency on team boards vs the website, if I remember right) but I'll throw it out.

If other people want it, please chime in.

If it would be difficult to do or slow, "Thanks, but no thanks" might be the right answer.

The workaround for anyone who really needs this is to get the player's archive and work back through the games. That won't give the Glicko RD at the time of the most recent tournament game or whatever, but it would provide everything else.

Thanks,

Giles

NichtGut

You can use a headless Selenium web driver to use chess.com´s own filter feature so it just displays Team match daily games (you can select if its 960 or standard too). Most teams include their name in the Team Match name so you can also make Selenium type the name of the club inside. Probably the best it gets without Chess.com´s API

 

I have no idea how their data looks and how they manipulate it  but they have the filter mechanism there...

I have a library in Java that already translates some endpoints into Strings or integers so I may create a method for that too even if there is no endpoint for it lol.

skelos

Thanks ... I can handle the player archives easily enough. I don't think I really need this either; depends on what some other admins decide and what future experience shows.

The enhancement request is basically out here as an idea:

  • If the api.chess.com developers shrug and say "Easy, might be useful now and then, might as well" that's one thing
  • If those same developers wince and think of slow SQL queries then "no" is the right answer
  • ... unless perhaps a number of you jump on board and say, "Yes, I'd use that for ... please, pretty please, we'd really like it!"

If you're getting the picture I'm pretty lukewarm about it, that's about right.

I have been able to say now "I submitted the enhancement request". Which was all I really needed to do today.

NichtGut

What is your method for handling them if you dont mind sharing that knowledge?
I think its definitely useful. They can maybe added it to the JSON you get from 

https://api.chess.com/pub/club/chess-com-developer-community/members

 

Either as a game number, game URL or timestamp. 

skelos

I think the data fits better in the "stats" endpoint, but that's neither here nor there.

I'm not sure I understand your question. How do I handle archives? Or what use do I have for last game data?

 

Archives I download (list of monthly archives at one endpoint, then each available month's archives at a second). Then I pick games out and typically run them through PGN Spy. I'm one of those possibly slightly crazy people who hunts cheats.

The last game data is for helping work out who to invite to a match if more players are needed. If it's a 960 match, not much point inviting someone who's never played it, or tried it and not liked it. What I don't get right now is what type of game it was, so if the player only plays tournaments (including intra-club tournaments) then there's not much point inviting them to a match either.

skelos

For a workaround for this enhancement request it would be:

  • Download list of monthly archives
  • From most recent month to oldest (stopping when they're too old to care about) download that month
  • Look through the month for the latest game of the type I'm interested in. If there is one, stop, I'm done, otherwise back to the previous step and get another month's archive.

That's why I think it would be slow and not worth the trouble (to me) but it can be done without a new endpoint. Faster if the report is wanted for one or a few teams regularly and the downloaded archives are kept. Faster still if the last game of a particular type's timestamp is cached and that value used if it's recent enough, meaning skip downloading and looking through more recent archives for that player.

skelos

If the answer to your question isn't in there somewhere, please ask again. happy.png

NichtGut

By what type of game what do you mean? Like if it was 960 or daily?

I was thinking about modifying PGN SPY to include a function that automatically downloads PGNs trough the JSON data. I need get out of my Java bubble lol. 

How do you tell team matches from random daily games just from the archives? Or does that not matter?

MGleason
NichtGut wrote:

By what type of game what do you mean? Like if it was 960 or daily?

I was thinking about modifying PGN SPY to include a function that automatically downloads PGNs trough the JSON data. I need get out of my Java bubble lol. 

How do you tell team matches from random daily games just from the archives? Or does that not matter?

I considered making that change to PGN Spy, but haven't prioritised it; the download method works well enough for me.  That said, if you're interested, have a good idea, and have development time to put into it, let me know!

skelos
NichtGut wrote:

By what type of game what do you mean? Like if it was 960 or daily?

I was thinking about modifying PGN SPY to include a function that automatically downloads PGNs trough the JSON data. I need get out of my Java bubble lol. 

How do you tell team matches from random daily games just from the archives? Or does that not matter?

Standard or 960 is easy with just the PGN: [TimeControl ...] and [Variant ...] give everything required. For tournaments vs team matches vs "Let's Play" the JSON has the information, and you can usually pretty much work it out from the PGN ("Round 2", "Board 73") but the JSON is simpler.

 

The archive endpoint specifies what a "game" contains, and that will contain a link to a tournament for a tournament game, or a link to a match for a team match game.

Sometimes it matters, sometimes it doesn't. It depends on the cheat.

https://www.chess.com/news/view/published-data-api#pubapi-endpoint-games-archive

Data Format, each Game:

{
...
  "tournament": "string", //URL pointing to tournament (if available),  
  "match": "string", //URL pointing to team match (if available)  
}
skelos
MGleason wrote:
...

I considered making that change to PGN Spy, but haven't prioritised it; the download method works well enough for me.  That said, if you're interested, have a good idea, and have development time to put into it, let me know!

Higher up my list would be having the results show up without having to click "OK" and having a setting to say "Always save a .xml file for an input .pgn file when you'e done."

But I'm not motivated enough for those useful small changes to try to figure Visual Studio on Windows with C++ even if I had a copy.

MGleason
skelos wrote:
MGleason wrote:
...

I considered making that change to PGN Spy, but haven't prioritised it; the download method works well enough for me.  That said, if you're interested, have a good idea, and have development time to put into it, let me know!

Higher up my list would be having the results show up without having to click "OK" and having a setting to say "Always save a .xml file for an input .pgn file when you'e done."

But I'm not motivated enough for those useful small changes to try to figure Visual Studio on Windows with C++ even if I had a copy.

I'll add those to my to-do list.  The first especially is a piece of cake.

I've been quite busy this summer, though.  It may not happen until next year.

skelos

Understood Michael, and PGN Spy is great.

If I cared enough, I'd stomach Visual Studio and C++ and Just Do It. Particularly since I've learned that the performance critical parts of your code are likely in the analysis code ... darn, I forget the name. But anyway, I've programmed on Windows before, although not GUIs since 3.11, and while it would take a ridiculous (compared to you doing it, or another Windows programmer) I could. Or bribe someone with enough beer money to do it for me, which would probably be better all 'round.

skelos

Or alternatively, strip out the GUI bits, the XML library tricky-license bits, and write something not quite so easy to use as a one-off, but easier to set up for batch processing.

OTOH, I am now the official maintainer for the perl PGN module. Which is in sad shape but I've fixed all the reported bugs. Now I need to decide how to gradually change the totally broken parts of the library design and issue a new release. PGN extract but with sensible availability of FENs for each position.

NichtGut

That makes sense, as you can see I didnt read the whole API post hehe. The event shows the name of the match so you can search it that way and that definitely takes less resources and time that using Selenium.