Stream Keys

''Here is a breakdown of the new stream key API and how to use it. (Note: This page is a work in progress).''

Stream Key Explanation
''A stream key is generated from within the game settings in the Settings > Game > Stream Key section. A player can use their 64-bit Steam ID, with the in-game Stream Key, to generate a URL allowing access to the API. The URL takes the following form:'' When a player has started playing with the stream key enabled, the page accessed with the URL will display a JSON string with a format similar to the one below:

Sections of the Stream Key
''The stream key is a JSON file with multiple fields, each containing a value corresponding to the status of the player during the most recent update. An example JSON string is shown below.''

Current / Previous
If the run is noted as "current", this means it's currently in progress. If it's noted as "previous", it means it has ended and will no longer be updated. When a run ends, it gets moved from "current" to "previous", and the former "previous" run gets removed.

If there are no available runs, the value will be "null" like in the example above. Runs automatically expire 30 minutes after not being updated.

Health
The current health total of the player.

B-Skin
Indicates if the player is currently using a B-Skin.

or

Character
''Indicates the current character being played. The characters are displayed as numbers from 1 to 15, not including 13. The last two are the secret characters.''

Mutations
''Indicates the current mutations chosen by the player. The player's mutation status is held in a 29-bit binary number, with each bit representing one mutation. A bit set to '1' indicates that the player has that mutation. A bit set to '0' indicates that the player does not have that mutation. ''

The JSON is in the following format: "mutations":"00001000000000000010000001000" The mutations are as follows (with bit positions relative to the first position, big-endian):

Area
The current area of the player.

The JSON is in the following format: "level":1 ''The normal area numbers are the same as they appear in game (1-1, 1-2, 1-3, etc.). The majority of secret levels have an area of 1, as they are considered their own world. Crown vaults seem to have different area values depending on which level you entered them from and whether or not you entered with a crown. (Additional testing is ongoing regarding secret levels and crown vaults.)''

[TODO: Learn more about the loop levels (Campfire/HQ), as well as crown vaults]

Crown
Indicates the current crown of the player.

World
The current world of the player.

The JSON is in the following format: "world":2 The world numbers are the same as they appear in game (World 1 being the Desert, World 2 being the Sewers, etc.), with the exception of the secret levels. [TODO: Complete list of worlds]

Loop
Indicates the current loop number.

The JSON is in the following format: "loops":0

Weapons
Uses two fields to indicate the current weapons held by the player.

The JSON is in the following format: "wepA":17, "wepB":5

The weapon IDs are as follows:

Timestamp
Set to the UNIX timestamp of the time when you started your run. "timestamp":1454012759

Kills
Indicates the number of enemies that the player has killed.

The JSON is in the following format: "kills":158

Type
This field indicates what is the type of the run.

The JSON is in the following format: "type": "normal"

The following values are possible: "normal", "daily", "weekly" and "hard".

Ultra
''This field indicates the ultra mutation of the player. ''

"ultra" : 0

No ultra mutation

"ultra" : 1 or 2

Which ultra mutation was picked (from left to right).

Lasthit
This field indicates the ID of the last enemy that hit the player. (If the player's health is 0, then this would indicate what they died to.)

The JSON is in the following format: "lasthit":7

The enemy IDs are as follows: