I have been using last.fm[1] for this for years (just checked, from 2008!). They now do a rolling weekly and annual interactive chart which is fun to look at, here's mine for 2023[2].
They have a Spotify integration and I use PanoScrobbler on mobile.
There's also ListenBrainz, run by the MusicBrainz org, which offers similar functionality without API restrictions or other paid features that Last.FM tries to push.
Plug for my buddy's awesome tool LastWave [1] - generates you a groovy waveform data visualization based off your listening history. Free and open source, check it out!
Been at it since 2004 [0]!
[0] https://www.last.fm/user/nudgeee/listening-report/year