Minor documentation errata

Sort:
skelos

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

 

For each team a url is provided now as well as @id, and thanks for that but it has not made the documentation at the above link. Very minor issue; I was using url and then went "Wait! That's not documented!" It is however present.

An excerpt from https://api.chess.com/pub/match/878170 shows it clearly:

"teams":{"team1":{"@id":"https://api.chess.com/pub/club/battle-for-victory","name":"Battle For Victory","url":"https://www.chess.com/club/battle-for-victory",
andreamorandini

Thank you! Documentation corrected.

skelos

In the team match data:

"settings":{  
      "time_class": "string", // time-per-move grouping, used for ratings
      "time_control": string, // time control

I find "time_class" a little confusing. I actually suspect it's redundant, as if it is "daily" (the match I checked) or "live" (guess) then time_control will be 1/... in the former case and a live time control in the second.

Perhaps the documentation could be clarified a little? If I'm right about "daily" vs "live" adding that would be perfectly sufficient.

Even if there's redundancy, I don't see that it hurts and taking it away would technically be a breaking change, although I don't know if anyone relies on it. (Well, I'm about to use them, but don't mind breakage at this time.)

skelos

Or is time_class going to be "daily", "rapid", "blitz" or "bullet" so save working it out from time_control? That would make coding a little easier ... with documentation help unless I scrabble to see if I can find a live match that has been played, and even so, that only answers my question, not future users' of the documentation's questions.

skelos

I found the documentation I wanted in the player stats endpoint. Maybe a reference?

bcurtis

Correct — the "time_class" is the bunch of related time controls that are "classified" together for the purpose of ratings. It wouldn't make sense to have different ratings for 3-day and 5-day daily chess, so these are part of the same class. We flirted with the name "rating_time_class" for added clarity, but felt that was redundant.

skelos

Thanks @bcurtis. It's very clear (to me) if you start from the player stats endpoint. Not much at all when I started from the team match data. If a hint can be squeezed into the documentation to check the other endpoint it might save someone else some head scratching, but it's only a suggestion.

Learning the endpoints is like learning any other API; the more you know, the easier the new ones are to follow.

skelos

Broken markup in the API page, below player stats:

JSON-LD contexts: in progress 
Example: https://api.chess.com/pub/player/erik/stats</integer percentage in the last 90 days

andreamorandini

Thank you!

skelos

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

Is missing documentation for at least:

  • max_rating

I suspect when set there will be a "min_rating" provided too, but don't have an example match to hand.

skelos

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

Misspelling/typo:

"min_required_games":0, //minimun number of required games
skelos

Top level API might have a typo messing up the markup?

 

...

Team matches:

...

andreamorandini

Thanks, documentation updated!

skelos

Thanks Andrea.

skelos

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

fair_play_removals

has appeared (thanks; I'm sure it will be useful) but it's not mentioned that I see in team match endpoint documentation.

skelos

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

Appears to be missing documentation of "rated" as "true" or "false"?

skelos

Match endpoint for an in progress match:

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

For an in-progress game in this match, I am expecting to see data matching this documentation in the "games" section of the data:

    "games": [
        {
             "white": { // details of the white-piece player:

Note that "white" is a dictionary/hash/compound data structure.

What I see is the @id value for the player of white as a string:

https://api.chess.com/pub/match/893502/2

{"board_scores":{"holdemrulzok":0,"hoffnungslicht":0},"games":[{"url":"https://www.chess.com/daily/game/194799654","move_by":1535823519,"pgn":"[Event \"TMCL 2018 A1 R5 - Board 2\"]\n[Site \"Chess.com\"]\n[Date \"2018.05.15\"]\n[Round \"1\"]\n[White \"HoldemRulzOK\"]\n[Black \"Hoffnungslicht\"]\n[Result \"*\"]\n[ECO \"A20\"]\n[ECOUrl \"https://www.chess.com/openings/A20-English-Opening-Kings-English-Variation-2.g3\"]\n[WhiteElo \"2301\"]\n[BlackElo \"2238\"]\n[TimeControl \"1/259200\"]\n[StartTime \"16:05:28\"]\n[Link \"https://www.chess.com/daily/game/194799654\"]\n\n1. c4 e5 2. g3 d6 3. Bg2 f5 4. Nc3 Nf6 5. d4 e4 6. f3 exf3 7. Nxf3 g6 8. O-O Bg7 9. Bg5 O-O 10. e4 c6 11. Qb3 Qb6 12. Rae1 Qxb3 13. axb3 Na6 14. exf5 Bxf5 15. Re7 Rf7 16. Rxf7 Kxf7 17. Nh4 Bd3 18. Rf3 Nb4 19. d5 Re8 20. Kf2 h6 21. Bxf6 Bxf6 22. Bh3 Kg7 23. Be6 Bc2 24. Ne2 Nd3+ 25. Kf1 Nxb2 26. Ng2 cxd5 27. Bxd5 b6 28. Ngf4 Bf5 29. Nh5+ gxh5 30. Rxf5 Nd3 31. Nf4 Re1+ 32. Kg2 Nxf4+ 33. Rxf4 Rb1 34. Rf3 Rb2+ 35. Kh1 h4 *","time_control":"1/259200","last_activity":1535564319,"rated":true,"turn":"white","fen":"8/p5k1/1p1p1b1p/3B4/2P4p/1P3RP1/1r5P/7K w - - 0 36","start_time":1526400328,"time_class":"daily","rules":"chess","white":"https://api.chess.com/pub/player/holdemrulzok","black":"https://api.chess.com/pub/player/hoffnungslicht","match":"https://api.chess.com/pub/match/893502"},{"url":"https://www.chess.com/daily/game/194799660","move_by":1535637347,"pgn":"[Event \"TMCL 2018 A1 R5 - Board 2\"]\n[Site \"Chess.com\"]\n[Date \"2018.05.15\"]\n[Round \"2\"]\n[White \"Hoffnungslicht\"]\n[Black \"HoldemRulzOK\"]\n[Result \"*\"]\n[ECO \"E12\"]\n[ECOUrl \"https://www.chess.com/openings/E12-Queens-Indian-Defense-Petrosian-Variation...6.cxd5-Nxd5-7.Qc2-Nxc3\"]\n[WhiteElo \"2238\"]\n[BlackElo \"2301\"]\n[TimeControl \"1/259200\"]\n[StartTime \"16:05:28\"]\n[Link \"https://www.chess.com/daily/game/194799660\"]\n\n1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. Nc3 Bb7 5. a3 d5 6. cxd5 Nxd5 7. Qc2 Nxc3 8. bxc3 c5 9. e4 Nd7 10. Bd3 Qc7 11. Qb1 Be7 12. O-O O-O 13. Bd2 Rfd8 14. a4 a6 15. e5 Bxf3 16. gxf3 Nf8 17. Be3 c4 18. Be4 Rab8 19. Kh1 b5 20. axb5 axb5 21. Rg1 f5 22. exf6 Bxf6 23. Qb4 e5 24. d5 Be7 25. Qa5 Qxa5 26. Rxa5 b4 27. cxb4 Rxb4 28. Ra7 Rd7 29. Rxd7 Nxd7 30. d6 Bxd6 31. Rd1 *","time_control":"1/259200","last_activity":1535378147,"rated":true,"turn":"black","fen":"6k1/3n2pp/3b4/4p3/1rp1B3/4BP2/5P1P/3R3K b - - 1 31","start_time":1526400328,"time_class":"daily","rules":"chess","white":"https://api.chess.com/pub/player/hoffnungslicht","black":"https://api.chess.com/pub/player/holdemrulzok","match":"https://api.chess.com/pub/match/893502"}]}

 

skelos

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

These game objects share these element definitions:

  • ...
  • time_class: ratings-group speed of the game. Possible values are: "daily", "rapid", "blitz", "bullet".

I'm seeing "standard", not "rapid", and "lightning" rather than "bullet".

https://api.chess.com/pub/player/fpinget/games/2018/09

...

[%clk 0:00:41.4]} 0-1","time_control":"120+1","end_time":1535795330,"rated":true,"fen":"4B3/1p6/2p4p/1rPp1pk1/3P4/2K5/p7/8 w - -","time_class":"lightning","rules":"chess"
...
"time_class":"standard","rules":"chess",
...

 

"daily" and "blitz" look to be as documented.

bcurtis

I believe this is an error in the data, not the documentation. I've made a ticket to investigate.

skelos

Agree ... the documentation matches the website, and when in doubt, replicate the website.

(Not that all the website's presentation is ideal, but api.chess.com I believe is the tail and www.chess.com is the dog, so let's not get confused here. :/)