Skip to content

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.

Screenshot of SteamID.co, showing my Steam profile with Steam 64 ID highlighted

The "app ID" of a Steam game can be found in the URL of the game's store page.
For example:

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.
Screenshot of Steam privacy settings, highlighting Game Details

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 return 1 day, 12 hours.
    • This is simply added at the end of the URL as literally /readable, see examples below for usage.

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.
  • 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.
    • 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

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.

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.

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.

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.

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.

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.

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.