Skip to main content

spotify_monitor

GitHub Release PyPI Version GitHub Stars Python Versions Docker Pulls License OpenSSF Scorecard Last Commit Maintenance

Powerful real-time tracker for Spotify friend music activity: monitor listening habits, auto-sync playback to your local Spotify client, detect skipped tracks and receive instant notifications for every beat your friends play.

spotify_monitor_screenshot

🚀 Quick Install & Run

Python from PyPI

New to Python or unsure what is installed? Follow the Python install walkthrough first.

pip install spotify_monitor

Run setup for friend activity mode (Spotify friend's completed plays, activity status and listening session):

spotify_monitor --setup

Or for Last.fm scrobble health mode (checks whether plays from your Spotify account reach your Last.fm profile):

spotify_monitor --setup-scrobble-health

Docker image - fastest container setup

The Docker commands below run Friend Activity setup. For Last.fm scrobble health, replace the final --setup with --setup-scrobble-health.

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 to by Spotify users in real time.
  • Scrobble Health: Detect and alert when Spotify scrobbles stop showing up on Last.fm.
  • 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.
  • Coloured Output: Readable terminal colours with a customizable theme, while log files stay plain text.

🔔 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.

spotify_monitor_skipped

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:

  1. The Spotify account used by Spotify Monitor follows the person you want to monitor.
  2. 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 complete profile URL, spotify:user: URI or user ID
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
Enter or replace securely a manually extracted SP_DC_COOKIE Run spotify_monitor --set-sp-dc and enter sp_dc at the hidden prompt
Enter or replace securely LASTFM_API_KEY Run spotify_monitor --set-lastfm-credentials and enter the key at the hidden prompt
Configure and test webhook alerts Use the setup wizard or follow Webhook Settings
Start scrobble health monitoring from saved settings Run spotify_monitor --monitor-mode scrobble_health
Select the monitoring mode for one run Run spotify_monitor --monitor-mode friend_activity TARGET or spotify_monitor --monitor-mode scrobble_health

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 --doctor self-check and logging levels
  • Debugging Tools - TOTP token testing and secret extraction

Change Log

See RELEASE_NOTES.md for details.

Contributing

Bug reports, documentation fixes and code contributions are welcome. See CONTRIBUTING.md for the development setup, the checks CI enforces and what a change needs before it is merged. Participation is covered by the Code of Conduct.

Security

Report a suspected vulnerability privately through GitHub security advisories, never as a public issue. SECURITY.md covers the reporting process, the supported versions and the security posture of stored secrets, configuration loading and local playback.

Maintainers

License

Licensed under GPLv3. See LICENSE. Dependency licenses are listed in THIRD_PARTY_NOTICES.md.

Support

If the project is useful to you, you can support its development through GitHub Sponsors or Buy Me a Coffee.

Metadata

Release files for spotify-monitor 3.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spotify-monitor 3.3.1
File Size Uploaded
spotify_monitor-3.3.1.tar.gz 295.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spotify-monitor 3.3.1
File Interpreter ABI Platform
spotify_monitor-3.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 462.7 kB

Release files / spotify_monitor-3.3.1.tar.gz

Download URL spotify_monitor-3.3.1.tar.gz
Size 295.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d00d10a1270aa851c160ad8e84c73a57ddc5e9858345ee9bfa17e60ab4e6bb44
BLAKE2b-256 checksum
How to use checksums
f752b6204d548f0c0da763de565be2956aea1f727c85de975de094acb5d3b972
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.

Transparency log

Release files / spotify_monitor-3.3.1-py3-none-any.whl

Download URL spotify_monitor-3.3.1-py3-none-any.whl
Size 166.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7711d5c0724af398c8f9dc9c2116fdd2b155a6c07dc57b5bc13890ae64edfdf7
BLAKE2b-256 checksum
How to use checksums
592f6f7ac10449d203e3bb577e6dad8531fc7d7738b11b2f240a8dbf9b37fa72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.

Transparency log

Release history Release notifications | RSS feed

3.6

2 release files

3.5.1

2 release files

3.5

2 release files

3.4

2 release files

This release

3.3.1 This release

2 release files

3.3

2 release files

3.2.1

2 release files

3.2

2 release files

3.1.1

2 release files

3.1

2 release files

3.0.1

2 release files

3.0

2 release files

2.9.2

2 release files

2.9.1

2 release files

2.9

2 release files

2.8

2 release files

2.7

2 release files

2.6

2 release files

2.5

2 release files

2.4

2 release files

2.3.1

2 release files

2.3

2 release files

2.2.1

2 release files

2.2

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1

2 release files

2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page