Skip to content

Analytics and Hooks

Analytics are local. spotuify records playback/search/action events into SQLite, then derives useful listening facts from them.

Terminal window
spotuify analytics events --limit 50
spotuify analytics events --limit 50 --format jsonl
Terminal window
spotuify analytics top --kind tracks --since 30d --limit 25
spotuify analytics top --kind artists --since all --format json
Terminal window
spotuify analytics habits --window week --format json
Terminal window
spotuify analytics rediscovery --gap 90d

What you get: tracks you listened to before and have not heard recently.

Terminal window
spotuify analytics rebuild

Use --since for a smaller rebuild:

Terminal window
spotuify analytics rebuild --since 2026-05-01T00:00:00Z

Set a hook command in config:

Terminal window
spotuify config set player.event_hook "/Users/me/bin/spotuify-listen-hook"

The hook can scrobble to ListenBrainz, post a now-playing notification, or feed your own logs. Keep it fast; hooks have timeouts so playback is not held hostage.

Terminal window
spotuify analytics export --target listenbrainz --since 2026-01-01
spotuify analytics import --target lastfm