This github contains a dataset collected and the tool to track music listening sessions.
Check here and follow the steps: https://www.last.fm/api/webauth
Add your credentials to the environment variables:
''' LASTFM_API_KEY = "YOUR API KEY" LASTFM_API_SECRET = "YOUR API SECRET" '''
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.