Work in progress
This documentation page is currently work in progress.
Not all existing DecAPI endpoints are documented here yet. For the currently active documentation, please visit docs.decapi.me.
Player's playtime in a specific Steam game
Returns the specified player's playtime in a specific Steam game.
You need to know the "Steam 64 ID" of the player you want to get the playtime for, as well as the app ID of the game.
For the "Steam 64 ID", you can use a service like SteamID.co and put your Steam community profile URL in to get the ID.
For example, the Steam 64 ID for the profile URL https://steamcommunity.com/id/Decicus/
is 76561197997719567
.
The "app ID" of a Steam game can be found in the URL of the game's store page.
For example:
- Counter-Strike 2 has the app ID
730
: https://store.steampowered.com/app/730/CounterStrike_2/ - DayZ has the app ID
221100
: https://store.steampowered.com/app/221100/DayZ/ - Half-Life 2 has the app ID
220
: https://store.steampowered.com/app/220/HalfLife_2/
Note
Game details, such as hours played, is by default hidden.
If you want to show your game details, you can change your Steam "Game Details" to public in the privacy settings.
You can find the privacy settings by clicking here.
Endpoint URL
https://decapi.me/steam/hours/YOUR_STEAMID_HERE/GAME_APPID_HERE
See example below for usage with an actual Steam game and profile.
URL parameters
steamid
- Required - The Steam 64 ID of the player to get the playtime for.appid
- Required - The Steam AppID of the game to get the player count for.readable
- Optional - If specified, the playtime will be returned in a more human-readable format.- For instance - Instead of
36 hours
, it will return1 day, 12 hours
. - This is simply added at the end of the URL as literally
/readable
, see examples below for usage.
- For instance - Instead of
Query parameters
round
- Optional - Round the playtime to the specified number of decimal places.- If specified with 0 or below, or with no value, the result will be rounded to the nearest whole number.
- This is not compatible with the
readable
parameter.
format
- Optional - Allows you to customize the output format.- Default is:
%s hours
- If you wish to only get the number of hours, you can specify
format=%s
in the query parameters. See examples below for usage. - Not compatible with the
readable
URL parameter.
- Default is:
key
- Optional - Your Steam API key.- This is required if you want to get the hours from a private Steam profile.
- If you don't have a Steam API key, you can get one here.
- If you need a "domain name" for the API key, you can use
example.com
.
- If you need a "domain name" for the API key, you can use
-
Warning
Note: Please make sure to keep your Steam API key private. If you plan on using it in a bot command, I suggest adding the command via the bot's dashboard instead of directly in chat.
Example
- My total hours in Half-Life 2: https://decapi.me/steam/hours/76561197997719567/220
76561197997719567
is my Steam 64 ID, and220
is the app ID for Half-Life 2.
- My total hours in DayZ, with the "readable" format: https://decapi.me/steam/hours/76561197997719567/221100/readable
76561197997719567
is my Steam 64 ID, and221100
is the app ID for DayZ./readable
is specified as-is at the end of the URL.
- My total hours in Garry's Mod, with just the number of hours, no trailing text: https://decapi.me/steam/hours/76561197997719567/4000?format=%s
76561197997719567
is my Steam 64 ID, and4000
is the app ID for Garry's Mod.
- My total hours in Grand Theft Auto V, with custom text.
+
(plus sign) in the URL is used to represent spaces.: https://decapi.me/steam/hours/76561197997719567/271590?format=Alex+has+been+playing+GTAV+for+%s+hours76561197997719567
is my Steam 64 ID, and4000
is the app ID for Half-Life 2.
Examples for bots
Nightbot
Note: Nightbot will automatically convert variables, such as$(channel)
or $(touser)
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
My total hours in Half-Life 2:
$(urlfetch https://decapi.me/steam/hours/76561197997719567/220)
-
My total hours in DayZ, with the 'readable' format:
$(urlfetch https://decapi.me/steam/hours/76561197997719567/221100/readable)
-
My total hours in Garry's Mod, with just the number of hours, no trailing text:
$(urlfetch https://decapi.me/steam/hours/76561197997719567/4000?format=%s)
-
My total hours in Grand Theft Auto V, with custom text.
+
(plus sign) in the URL is used to represent spaces.:$(urlfetch https://decapi.me/steam/hours/76561197997719567/271590?format=Alex+has+been+playing+GTAV+for+%s+hours)
Fossabot
Note: Fossabot will automatically convert variables, such as$(channel)
or $(user.login)
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
My total hours in Half-Life 2:
$(customapi https://decapi.me/steam/hours/76561197997719567/220)
-
My total hours in DayZ, with the 'readable' format:
$(customapi https://decapi.me/steam/hours/76561197997719567/221100/readable)
-
My total hours in Garry's Mod, with just the number of hours, no trailing text:
$(customapi https://decapi.me/steam/hours/76561197997719567/4000?format=%s)
-
My total hours in Grand Theft Auto V, with custom text.
+
(plus sign) in the URL is used to represent spaces.:$(customapi https://decapi.me/steam/hours/76561197997719567/271590?format=Alex+has+been+playing+GTAV+for+%s+hours)
StreamElements
Note: StreamElements will automatically convert variables, such as${channel}
or ${touser}
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
My total hours in Half-Life 2:
${customapi.https://decapi.me/steam/hours/76561197997719567/220}
-
My total hours in DayZ, with the 'readable' format:
${customapi.https://decapi.me/steam/hours/76561197997719567/221100/readable}
-
My total hours in Garry's Mod, with just the number of hours, no trailing text:
${customapi.https://decapi.me/steam/hours/76561197997719567/4000?format=%s}
-
My total hours in Grand Theft Auto V, with custom text.
+
(plus sign) in the URL is used to represent spaces.:${customapi.https://decapi.me/steam/hours/76561197997719567/271590?format=Alex+has+been+playing+GTAV+for+%s+hours}
Streamlabs Chat Bot
Note: Streamlabs Chat Bot will automatically convert variables, such as$mychannel
or $touserid
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
My total hours in Half-Life 2:
$readapi(https://decapi.me/steam/hours/76561197997719567/220)
-
My total hours in DayZ, with the 'readable' format:
$readapi(https://decapi.me/steam/hours/76561197997719567/221100/readable)
-
My total hours in Garry's Mod, with just the number of hours, no trailing text:
$readapi(https://decapi.me/steam/hours/76561197997719567/4000?format=%s)
-
My total hours in Grand Theft Auto V, with custom text.
+
(plus sign) in the URL is used to represent spaces.:$readapi(https://decapi.me/steam/hours/76561197997719567/271590?format=Alex+has+been+playing+GTAV+for+%s+hours)
Streamlabs Cloudbot
Note: Streamlabs Cloudbot will automatically convert variables, such as{channel.name}
or {touser.name}
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
My total hours in Half-Life 2:
{readapi.https://decapi.me/steam/hours/76561197997719567/220}
-
My total hours in DayZ, with the 'readable' format:
{readapi.https://decapi.me/steam/hours/76561197997719567/221100/readable}
-
My total hours in Garry's Mod, with just the number of hours, no trailing text:
{readapi.https://decapi.me/steam/hours/76561197997719567/4000?format=%s}
-
My total hours in Grand Theft Auto V, with custom text.
+
(plus sign) in the URL is used to represent spaces.:{readapi.https://decapi.me/steam/hours/76561197997719567/271590?format=Alex+has+been+playing+GTAV+for+%s+hours}
Deepbot
Note: Deepbot will automatically convert variables, such as@stream@
or @user@
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
My total hours in Half-Life 2:
@customapi@[https://decapi.me/steam/hours/76561197997719567/220]
-
My total hours in DayZ, with the 'readable' format:
@customapi@[https://decapi.me/steam/hours/76561197997719567/221100/readable]
-
My total hours in Garry's Mod, with just the number of hours, no trailing text:
@customapi@[https://decapi.me/steam/hours/76561197997719567/4000?format=%s]
-
My total hours in Grand Theft Auto V, with custom text.
+
(plus sign) in the URL is used to represent spaces.:@customapi@[https://decapi.me/steam/hours/76561197997719567/271590?format=Alex+has+been+playing+GTAV+for+%s+hours]
PhantomBot
Note: PhantomBot will automatically convert variables, such as(channelname)
or (touser)
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
My total hours in Half-Life 2:
(customapi https://decapi.me/steam/hours/76561197997719567/220)
-
My total hours in DayZ, with the 'readable' format:
(customapi https://decapi.me/steam/hours/76561197997719567/221100/readable)
-
My total hours in Garry's Mod, with just the number of hours, no trailing text:
(customapi https://decapi.me/steam/hours/76561197997719567/4000?format=%s)
-
My total hours in Grand Theft Auto V, with custom text.
+
(plus sign) in the URL is used to represent spaces.:(customapi https://decapi.me/steam/hours/76561197997719567/271590?format=Alex+has+been+playing+GTAV+for+%s+hours)