Coder Social home page Coder Social logo

remotecontroldocs's Introduction

As of April 2015, Steam Remote Control has been removed from the Steam client, so don't expect any of this to work. This repository will keep existing for historic purposes, and just in case if remote control comes back.

Steam Remote API Documentation

Introduction

Documentation for the Steam Remote Control API, first documented by SteamDB back in October 2013. They later released another blogpost with more information and a link to a repository providing some more functionality than that which is in the headsDown.html file provided with Steam as of December 19th.

Credit mostly goes to the SteamDB guys for this, they did all the leg-work. just extracted the information from their SteamRemoteClient Tool and made a nice documentation out of it for my own reference and for the reference of others.

Contributions Welcome!

If you find an error, want to add something I missed or simply want to add a client library just submit a pull request! Or if you know something is wrong but don't know how to fix it, throw up an issue!

Table of Contents

Overview

Enabling Remote Control

The remote control has to be enabled in Big Picture's settings.

Formats

The base URL for all API requests is https://<your_steam_client_ip>:27037/steam

Data is sent as GET or POST payloads, and returned as JSON.

Errors

Supplying incorrect payload data or using an invalid API call will result in a HTTP 404 Error Code being returned.

Success Response

Unless otherwise stated, it can be assumed that each API call simply returns a JSON response of the following on a successful call:

{
    "success": true
}

Authentication

The first request you make to the API while in Big Picture will prompt you to authorise the remote client by its device token. Every API request requires the passing of at least a device token as GET, POST or COOKIE data and will therefore not be included in the documentation beyond the below as it assumed you are already including these details appropriately for each request.

Check Authorization

GET /steam/authorized/

Sample Responses

Authorized

{
   "success": true,
   "data":
   {
       "tenfoot": 0
   }
}

Not Authorized

{
   "success": false,
   "error": "authorization_needs_prompt"
}

Authorization Request

POST /steam/authorization/

Authorization Request Parameters

Name Required? Type Description
device_name optional string Device Name as it will appear in the Steam Big Picture prompt during authorisation. "Unkown Device" used if not supplied.
device_token required string Device Token used to authorise your client with Steam. This can be generated locally but must be the same for each request (or authorisation will be required again). Minimum length of 8 characters.

Buttons

POST /steam/button/:button/

Simulates the pressing of controller buttons within Steam Big Picture. The buttons are based on an Xbox 360 Gamepad, whether this will change in the future to better reflect the official Steam Controller is unknown.

Valid Buttons

The button identifier should be used in place of :button in the POST request above.

Button Identifier
Guide/Overlay guide
Left left
Right right
Up up
Down down
A a
B b
X x
Y y
Right Trigger rtrigger
Left Trigger ltrigger

Mouse

Used to control the cursor within Steam Big Picture and simulate Mouse Button presses.

Mouse Movement

POST /steam/mouse/move

Moves the Big Picture cursor x/y distance relative to its current position.

Parameters

Name Required? Type Description
delta_x required int Distance to move the mouse on the x-axis
delta_y required int Distance to move the mouse on the y-axis

Mouse Buttons

POST /steam/mouse/click

Simulates a mouse click in Steam Big Picture.

Parameters

Name Required? Type Description
button required string The mouse button to simulate a press for, currently tested: mouse_left

Keyboard

Simulates keyboard functionality within Steam Big Picture.

Keys

POST /steam/keyboard/key/

Simulates the key press of functional keys. Cannot be used for typing, this is what Sequences are for. Rather this can be used to simulate key presses such as enter/return (for sending messages), backspace, space, the F1-12 keys, etc. Only those that provide some functional use are listed in the table below. If any are missed, please feel free to add them.

Key Table

Identifier Key Where? Description
key_enter Enter/Return Anywhere Simulates pressing enter, most likely use is to send a message after entering it using a [Sequence](#sequences) when no controller is plugged in (A button in API does not send a message with no controller connected, though this may just be a bug and fixed in the future).
key_backspace Backspace Input Box Simulates backspace, useful for deleting after sending a sequence.
key_end End Input Box Goes to end of the contents of a text input.
key_home Home Input Box Goes to the beginning of a text input.
key_f1-12 F keys (1-12) Anywhere Presses the specifies F key (provide a number between 1 and 12)
key_escape Escape Anywhere Works the same as the B button for the most part, goes back to the previous screen.

Parameters

Name Required? Type Description
name required string The key name from the above table to pass to Big Picture (example: key_enter

Sequences

POST /steam/keyboard/sequence/

Accepts a string of characters as a POST field and outputs it as a string of characters in the currently selected text input within Steam Big Picture.

Parameters

Name Required? Type Description
sequence required string The string of unicode characters to enter into the currently selected input field.

Games

Enables the browsing of the currently logged in user's game library and the starting up of games within Steam Big Picture.

List Games

GET /steam/games/

Returns a list of all available games in the currently logged in user's library. Each key represents a Steam App ID.

Sample Response

{
    "success": true,
    "data": {
        "3483": {
            "name": "Peggle Extreme",
            "installed": 1,
            "update_running": 0,
            "update_paused": 0,
            "bytes_downloaded": 14690192,
            "bytes_needed": 14690192,
            "bytes_per_second": 0,
            "type": "game",
            "icon": "http://media.steampowered.com/steamcommunity/public/images/apps/3483/427a98a549c3813e13b4062300709000599817b0.jpg",
            "logo": "http://media.steampowered.com/steamcommunity/public/images/apps/3483/4b8f3d8f7f94cc5ca420a8586c8dd903edacce12.jpg",
            "current_disk_bytes": 23356380,
            "estimated_disk_bytes": 23356380,
            "minutes_played": {
                "forever": 47,
                "last_two_weeks": 46
            },
            "last_played_at": 1387758040
        }
    }
}

Run Game

POST /steam/games/:appid/run

Runs the game corresponding to the supplied App ID (if it's installed). If the game isn't installed, it will be installed and a second request to play it must be called once installation has completed in order to run the game.

Music

Action

POST /steam/music/:action/

Valid Actions

The action identifier should be used in place of :action in the POST request above.

Action Identifier
Guide/Play play
Pause pause
Next next
Previous previous

Volume

POST|GET /steam/music/volume/

Parameters

Name Required? Type Description
volume optional double Decimal point value between 0 and 1, where 0 is muted and 1 is max volume.

Mode

POST /steam/music/mode/

Used to set the current music modes.

Parameters

Name Required? Type Description
looped optional bool (0|1) Enable or disable looping mode
shuffled optional bool (0|1) Enable or disable shuffled mode

Sample Response

{
   "success": true,
   "data":
   {
       "looped": 0,
       "shuffled": 0
   }
}

Info

GET /steam/music/

Sample Response

{
   "success": true,
   "data":
   {
       "playback":
       {
           "status": "playing",
           "looped": 0,
           "shuffled": 0,
           "volume": 0.75,
           "queue_count": 1
       },
       "current":
       {
           "artist": "Darude",
           "album": "Sandstorm",
           "track": "Sandstorm"
       }
   }
}

Spaces

'Spaces' in Steam Big Picture refer to different sections of the Big Picture client. Currently only a few spaces have been implemented.

Known Space Mappings

Name Identifier Description
Library library Currently the default space and associated with the store, game library and community sections.
Friends friends The space from where you can send and receive messages and interact with your friends list.
Web Browser webbrowser The Steam Big Picture web browser.

Current Space

GET /steam/space/

Gets the currently active Space from Big Picture. Refer to the mappings table above for more information.

Sample Response

{
    "success": true,
    "data": { 
        "space": "library"
    }
}

Change Space

POST /steam/space/

Changes the currently active Space in Big Picture.

Parameters

Name Required? Type Description
space required string The space identifier to navigate to. Refer to the mappings table above.

State

Used to get the current state of Steam

GET /steam/state/

State Request Parameters

Name Required? Type Description
long_poll optional bool Will cause the request to return only when the state has changed
session_name optional string Unknown

Sample Response

{
   "success": true,
   "data":
   {
       "tenfoot": 1,
       "space": "library",
       "music":
       {
           "playback":
           {
               "status": "paused",
               "looped": 0,
               "shuffled": 0,
               "volume": 0.5,
               "queue_count": 1
           },
           "current":
           {
               "artist": "Darude",
               "album": "Sandstorm",
               "track": "Sandstorm"
           }
       }
   }
}

Streaming

Request Stream

POST /steam/stream/

Sample Response

{
   "success": true,
   "data":
   {
       "stream_port": 27031,
       "auth_token": "fb3b606ba869c9834632c2d9e12d5c94968220d1e9b1397f0bf7c84b330a802f"
   }
}

UI

Tenfoot

POST /ui/tenfoot/

Used to launch the tenfoot interface

Client Libraries

Javascript

Primarily made for use with the RemoteUI.html tool (included in the repository), but for non-local access can be easily modified. It's worth noting that the API does not provide an Access-Control-Allow-Origin header, let alone one with a wildcard value, so most browsers won't work with it from a different origin without disabling some security features. JSONP doesn't support POST requests, so that option is out the window too.

======

If you have a library, please do add it above under the necessary language heading (if the language isn't there, add it)!

remotecontroldocs's People

Contributors

devinwatson avatar xpaw avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.