https://www.chess.com/announcements/view/published-data-api#pubapi-endpoint-games
Those are the endpoints that have member-based PGN files. As to the above script, if the headers being sent aren't configured, the script is likely being blocked.
https://www.chess.com/announcements/view/breaking-change-user-agent-contact-info-required
I recently found https://www.chess.com/forum/view/general/python-script-to-download-entire-game-archive-for-a-specific-user-convert-it-into-a-csv but it doesn't appear to work for me. I'm unsure if this is because of changes to API endpoints. I'm going to keep troubleshooting.
In the meantime, do others have suggestions for scripts to retrieve PGNs from the API with a given username? Ideally, I would like parse and store in CSV format. Perhaps I'll just do it in two steps: 1) download the games in PGN format, 2) parse into CSV format (there is a script for this that I can model what I'm doing).
Suggestions for either?