ECStats_api_docs
Official documentation for Echo VR's unofficial Combat Stat Tracker.
Summary
Echo Combat Stats (ECStats) has a public API available from their website. If a user query is http://ecranked.ddns.net/user/Timemaster111/stats
then the API query is http://ecranked.ddns.net/user/Timemaster111/stats.json
.
Similarly, a game/replay query is http://ecranked.ddns.net/replay/5D833913-11FA-4A1E-8E33-4CB9A173C201
and the API is from http://ecranked.ddns.net/replay/5D833913-11FA-4A1E-8E33-4CB9A173C201.json
.
API Endpoints
The endpoints mirror the website, so the user endpoints are /user/<USER>/stats.json
and the game/replay enpoints are /replay/<REPLAY-ID>.json
.
GET /user
Example Response
{ "about_string": "Developer of ECRanked", "average_speed": 1.6421, "average_ping": 64.626, "percent_stopped": 0.291188, "percent_upsidedown": 0.023962, "total_games": 50, "total_deaths": 344, "average_deaths": 6.88, "discord_name": "BiffBish", "discord_pfp": "https://cdn.discordapp.com/avatars/301343234108424192/788a06ff1b8e6e324f879948081376e2.png", "loadout": { "0": 0.000594, "1": 0.000045, "2": 0.0, ... "62": 0.400121, "63": 0.0 }, "top_loadout": [ [ "33", 0.396773 ], [ "35", 0.291986 ], [60 more...], [ "62", 0.0 ], [ "63", 0.0 ] ] }
about_string
The string that is used in the about me section.
- null - There is no about me string
average_speed
The average speed of the player measured in meters per second.
average_ping
The average ping of the player measured in milliseconds.
percent_stopped
The percentage of time the player is "stopped".
percent_upsidedown
The percentage of time the player is "upside-down".
total_games
The total number of games the player has played in.
total_deaths
The total number of times the player has died.
average_deaths
The average number of deaths per game.
discord_name
The discord username of the person if they have linked their discord account.
- null - The discord is not linked
discord_pfp
The discord profile picture of the person if they have linked their discord account.
- null - The discord is not linked
loadout{}
A dictionary of loadouts and percentage of frames they were in used in. The loadouts are stored via numbers in a bitmap
top_loadout[]
A list of the persons top loadouts sorted from greatest to lowest
top_loadout.[0]
The loadout number in string form.
top_loadout.[1]
The percentage of time it has been used.
GET /replay
Example Response
{ "frames": 19029, "start_time": "2021-09-12 20:20:19.02", "end_time": "2021-09-12 20:24:57.34", "match_length": 278, "framerate": 68.44964028776978, "map": "surge", "players": [ { "team": 0, "playerid": 0, "name": "GE0-_", "userid": 2719646711436186, "number": 22, "level": 9, "startFrame": 0, "stats": { "total_frames": 19029, "total_ping": 1797145, "total_speed": 42329.234783699496, "frames_speed": 15530, "total_upsidedown": 10640, "frames_upsidedown": 15530, "total_stopped": 5289, "frames_stopped": 15530, "total_deaths": 3, "loadout": { "0": 1012, "1": 18017, ... "62": 0, "63": 0 }, "frames_loadout": 19029 } }, [players.....] ] }
frames
Total number of frames the bot recorded from the game.
start_time
The time the bot started recording in GMT/UTC in ISO format.
end_time
The time the bot stopped recording in GMT/UTC in ISO format.
match_length
Number of seconds the match was recorded for.
framerate
The frames per second the bot recorded at.
map
The map the game was played on.
players
Players that were in the game.
players{}.team
Team the player was on.
- 0 - Team Blue(?)
- 1 - Team Orange(?)
- 2 - Spectator
players[].playerid
The player ID of the player.
- unique per game
players[].name
The name of the player.
players[].userid
The Oculus ID of the player.
players[].number
The number of the player.
- not unique
players[].level
The combat level of the player.
players[].startFrame
The frame the player joined the match.
players[].stats
Dictionary of statistics for the player for that game
players[].stats{}.total_frames
Total number of frames the player was in the game.
players[].stats{}.total_ping
Players ping added up for all total frames.
players[].stats{}.total_speed
Players speed (m/s) added up for tracked frames.
players[].stats{}.frames_speed
Number of frames the player is not in the spawn room and not traveling under 1m/s.
players[].stats{}.total_upsidedown
Number of frames the players head is flipped upside-down while tracked
players[].stats{}.frames_upsidedown
Number of frames the player is not in the spawn room
players[].stats{}.total_stopped
Number of frames the player is traveling under 1m/s while tracked
players[].stats{}.frames_stopped
Number of frames the player is not in the spawn room
players[].stats{}.total_deaths
Number of deaths of the player
players[].stats{}.loadout
A dictionary of loadouts and how many frames they were in use. The loadouts are stored via numbers in a bitmap
Responses
Success
On a success the API will return a JSON with the data.
Fail
On a fail the API will return an error message along with a 404 status code. The error message is There is no user with that username
for /user and session id not found
for /replay
Concepts
Bitmaps
The loadouts are stored as bitmaps.
A bitmap is a set of bits where each bit or section of bits represents a value.
In the case of this API, the bitmap translates as follows:
X | 00 | 00 | 00 |
---|---|---|---|
representation | weapon | ordnance | tac mod |
00 | Pulsar | Detonator | Repair Matrix |
01 | Nova | Stun Field | Threat Scanner |
10 | Comet | Arc Mine | Energy Barrier |
11 | Meteor | Instant Repair | Phase Shift |
So a code of 010011 would be a Nova, Detonator and Phase Shift.
Total and Frames
Total** refers to the total number of frames in which the stat (*) has been tracked, and Frames** is the number of frames this stat is true for.