Platform

Steam Broadcasting Integration

Connect to Steam Broadcasting for viewer tracking, broadcast state monitoring, and access to Steam Web API features. Perfect for game streamers who want to integrate Steam-specific features into their stream automation.

Overview

FaustBot's Steam integration connects to Steam Broadcasting and the Steam Web API, allowing you to monitor broadcast status, track viewers, and access game and user information. This enables powerful automations for game-focused streams.

Broadcast Monitoring

Detect when your Steam broadcast starts and ends automatically.

Viewer Tracking

Track viewer count changes and individual join/leave events.

User Information

Look up Steam user profiles including level and game library.

Game Details

Get information about any Steam game including player counts.

Steam Broadcasting

Steam Broadcasting is built into the Steam client and allows you to broadcast your gameplay directly to Steam. FaustBot monitors your broadcast status and can trigger actions based on broadcast events.

Setup

Setting up Steam integration requires authenticating with Steam and optionally providing a Steam Web API key for enhanced features.

1

Open Steam Settings

Click Steam in the FaustBot sidebar to open the Steam integration page.

2

Ensure Steam is Running

Make sure the Steam client is running and you are logged in. FaustBot connects through the local Steam client for broadcast monitoring.

3

Authenticate with Steam

Click Sign in with Steam to authenticate. This allows FaustBot to access your Steam profile and broadcast status.

4

Connect to Steam

After authentication, click Connect to establish the connection. FaustBot will begin monitoring your Steam account for broadcast events.

Steam Web API Key (Optional)

For enhanced features like detailed user lookups and game information, you can add a Steam Web API key. Get one free from the Steam Developer Portal.

Available Triggers

FaustBot can respond to the following Steam Broadcasting events:

Broadcast Events

Broadcast Started Fires when you start a Steam broadcast
Broadcast Ended Fires when your Steam broadcast ends

Viewer Events

Viewer Joined Fires when a viewer joins your broadcast
Viewer Left Fires when a viewer leaves your broadcast
Viewer Count Changed Fires when the viewer count changes

Effects

The Steam integration provides the following effects for use in actions:

Get Viewer Count

Get the current broadcast viewer count and store it in a variable.

Get Steam User Info

Look up a Steam user's profile by Steam ID.

Get Game Info

Get details about a Steam game by App ID.

Get Game Player Count

Get the current player count for a Steam game.

Provided Actions

The Steam plugin also registers these actions that can be triggered:

  • steam.sendMessage - Send a message (requires Steamworks SDK)
  • steam.startBroadcast - Start broadcasting
  • steam.stopBroadcast - Stop broadcasting

Variables

The following variables are available in Steam trigger events:

VariableDescriptionTriggers
%steamId%Your Steam ID (64-bit)All
%personaName%Steam display nameAll
%viewerCount%Current viewer countViewer Count Changed
%previousCount%Previous viewer countViewer Count Changed
%viewerSteamId%Steam ID of the viewerViewer Joined/Left
%viewerPersonaName%Display name of the viewerViewer Joined/Left
%isBroadcasting%Whether currently broadcastingAll
%broadcastUrl%URL to watch your broadcastBroadcast Started

Example Use Cases

Multi-Platform Viewer Counter

Combine Steam viewer count with Twitch and YouTube viewers to display a total viewer count across all platforms. Update an OBS text source in real-time as viewers join or leave any platform.

Broadcast Start Notifications

When you start a Steam broadcast, automatically post to Discord with a link to your Steam profile. Show a "Live on Steam" badge overlay in OBS.

Viewer Welcome Messages

Welcome Steam viewers by their persona name when they join your broadcast. Look up their Steam level for VIP treatment of high-level users.

Game Information Overlay

Display current game information in your stream overlay, including the game name, current player count globally, and your own playtime statistics.

Viewer Milestone Celebrations

Trigger special effects when you hit viewer milestones on Steam Broadcasting. Play sounds, show animations, and thank your Steam community.

Scripting API

Access Steam features from your scripts using the CPH API:

Viewer Count Tracking

React to Steam broadcast viewer changes
# React to Steam broadcast viewer changes
def Execute():
    viewers = int(args["viewerCount"])
    previous = int(args.get("previousCount", 0))

    # Celebrate viewer milestones
    milestones = [10, 25, 50, 100, 250, 500]
    for milestone in milestones:
        if previous < milestone <= viewers:
            CPH.RunAction(f"Milestone &#123;milestone&#125;")
            CPH.ObsShowSource("Scenes", "Celebration")
            break

    # Update overlay with viewer count
    CPH.SetGlobalVar("steamViewers", viewers)

    return True

Game Information

Get and display Steam game information
# Get and display Steam game information
def Execute():
    app_id = args.get("appId", "730")  # Default to CS2

    # Get game details from Steam API
    game_info = CPH.SteamGetGameInfo(app_id)

    if game_info:
        CPH.LogInfo(f"Game: &#123;game_info['name']&#125;")
        CPH.LogInfo(f"Players: &#123;game_info['current_players']&#125;")

        # Update OBS text source with game info
        CPH.ObsSetText("Game Info",
            f"Now Playing: &#123;game_info['name']&#125;")

    return True

Broadcast State

Handle Steam broadcast start and end events
# Handle Steam broadcast start/end events
def Execute():
    event = args.get("triggerId", "")

    if "broadcastStarted" in event:
        # Broadcast just started
        CPH.LogInfo("Steam broadcast started!")

        # Notify Discord
        CPH.DiscordPostWebhook("stream-alerts",
            "I'm now live on Steam Broadcasting!")

        # Update OBS
        CPH.ObsShowSource("Overlays", "Steam Live Badge")

    elif "broadcastEnded" in event:
        # Broadcast ended
        CPH.LogInfo("Steam broadcast ended")

        # Hide overlay
        CPH.ObsHideSource("Overlays", "Steam Live Badge")

        # Post summary to Discord
        viewers = args.get("maxViewers", 0)
        CPH.DiscordPostWebhook("stream-alerts",
            f"Stream ended! Peak viewers: &#123;viewers&#125;")

    return True

User Information

Welcome viewers with Steam profile info
# Welcome Steam viewers with their profile info
def Execute():
    steam_id = args["steamId"]
    persona = args["personaName"]

    # Log the join
    CPH.LogInfo(f"&#123;persona&#125; joined the broadcast!")

    # Get additional user info
    user_info = CPH.SteamGetUserInfo(steam_id)
    if user_info:
        level = user_info.get("level", 0)
        games = user_info.get("games_owned", 0)

        # Special welcome for high-level users
        if level >= 50:
            CPH.SendMessage(f"Welcome &#123;persona&#125;! Steam Level &#123;level&#125;!")
        else:
            CPH.SendMessage(f"Welcome to the stream, &#123;persona&#125;!")

    return True

See the Scripting Guide for the complete API reference.