Steam Monitor V2 is a Python tool for real-time monitoring of Steam user activities with a modern, modular architecture.
- Real-time monitoring of Steam user gaming activity (online/offline status detection and game tracking)
- Comprehensive statistics for user activity (session times, game durations, activity summaries)
- Email notifications for various events (status changes, game changes, API errors)
- CSV logging to save all user activities with timestamps
- Signal control for runtime configuration changes (Unix/Linux/macOS)
- Modular architecture with clean separation of concerns
- Environment-based configuration using .env files
Release notes can be found here
I'm not a dev, project done as a hobby. Code is ugly and as-is, but it works (at least for me) ;-)
The tool requires Python 3.5 or higher.
It uses steam library, also requests and python-dateutil.
It has been tested successfully on:
- macOS (Ventura & Sonoma)
- Linux:
- Raspberry Pi Bullseye & Bookworm
- Ubuntu 24
- Kali Linux 2024
- Windows (10 & 11)
It should work on other versions of macOS, Linux, Unix and Windows as well.
Install the required Python packages:
python3 -m pip install requests python-dateutil "steam[client]"Or from requirements.txt:
pip3 install -r requirements.txtClone or download this repository to your desired location:
git clone <repository-url>
cd SteamMonitorV2/steam_monitorOr download the package and extract it to your preferred directory.
Create a .env file in the steam_monitor directory using the provided template:
cp .env.example .envEdit the .env file and configure the following variables (all parameters have detailed descriptions in the file):
You can get the Steam Web API key here: http://steamcommunity.com/dev/apikey
Set the STEAM_API_KEY variable in your .env file (or use -u parameter).
In order to monitor Steam user activity, proper privacy settings need to be enabled on the monitored user account, i.e. in 'Edit Profile' -> 'Privacy Settings', the value in section 'My Profile' and 'Game details' should be set to 'Friends Only' (if you are friends) or to 'Public'.
If you want to use email notifications functionality you need to configure the SMTP settings in your .env file. Set the following variables:
- SMTP_HOST - Your SMTP server address
- SMTP_PORT - SMTP server port (usually 587 for TLS or 465 for SSL)
- SMTP_USER - Your email username
- SMTP_PASSWORD - Your email password or app password
- SMTP_SSL - Set to
truefor SSL orfalsefor TLS - SENDER_EMAIL - Email address to send from
- RECEIVER_EMAIL - Email address to receive notifications
If you leave the default settings then no notifications will be sent.
You can verify if your SMTP settings are correct by using --test-email parameter (the tool will try to send a test email notification):
python main.py --test-emailAll other variables can be left at their defaults, but feel free to experiment with it.
To get the list of all supported parameters:
python main.py -hor
python main.py -hTo monitor specific user activity, just type the player's Steam64 ID (76561198116287247 in the example below):
python main.py 76561198116287247If you have not set STEAM_API_KEY variable in your .env file, you can use -u parameter:
python main.py 76561198116287247 -u "your_steam_web_api_key"If you do not know the user's Steam64 ID, but you know the Steam profile/community URL (which can be customized by the user), you can also run the tool with -r parameter which will automatically resolve it to Steam64 ID:
python main.py -r "https://steamcommunity.com/id/misiektoja/"The tool will run infinitely and monitor the player until the script is interrupted (Ctrl+C) or killed the other way.
You can monitor multiple Steam players by spawning multiple copies of the script.
It is suggested to use sth like tmux or screen to have the script running after you log out from the server (unless you are running it on your desktop).
The tool automatically saves its output to steammonitor{user_steam64_id}.log file (the log file name suffix can be changed via -y parameter or logging can be disabled completely with -d parameter).
The tool also saves the timestamp and last status (after every change) to steam_{user_display_name}_last_status.json file, so the last status is available after the restart of the tool.
If you want to get email notifications once the user gets online or offline use -a parameter:
./steam_monitor.py -r "https://steamcommunity.com/id/misiektoja/" -aMake sure you defined your SMTP settings earlier (see SMTP settings).
Example email:
If you want to be informed about any user status changes (online/away/snooze/offline) use -s parameter:
./steam_monitor.py -r "https://steamcommunity.com/id/misiektoja/" -sIf you want to be informed when user starts, stops or changes the played game then use -g parameter:
./steam_monitor.py -r "https://steamcommunity.com/id/misiektoja/" -gIf you want to save all reported activities of the Steam user, use -b parameter with the name of the file (it will be automatically created if it does not exist):
./steam_monitor.py -r "https://steamcommunity.com/id/misiektoja/" -b steam_misiektoja.csvIf you want to change the check interval when the user is online/away/snooze to 15 seconds use -k parameter and when the user is offline to 2 mins (120 seconds) use -c parameter:
./steam_monitor.py -r "https://steamcommunity.com/id/misiektoja/" -k 15 -c 120The tool has several signal handlers implemented which allow to change behavior of the tool without a need to restart it with new parameters.
List of supported signals:
| Signal | Description |
|---|---|
| USR1 | Toggle email notifications when user gets online or offline (-a) |
| USR2 | Toggle email notifications when user starts/stops/changes the game (-g) |
| CONT | Toggle email notifications for all user status changes (online/away/snooze/offline) (-s) |
| TRAP | Increase the check timer for player activity when user is online/away/snooze (by 30 seconds) |
| ABRT | Decrease check timer for player activity when user is online/away/snooze (by 30 seconds) |
So if you want to change functionality of the running tool, just send the proper signal to the desired copy of the script.
I personally use pkill tool, so for example to toggle email notifications when user gets online or offline, for the tool instance monitoring the 76561198116287247 user:
pkill -f -USR1 "python3 ./steam_monitor.py 76561198116287247"As Windows supports limited number of signals, this functionality is available only on Linux/Unix/macOS.
Check other supported parameters using -h.
You can combine all the parameters mentioned earlier.
If you use GRC and want to have the tool's log output properly colored you can use the configuration file available here
Change your grc configuration (typically .grc/grc.conf) and add this part:
# monitoring log file
.*_monitor_.*\.log
conf.monitor_logs
Now copy the conf.monitor_logs to your .grc directory and steam_monitor log files should be nicely colored when using grc tool.
This project is licensed under the GPLv3 - see the LICENSE file for details

