- Steam Web API Key: API key is important to fetch your account details and for that you will require a key which you can create for your account here
- Github API Token:
- Goto your Github profile -> Settings -> Developer Settings -> Personal Access Tokens -> Tokens(Classic) or just click here
- Generate new token -> Generate new token(classic)
- Select scopes -> repo and workflow only
- Set a reasonable expiration date
- Markdown Comments: Update the markdown file by adding the comments where the Steam Stats will be embedded to. Refer here to learm more.
- Steam ID: You can get your 64-bit Steam id (SteamID64 - 17 digit number) by clicking on your profile name in the top right corner in steam desktop client, select "Account Details" and your Steam ID will be displayed directly under your account name
- Steam Custom ID: Open the Steam desktop application, click on your profile name in the top right corner. Select "View Profile" and your custom URL will be displayed in the URL bar. From this url you will know your Steam Custom ID
The Github Actions is set to run on every Monday 12 AM IST (UTC+5:30) which you can modify to your own time as per your liking by updating it in the workflow file
schedule:
- cron: "30 18 * * 0"
Samples (From my Steam Account)
Example for Steam User Stats
Example for Steam Workshop Stats
- Add below comment in your markdown file(Readme.md) for Steam User Stats
<!-- Steam-Stats start --> <!-- Steam-Stats end -->
- Add below comment for Steam Workshop Stats (Optional)
<!-- Steam-Workshop start --> <!-- Steam-Workshop end -->
- Don't forget to add these comments in your readme file or wherever you want to display your steam stats, because without the comments the readme will not get updated
- Steam Player Summary1
- Recently Played Games from Steam in the Last 2 Weeks
- Steam Workshop Stats (If Available)
- Steam User Stats (Required | Default)
- Steam Player Summary
- Steam's Recently Played Games in the last 2 weeks
- Steam Workshop Stats (Optional)
- Workshop Stats Module can be activated/used by adding this flag in the workflow file in the environment variables:
WORKSHOP_STATS: True
- This module displays the total number of Unique Visitors, Subscribers and Favorites for your Steam Workshop Items
- Workshop Stats Module can be activated/used by adding this flag in the workflow file in the environment variables:
After completing the steps mentioned in the Prerequisites, you have to save all the mentioned keys(except markdown comments) like github token,api key, steamid, customid as Secrets in your Github repo's settings.
Repo Settings -> Security -> Secrets and Variables -> Actions -> Add in Repository Secrets
If you are new to Github Secrets then you can checkout this doc here. And from here you can learn about Github Tokens.
Sample Workflow File
name: Steam Stats
on:
schedule:
# Runs every Monday at 12AM IST (UTC+5:30)
- cron: "30 18 * * 0"
workflow_dispatch:
jobs:
update-readme:
name: Steam Stats
runs-on: ubuntu-latest
steps:
- uses: nicconike/steam-stats@master
with:
STEAM_API_KEY: ${{ secrets.STEAM_API_KEY }}
STEAM_ID: ${{ secrets.STEAM_ID }}
STEAM_CUSTOM_ID: ${{ secrets.STEAM_CUSTOM_ID }}
Footnotes
-
Unfortunately, Steam Web API doesn't support Web Sockets so the profile status cannot be updated in real time as it gets updated in steam profile 🥲 ↩