cross-posted from: https://lemmy.ml/post/1192578

From Listenbrainz website:

ListenBrainz keeps track of music you listen to and provides you with insights into your listening habits. We’re completely open-source and publish our data as open data.

If you use Last.FM, you can import the data into your listenbrainz account. Listenbrainz also has Spotify integration.