Run this one-liner in a bash/zsh/... terminal to get all games of a given user in PGN format:
export CHESS_USER=<the-username>; for MONTH_URL in $(curl -Ls "https://api.chess.com/pub/player/$CHESS_USER/games/archives" | jq -rc ".archives[]"); do echo >&2 "Fetching games for $CHESS_USER for month url: $MONTH_URL"; curl -Ls "$MONTH_URL" | jq -rc ".games[].pgn" ; done >> "$(date -u +'%Y-%m-%d-%H-%M-%S')-$CHESS_USER-games.pgn"
Tools required: curl, jq (date should exist on any modern enough system).