Skip to content

Health & Common Patterns

Craft exposes a health check endpoint at two paths:

GET /health
GET /api/health
{
"status": "ok",
"service": "craft-api"
}

The /health path is intended for internal health checks (Docker health probes, load balancers). The /api/health path is accessible through the Caddy reverse proxy alongside the rest of the API.


The following conventions apply across all Craft API endpoints.

All API endpoints are prefixed with /api/:

https://space.warehack.ing/api/satellites
https://space.warehack.ing/api/search?q=ISS
https://space.warehack.ing/api/passes?sat=25544

WebSocket endpoints use the /ws/ prefix:

wss://space.warehack.ing/ws/tracking/satellite/25544
wss://space.warehack.ing/ws/rotor/1

All endpoints return JSON. List endpoints follow a consistent envelope pattern:

{
"items": [...],
"count": 42
}

The collection field name varies by resource (e.g. satellites, launches, predictions) but count is always present.

Endpoints that return lists support limit and offset parameters:

ParameterTypeDefaultDescription
limitintvariesMax results to return
offsetint0Number of results to skip

Errors follow standard HTTP status codes with a JSON detail message:

{
"detail": "Satellite 99999 not found"
}
StatusMeaning
400Invalid request (bad parameters, target below horizon)
404Resource not found
409Conflict (duplicate name, operation blocked by state)
502Upstream service error (embedding service, rotctld)
503Service unavailable (feature not configured)

Several endpoints trigger background data refreshes. These always return immediately with a status message:

{
"status": "refreshing",
"message": "Description of what started"
}

Background refresh endpoints:

EndpointRefreshes
POST /api/catalog/tle/updateTLE data from CelesTrak
POST /api/comets/refreshComet data from MPC
POST /api/launches/refreshLaunch data from Launch Library 2
POST /api/reentry/refreshReentry predictions from Space-Track
POST /api/weather/refreshSpace weather from NOAA SWPC
POST /api/atmosphere/refreshLocal atmosphere from Open-Meteo
POST /api/events/refreshEvents (conjunctions, NEOs, crew)
POST /api/sondes/refreshRadiosonde data from SondeHub
POST /api/aircraft/refreshADS-B data from OpenSky Network

The API allows all origins (*) for cross-origin requests. All HTTP methods and headers are permitted.

All timestamps are returned in ISO 8601 format with UTC timezone:

2026-02-14T22:30:00Z
  • Azimuth: 0-360 degrees, measured clockwise from north
  • Elevation/Altitude: -90 to +90 degrees, measured from the horizon
  • Right Ascension: In hours (0-24) for position endpoints
  • Declination: In degrees (-90 to +90)
  • Latitude/Longitude: Decimal degrees (WGS84)