spotify_monitor
Powerful real-time tracker for Spotify friend music activity: monitor listening habits, auto-sync playback to your local client, detect skipped tracks and receive instant notifications for every beat your friends play.
🚀 Quick Install & Run
Python from PyPI
pip install spotify_monitor
Run setup wizard:
spotify_monitor --setup
Docker image - fastest container setup
macOS or Windows
Use a macOS shell or Windows PowerShell with a Docker-compatible runtime that provides the docker CLI.
docker run --rm --pull=always -it --init -v "${PWD}:/data:z" misiektoja/spotify-monitor:latest --setup
In Windows Command Prompt replace ${PWD} with %cd% above.
Linux
Run the container with your numeric user and group IDs (--user "$(id -u):$(id -g)" below). This lets the container write files that your host account can edit.
docker run --rm --pull=always -it --init --user "$(id -u):$(id -g)" -v "$PWD:/data:z" misiektoja/spotify-monitor:latest --setup
Docker Compose - shorter recurring commands
Download the Compose file:
curl -fsSLO https://raw.githubusercontent.com/misiektoja/spotify_monitor/refs/heads/main/docker-compose.yml
Linux container engine requires to export your numeric user ID and group ID so files created in the current directory belong to you instead of root.
export SPOTIFY_MONITOR_UID="$(id -u)"
export SPOTIFY_MONITOR_GID="$(id -g)"
Docker-compatible runtimes on macOS and Windows normally do not need these values.
Run setup wizard:
docker compose run --rm --pull=always spotify_monitor --setup
For the manual single-file method, optional extras and upgrade commands for every method, see Installation.
Features
🔍 Real-time Tracking
- Friend Activity: Monitor songs listened by Spotify users in real-time.
- Presence Detection: Detect when friends get online or offline.
- Session Stats: Display duration, track counts and songs on loop.
🎮 Playback Control
- Auto-Sync: Automatically play friends' songs in your local Spotify client.
- Smart Pause: Pause or switch tracks when the monitored user goes offline.
- Crossfade Support: Detect and annotate crossfaded songs during transitions.
📊 Rich Insights
- Track Context: View playlist, artist and album info with clickable URLs.
- Skip Detection: Identify exactly when and how long a song was played.
- Global Search: Instant links to Spotify, YouTube Music, Apple Music, Tidal, lyrics and more.
🔔 Smart Notifications
- Multi-Channel: Instant alerts via Email and Webhooks (Discord, ntfy etc.).
- Detailed Alerts: Choose activity, tracked-song, every-song, loop and error alerts.
- Session Summaries: Receive detailed reports when a friend finishes a session.
- Error Reporting: Be notified if the monitoring process hits a snag.
⚙️ Power Features
- Auth Flexibility: Cookie or Desktop Client access with automatic web-player metadata fallback and optional legacy OAuth app support.
- CSV Logging: Save every listened song with full timestamps to a CSV file.
- Flexible Config: Support for files, dotenv and environment variables.
- Signal Control: Manage the running script via system signals (macOS/Linux).
- Docker Ready: Run through Docker Hub, Docker Compose or a local image with persistent configuration, secrets and output.
For pause and resume tracking, progress indicators and offline mode, see lastfm_monitor.
For Spotify profile and playlist change tracking, see spotify_profile_monitor.
For Spotify Web Player token and TOTP utilities, see Debugging Tools.
Before Monitoring
Spotify only shows a person's listening activity when both of these conditions are met:
- The Spotify account used by Spotify Monitor follows the person you want to monitor.
- That person has enabled listening activity sharing in Spotify.
The setup wizard checks whether the monitoring account follows the target. It can send the follow request after you confirm. To follow manually, open the target's profile in the Spotify desktop or mobile app. You can use Share > Copy link to profile and paste the complete link into the wizard. You do not need to extract the user ID. See Following the Monitored User.
Common Commands
Use Quick Install & Run above for first-time setup. The table uses PyPI commands. For manual script, direct Docker and Docker Compose equivalents, see Run Individual Commands.
| I want to... | Run this |
|---|---|
| Start monitoring with existing authentication | spotify_monitor TARGET, where TARGET is a raw ID, spotify:user: URI or profile URL |
Start a target saved as TARGET_USER_URI_ID |
spotify_monitor --config-file spotify_monitor.conf |
| Check authentication, connectivity and one target | spotify_monitor --doctor TARGET |
| List Spotify friends visible to the configured account | spotify_monitor --list-friends |
| Import a Spotify login from Firefox | Open Spotify Web Player in Firefox, sign in then run spotify_monitor --import-browser-cookie --browser firefox |
Safely set or replace SP_DC_COOKIE |
Run spotify_monitor --set-sp-dc and enter sp_dc at the hidden prompt |
| Configure and test webhook alerts | Use the setup wizard or follow Webhook Settings |
Running the tool with no arguments offers the wizard if you have not saved a target. If a target is already saved, it starts monitoring that target.
For authentication, saved targets, configuration backups and setup recovery, see the full Setup & First Run guide.
For browser profiles, manual cookie extraction, Docker authentication, email and webhook setup, see Configuration. For notification choices, playback controls and output files, see Usage.
Documentation
Full documentation is available at misiektoja.github.io/spotify_monitor:
- Installation - PyPI, manual script, Docker installation and upgrades
- Setup & First Run - setup wizard, authentication and first run
- Configuration - Spotify login, targets, SMTP, webhooks and secrets
- Usage - command formats, monitoring, container operation, notifications, playback and output
- Troubleshooting - the
--doctorself-check and logging levels - Debugging Tools - TOTP token testing and secret extraction
Change Log
See RELEASE_NOTES.md for details.
Maintainers
- misiektoja (@misiektoja)
- tomballgithub (@tomballgithub)
License
Licensed under GPLv3. See LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spotify_monitor-3.1.1.tar.gz.
File metadata
- Download URL: spotify_monitor-3.1.1.tar.gz
- Upload date:
- Size: 192.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a29f4904315f598793af97c56da8314576a831224682369491b3cdade23a0d3
|
|
| MD5 |
09e48c24eaeb11b3b41d184c13f9f884
|
|
| BLAKE2b-256 |
bfa04c2ef9a6f81040083f85c91f4a99d408ff4fc7e6d6001045314f43d5b99d
|
Provenance
The following attestation bundles were made for spotify_monitor-3.1.1.tar.gz:
Publisher:
publish.yml on misiektoja/spotify_monitor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spotify_monitor-3.1.1.tar.gz -
Subject digest:
8a29f4904315f598793af97c56da8314576a831224682369491b3cdade23a0d3 - Sigstore transparency entry: 2235825649
- Sigstore integration time:
-
Permalink:
misiektoja/spotify_monitor@d4fbc4c2881efcb0288454d6edf95f04757e9ba1 -
Branch / Tag:
refs/tags/v3.1.1 - Owner: https://github.com/misiektoja
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d4fbc4c2881efcb0288454d6edf95f04757e9ba1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file spotify_monitor-3.1.1-py3-none-any.whl.
File metadata
- Download URL: spotify_monitor-3.1.1-py3-none-any.whl
- Upload date:
- Size: 123.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3062678887c126ff5d5f4c34a07b8d71fcb77fc429b49c1ca801fc13b495e925
|
|
| MD5 |
987236c58bcfeb8ab4c26c1453aec735
|
|
| BLAKE2b-256 |
1abcd40a9dbab7f6f7ad381df12fe7ce910fceb68b5914ab4b62456b7187a2b0
|
Provenance
The following attestation bundles were made for spotify_monitor-3.1.1-py3-none-any.whl:
Publisher:
publish.yml on misiektoja/spotify_monitor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spotify_monitor-3.1.1-py3-none-any.whl -
Subject digest:
3062678887c126ff5d5f4c34a07b8d71fcb77fc429b49c1ca801fc13b495e925 - Sigstore transparency entry: 2235825863
- Sigstore integration time:
-
Permalink:
misiektoja/spotify_monitor@d4fbc4c2881efcb0288454d6edf95f04757e9ba1 -
Branch / Tag:
refs/tags/v3.1.1 - Owner: https://github.com/misiektoja
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d4fbc4c2881efcb0288454d6edf95f04757e9ba1 -
Trigger Event:
release
-
Statement type: