That's great work! I just recently found out about jq and it looks super useful. Your examples are really helping picture the data we're delivering. You could post these to https://jqplay.org/ and then other readers could just click over and try them out.
Once the endpoints are finished up and stabilized, we plan to build a few tools to help people dive in. For the read-only API, you've shown that these don't need to be complex SDKs. Aside from `jq`, are there other tools you use to browse APIs? We were thinking of sharing Postman collections and perhaps other generic clients.
Hi. Thanks for releasing this API, this is really cool and I am looking forward getting more API calls available (e.g. PGN, and capability of course to send moves).
Today, I have played a little bit with the API to get JSON results with curl and parse it with JQ parser (https://stedolan.github.io/jq/) and I thought it could be good to share my few lines of codes using with you. I may inspire others...
NB: please change the environment variable $CHESSCOM_USERNAME to your own username in the code below
Example #1: get my games of the current month
$ CHESSCOM_USERNAME="pmaugeri"
$ curl -k https://api.chess.com/pub/player/$CHESSCOM_USERNAME/games/`date +%Y`/`date +%m`
Example #2 (with JQ): get only the "3day" time-class games of the month
$ curl -k https://api.chess.com/pub/player/$CHESSCOM_USERNAME/games/`date +%Y`/`date +%m` | jq '.games[] | select(.time_class=="3day")'
Example #3: return only the fen field
$ curl -k https://api.chess.com/pub/player/$CHESSCOM_USERNAME/games/`date +%Y`/`date +%m` | jq '.games[] | select(.time_class=="3day") | .fen'
Example #4: return only the games I won
$ curl -k https://api.chess.com/pub/player/$CHESSCOM_USERNAME/games/`date +%Y`/`date +"%m"` | jq --arg USERNAME $CHESSCOM_USERNAME '.games[] | select(.time_class=="3day") | (select(.white["result"] == "win" and .white["@id"] == "https://api.chess.com/pub/player/"+$USERNAME )), (select(.black["result"] == "win" and .black["@id"] == "https://api.chess.com/pub/player/"+$USERNAME )) | .fen'