This is a simple script that parses a Steam Family's combined library for new games, then sends a notification to a Discord webhook listing both the new games, and who added them.
This script is intended to be run on a local environment that you control, because it requires access to one of your Steam cookies.
Ensure you have Python 3 installed on your machine. You can install all required libraries using:
pip install argparse datetime os pytz requests python-dateutil python-dotenv
All configuration for this script is done via .env
file. You should rename the included .env.example
file to .env
.
.env key | Description |
---|---|
WEBAPI_KEY | The Steam Web API key that you can get from https://steamcommunity.com/dev/apikey |
COOKIE_TOKEN | See the "Cookie Token" section below |
DISCORD_WEBHOOK_URL | The Discord webhook URL that you'd like to use (see Discord's documentation) |
DISCORD_WEBHOOK_USERNAME | The name that you'd like to appear with your Discord webhook |
DISCORD_WEBHOOK_AVATAR_URL | The URL to the avatar image you'd like to appear with your Discord webhook |
DEFAULT_DAY_COUNT | The number of days "back" that the script should look each time (default: 1) |
Unfortunately, the API that Steam uses to generate your family's game library is an undocumented one, and your regular Web API key will not work for it. Instead, you'll use a workaround by providing one of your cookies to this script. This is necessary because the "private" access token rotates every day, and otherwise you'd need to manually copy and paste your private access token into the script every day.
Caution
NEVER give any of your Steam cookies to anyone else. Only use this script in an environment that you control entirely.
If anyone else has access to this cookie, they will have access to your Steam account!
If you still want to continue, you can click the statement below to open instructions:
I understand the danger of providing my Steam cookie to this script.
- Navigate to Steam's Points Summary Page.
- Open Developer Tools in your browser (F12 or right-click -> Inspect), and switch to the "Application" tab.
- Under "Storage", find and expand "Cookies", then select "https://store.steampowered.com".
- Locate the
steamLoginSecure
cookie, copy its value, and paste it into your.env
file under "COOKIE_TOKEN".
Schedule run.py
to run regularly based on your DEFAULT_DAY_COUNT
to notify of new game additions automatically.
# To run the script:
python run.py
# To run the script and check for new games added in the past X days:
python run.py -d X
# To enable more verbose output for debugging:
python run.py -v
We're using the following Steam APIs (thanks, XPaw!):
- IFamilyGroupsService/GetSharedLibraryApps (gets the shared library)
- IFamilyGroupsService/GetFamilyGroupForUser (gets the family group you're in)
- ISteamUser/GetPlayerSummaries (gets the username from a given Steam User ID)