Skip to content

Instantly share code, notes, and snippets.

@Kr3m
Created October 3, 2021 14:15
Show Gist options
  • Save Kr3m/e534fb4a75df5e1bdcd0dc64f0fc32b8 to your computer and use it in GitHub Desktop.
Save Kr3m/e534fb4a75df5e1bdcd0dc64f0fc32b8 to your computer and use it in GitHub Desktop.
Retrieve total number of Steam players currently playing a game.
#Usage: ./playercount.sh "Warfork"
#!/bin/bash
appid=$(curl -s https://api.steampowered.com/ISteamApps/GetAppList/v0002/ | jq ".applist.apps[] | select(.name==\"$1\")" | jq '.appid')
curl -s https://api.steampowered.com/ISteamUserStats/GetNumberOfCurrentPlayers/v1/?appid="$appid" | jq '.response.player_count'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment