Starship Horizons
Log In
☰
Knowledge Base›Web API Live State

Web API Live State

These endpoints read the running session: what state the server is in, the mission being played, and the ships in it. All of them are GET and need no token. Each answers with the world as it is at the moment the request is served, and a session with nothing loaded answers with empty results. For the basics — the port, paths, the token — see Web API.

The endpoints

RequestReturns
GET /api/statusThe session's state and mode, the mission name and a player ship's name.
GET /api/missionThe mission being played: its state, clock, objectives and progress. {} when there is none.
GET /api/vesselsEvery vessel, missile and astral object in the session.
GET /api/vessels/{id}One vessel, by its numeric id.
GET /api/vessel-contacts/{id}What that vessel's sensors show.
GET /api/player-vesselsThe player ships, with their roles, objectives and waypoints.
GET /api/player-vessels/{slot}One player ship, by its place in the mission's player list (the first is 1).
GET /api/mission-bots or GET /api/mission-bots/{mission}The bots a Game Master may seat: for the mission staged in pre-flight (or else the one running), or for the mission named.
GET /api/metricsWhat the last server update cost, section by section.
GET /api/users or GET /api/users/{account}The server's registry of players: everyone seen, or one account with its devices.

status

GET /api/status
{"State":"Playing","Mode":"Mission","Mission":"Fighter Escort","Players":"Horizons"}
FieldMeaning
StateIdle, Loading, Loaded, Playing, Paused, Unloading or Offline.
ModeOpen, Mission or Replay.
MissionThe name of the mission loaded, or empty.
PlayersDespite the name, a single ship's name: the session's player vessel. With several player ships it is one of them; use player-vessels for all.

This is the cheapest call there is. Poll it to know when a game starts and stops, and ask for more only while State is Playing.

mission

FieldMeaning
ID, NameWhich mission.
StateIdle, Loading, Loaded, Starting, Prologue, Running, Paused, Epilogue or Ended.
StartedWhen it started, in UTC (2026-10-18T19:04:11Z).
TimerThe time limit in minutes; 0 means none.
ElapsedTimeSeconds played.
TimeRemainingMilliseconds left under the time limit.
Complete, Success, Grade, ProgressHow it is going, and how it went.
Objectives, TotalObjectives, TotalWaypointsThe objectives with their state, and the counts.
Groups, Options, Readout, VictorThe mission's named groups, the options chosen at launch, its readout and, in a competitive mission, who won.
Now, TimeFactorThe in-game clock and how fast it runs.

Timer, ElapsedTime and TimeRemaining are sent as strings, so convert them before doing arithmetic.

vessels

The list holds every vessel, missile and astral object in the session, all maps included. Vessels carry the full set of fields below. Missiles and astral objects (planets, nebulae and the like) carry shorter sets of their own: every entry has ID, BaseType, Name and Position, and a missile's or a planet's Integrity is a fraction from 0 to 1 rather than hull points. Asking for one id returns only vessels.

FieldMeaning
IDThe object's id in this session. It is the id the other endpoints take.
Name, Class, FactionWhat it is called, its vessel class and its side.
BaseType, SubType, ClassificationWhat kind of object it is. Classification is the one to use for what it looks like (a station, a fighter); a station's BaseType is Vessel.
IsPlayerTrue for a crewed player ship.
StateSpawning, Alive, DeathThrows or Dead.
Integrity, MaxIntegrity, ShieldsHull points, the maximum, and shield strength.
Energy, EnergyRequested, MaxEnergyPower produced, power asked for, and the most it can make.
Speed, Throttle, MaxSpeed, VelocityHow it is moving.
Map, Location, PlanetWhere it is: the map, the star system, the planet it is near.
Position, Orientation, AltitudeWhere exactly, and which way it faces.
MapPosition, StarPosition, SystemPosition, GalacticPositionThe same object placed at coarser scales.
Alert, CurrentTargetIDIts alert level and what it is targeting.
Behavior, Maneuver, TaskWhat it is doing. Task names an NPC's current task.
TagsIts tags, as one comma-separated string.
Score, Lives, CreditsScore keeping, respawns left, money.
SectionsArmor and structure per section, on a hull that has sections; otherwise null.
TThe server's simulation clock, in milliseconds, when this was built. Use it to tell two readings apart.

Position is not in the engine's axis order. Position (and SeekPosition) put height last: X and Y are the horizontal plane and Z is up. A tool that reads Y as height is reading range. The coarse positions are not swapped.

Positions are in the units of the place the object is in: meters near a planet, so 1,000 to a kilometer, and larger units at the scale of a star system or the galaxy map.

vessel-contacts

GET /api/vessel-contacts/12

The contact list of vessel 12: everything its sensors currently show, nearest first, in the same form its crew's consoles receive. Each contact has ID, Name, Class, Faction, BaseType, Classification, Position, Orientation, Velocity, Integrity, Shields, Identified, Scanned, IFF, Tags and a few more. A contact the ship has not identified is masked the way the crew sees it, without its real name or faction.

The answer is [] while the ship is in FTL, and {} for an id that is not a vessel.

For a Game Master this is a quick way to answer "why can't they see it?": compare /api/vessels, which is everything, with the contacts of the ship that should see it.

player-vessels

One entry per player ship, with the crew-side state the consoles use:

FieldMeaning
CommandIDThe vessel's id, for /api/vessels/{id}.
VesselInfoThe vessel's own record, as a JSON string. Parse it a second time.
Score, Deaths, RespawnsHow the ship is doing.
RolesInUseWhich stations are crewed.
Objectives, Waypoints, MissionWaypointsWhat this crew has been given.

metrics

What the last update of the simulation cost, in milliseconds: tick_ms for the whole of it, then players_ms, npcs_ms, projectiles_ms, events_ms and mission_ms. A collision block breaks the collision pass down, and the totals of vessels, astral objects, projectiles and missiles say how much there is in play.

Use it when a session feels slow. Sample it a few times rather than once: one update is noise. Within the collision block, faults counts every collision check that failed since the server started; anything but a steady number is worth a look in debug.log.

users

The registry of players the server remembers between sessions. /api/users answers { "Users": [...] }, newest seen first, with each account's AccountID, CallSign, name, rank, faction, Blocked and Trusted flags, when it was first and last seen, how many devices and missions it has, and whether it is online. /api/users/{account} adds the account's devices and its seat in each mission. An operator can correct or remove an entry; see Web API Writes.

A worked example

A small "who is winning" board for a competitive mission, polling once a second:

import json, time, urllib.request

def get(path):
    with urllib.request.urlopen("http://localhost:1864/api/" + path) as reply:
        body = reply.read().decode("utf-8")
        return json.loads(body) if body.strip() else None

while True:
    status = get("status")
    if status and status["State"] == "Playing":
        ships = [json.loads(p["VesselInfo"]) for p in get("player-vessels") or []]
        for ship in sorted(ships, key=lambda s: s.get("Score", 0), reverse=True):
            print(f'{ship.get("Name", "?"):20} {ship.get("Score", 0):8} {ship.get("Lives", "")}')
        print()
    time.sleep(1)
Last updated 19 October 2026