Sansar Maps docs · API

Sansar Maps · reference

The Sansar Maps API

Where anything in the sky is, for any place on Earth at any moment, and what is worth seeing tonight: one small local server answers in JSON, and the same library runs in your browser and in Node.

Quick start

Start the server (Node 22 or later; nothing to install) and ask it where Saturn is:

node server.js                 # → http://localhost:8080
curl 'http://localhost:8080/api/position?target=saturn&lat=51.48&lon=0'

Every route answers GET with query parameters (a few also take JSON by POST). Add &pretty to indent the JSON. Responses carry Access-Control-Allow-Origin: *, so a page or app on another port or host can call the API directly. From JavaScript:

const r = await fetch('http://localhost:8080/api/tonight?lat=51.48&lon=0&tz=Europe/London');
const tonight = await r.json();
console.log(tonight.darkness, tonight.planets.filter((p) => p.visible).map((p) => p.name));

Or skip the server and use the library in the page or in Node (same answers, computed locally):

import * as Sky from 'http://localhost:8080/sky/positions.js';   // or './public/sky/positions.js' in Node
Sky.position('saturn', { lat: 51.48, lon: 0 });   // { altitude, azimuth, direction, magnitude, constellation, … }

Place, time and units

Responses, errors and caching

Offline

Each route below carries two labels:

SKYMAP_OFFLINE takes 1, true, yes or on; any other value, 0 included, means off. With it on, /api/guide/status reports the deeper answers as unavailable and web push sends nothing.

All routes

Every route this server registers, with its parameters, a real example (the responses are real output, trimmed: long arrays end in “… n more”, long numbers are shortened), its errors, its caching and how it behaves offline. /api lists them at run time.

RouteMethodWhat
/apiGETThe API’s name, version, where the docs are, and every endpoint this server registers (route modules included).
/api/healthGETIs the server up, and how old are its satellite elements.
/api/positionGETWhere one object is: apparent altitude and azimuth, RA/Dec (J2000 and of date), distance, brightness, size, phase, constellation and a unit vector.
/api/positionsGETThe Sun, Moon and planets at once, optionally with the brightest named stars, optionally only those above the horizon.
/api/rise-setGETRise, transit (highest point) and set in a window after time.
/api/sunGETThe local day’s sunrise, sunset, solar noon and civil, nautical and astronomical twilight, plus where the Sun is at time.
/api/moonGETThe Moon’s phase, illumination, age and the next new, first-quarter, full and last-quarter Moons; with a place, also its position and rise and set.
/api/tonightGETThe coming night in one answer: twilight times, the dark window, the Moon, the planets worth seeing (when and where), meteor showers, the next eclipses and the visible…
/api/lightingGETSunlight, moonlight and skylight for a 3D scene or smart lights: directions (ENU and three.js axes, y up, north −z), colours after atmospheric extinction, and illuminance…
/api/meteor-showersGETMeteor showers active at time, with their peak, rate (ZHR), speed and the radiant where it is that night; all is the whole IMO working list the app uses.
/api/eclipsesGETThe next lunar eclipse (and whether it is visible from here) and the next solar eclipse seen from this place, with how much of the Sun is covered.
/api/nightGETThe night’s timeline: sunset to sunrise (or a 24-hour window in polar day and night), the twilight stages, the dark window, the darkest moment, the Moon up and down, and…
/api/sky-brightnessGETHow bright the sky is toward a direction (mag/arcsec² and cd/m²) and the faintest star the eye can see there, from natural airglow, light pollution, twilight and moonlight.
/api/searchGETSky objects by any name in any of the 38 name languages, nicknames, designations and misspellings; also meteor showers, satellites (by name or NORAD number), asterisms…
/api/placesGETOffline place search over 34,000 towns and cities (GeoNames), or the largest place in a time zone (the app’s first guess of where you are, with no permission prompt).
/api/places/nearestGETReverse lookup: the nearest town to a point, its distance and its time zone.
/api/satellites/groupsGETThe CelesTrak groups this server will fetch.
/api/satellites/elementsGETOrbital elements (OMM JSON, as CelesTrak publishes them) for the browser’s own SGP4 (satellites.js loadSatellites()).
/api/satellites/overheadGETEvery satellite of the groups above the horizon now, with whether it is sunlit and visible to the eye, and its magnitude.
/api/satellites/passesGETPass predictions: rise, culmination and set (and the visible part), with the maximum altitude and magnitude.
/api/satellites/positionGETOne satellite now: where it is in your sky, its height, ground point, range, speed, whether it is sunlit and visible, and its magnitude.
/api/satellites/bright-passesGETThe passes worth going out for: the ISS, Tiangong, Hubble, other bright satellites and fresh Starlink trains, each with the visible part, a worth-it score and reasons, and…
/api/cometsGETComets brighter than a magnitude at time, brightest first, from the IAU Minor Planet Center’s elements.
/api/comets/elementsGETThe MPC element lines of the comets that are bright around now (six months back to a year ahead), for comets.js loadComets() in the browser.
/api/cometGETOne comet’s position, like /api/position, with its orbit, distance from the Sun and an estimated coma size.
/api/eventsGETThe events calendar: Moon phases, conjunctions and occultations, oppositions and elongations, meteor showers with tonight’s conditions, lunar and solar eclipses with…
/api/planGET, POSTTonight’s observing plan: the night’s timeline hour by hour, the conditions (darkness, weather, transparency, seeing, dew), one verdict for the night with its best…
/api/weatherGETThe hourly forecast for observing (cloud at three heights, visibility, humidity and dew point, wind, the jet stream for seeing, aerosols for transparency) from Open-Meteo…
/api/alertsGETWhat is worth an alert in the coming days from here — bright satellite passes, eclipses, close conjunctions and occultations, showers at their peak, bright comets…
/api/gearGETThe gear presets (eyes, binoculars, telescopes, smart telescopes, cameras) with their derived optics; with id, one preset in full (eyepieces with magnification, true field…
/api/gear/viewGETHow a target looks right now through each piece of gear: visible or not, the margin above the limit, what you will see (“bright core”, “faint smudge”), a 0–5 rating and…
/api/alerts/vapidGETThis server’s VAPID public key, for PushManager.subscribe({ applicationServerKey }).
/api/alerts/subscribePOST, DELETEPOST stores a push subscription with what alerts need — the endpoint and its keys, a town-level place (rounded here to 0.1°), the time zone, the alert choices and…
/api/alerts/statusPOSTIs this endpoint subscribed, and what is scheduled for it.
/api/alerts/testPOSTSends one test notification to a subscribed endpoint now.
/api/guide/statusGETWhether this server can answer in more depth (it has ANTHROPIC_API_KEY), and with which model.
/api/guide/answerGETThe guide’s offline engine (the same one the app runs in the browser): a plain-language answer about the sky from here, with what the app would do (fly, point, select)…
/api/guide/askPOST, GETAnswers in more depth, from Claude (Anthropic’s Messages API) through this server, only when it has ANTHROPIC_API_KEY.

Service

GET /api

The API’s name, version, where the docs are, and every endpoint this server registers (route modules included).

With SKYMAP_OFFLINE=1: worksServer cache: None.

Example: GET Run it
curl 'http://localhost:8080/api'
Response · 200
{
  "name": "Sky map positions API",
  "version": "2.0.0",
  "docs": "/docs/",
  "endpoints": [
    "/api/health",
    "/api/position",
    … 35 more
  ]
}

GET /api/health

Is the server up, and how old are its satellite elements.

With SKYMAP_OFFLINE=1: worksServer cache: None.

Example: GET Run it
curl 'http://localhost:8080/api/health'
Response · 200
{
  "ok": true,
  "version": "2.0.0",
  "satellites": {
    "updated": "2026-11-09T16:35:07.412Z",
    "source": "https://celestrak.org/NORAD/elements/gp.php?GROUP=visual&FORMAT=json",
    "count": 156
  }
}

satellites is null when no elements could be loaded at all.

Positions

GET /api/position

Where one object is: apparent altitude and azimuth, RA/Dec (J2000 and of date), distance, brightness, size, phase, constellation and a unit vector. The Sun, Moon, planets and Pluto; any catalogued star by name, Bayer (alpha CMa) or Flamsteed (61 Cyg) designation or HIP number; Messier, NGC and IC objects and their common names; constellations; comets by designation.

With SKYMAP_OFFLINE=1: worksIn the app with no connection: computed in the browserServer cache: None (computed per request; ~1 ms).

ParameterDefaultMeaning
targetrequiredWhat to find: moon, mars, Sirius, alpha CMa, HIP 11767, M31, Pleiades, NGC 7000, Orion, 2P. Also object or body.
latrequiredLatitude in degrees, north positive (−90 to 90).
lonrequiredLongitude in degrees, east positive (−180 to 360).
elevation0Height above sea level in metres (−500 to 9000).
timenowThe moment: ISO 8601 (2026-11-09T21:00:00Z), Unix seconds or milliseconds, or now.
refraction10 for airless (geometric) altitude. altitudeGeometric is always airless.
Example: GET Run it
curl 'http://localhost:8080/api/position?target=saturn&lat=51.48&lon=0&time=2026-11-09T21:00:00Z'
Response · 200
{
  "id": "saturn",
  "name": "Saturn",
  "type": "planet",
  "time": "2026-11-09T21:00:00.000Z",
  "altitude": 39.3919,
  "azimuth": 173.452,
  "altitudeGeometric": 39.3714,
  "direction": "S",
  "aboveHorizon": true,
  "ra": 0.58394,
  "dec": 0.88249,
  "raOfDate": 0.60704,
  "decOfDate": 1.0314,
  "distanceKm": 1290945411,
  "distanceAU": 8.6294,
  "magnitude": 0.44291,
  "angularDiameter": 19.259,
  "constellation": {
    "id": "Cet",
    "name": "Cetus"
  },
  "vector": [0.08813, -0.76778, 0.63462],
  "illumination": 0.99891,
  "phaseAngle": 3.7758,
  "elongation": 141.2206,
  "brightLimbAngle": 243.5297,
  "parallacticAngle": -4.0732,
  "ringTilt": 6.3802
}

Solar-system bodies add distanceKm, distanceAU, angularDiameter (″), illumination, phaseAngle, elongation, brightLimbAngle and parallacticAngle; the Moon adds phase, phaseName, ageDays, libration; Saturn ringTilt; stars hip, spectralType, bv; comets their orbit and coma.

Errors: 400 missing target, lat or lon, or a number out of range; 404 no object by that name. The body is { "error": "…" }.

Error 400: GET (400) Run it
curl 'http://localhost:8080/api/position?lat=51.48&lon=0'
Response · 400
{
  "error": "Missing required parameter \"target\" (e.g. moon, mars, Sirius, M31)"
}
Error 404: GET (404) Run it
curl 'http://localhost:8080/api/position?target=planet-x&lat=51.48&lon=0'
Response · 404
{
  "error": "Unknown sky object: \"planet-x\""
}

GET /api/positions

The Sun, Moon and planets at once, optionally with the brightest named stars, optionally only those above the horizon.

With SKYMAP_OFFLINE=1: worksIn the app with no connection: computed in the browserServer cache: None.

ParameterDefaultMeaning
latrequiredLatitude in degrees, north positive (−90 to 90).
lonrequiredLongitude in degrees, east positive (−180 to 360).
elevation0Height above sea level in metres (−500 to 9000).
timenowThe moment: ISO 8601 (2026-11-09T21:00:00Z), Unix seconds or milliseconds, or now.
stars0Add this many of the brightest named stars (0–300).
aboveHorizon01: only objects above the horizon.
Example: GET Run it
curl 'http://localhost:8080/api/positions?lat=51.48&lon=0&time=2026-11-09T21:00:00Z&aboveHorizon=1&stars=3'
Response · 200
{
  "time": "2026-11-09T21:00:00.000Z",
  "observer": {
    "lat": 51.48,
    "lon": 0,
    "elevation": 0
  },
  "objects": [
    {
      "id": "saturn",
      "name": "Saturn",
      "type": "planet",
      "time": "2026-11-09T21:00:00.000Z",
      "altitude": 39.3919,
      "azimuth": 173.452,
      "altitudeGeometric": 39.3714,
      "direction": "S",
      "aboveHorizon": true,
      "ra": 0.58394,
      "dec": 0.88249,
      "raOfDate": 0.60704,
      "decOfDate": 1.0314,
      "distanceKm": 1290945411,
      "distanceAU": 8.6294,
      "magnitude": 0.44291,
      "angularDiameter": 19.259,
      "constellation": {
        "id": "Cet",
        "name": "Cetus"
      },
      "vector": [0.08813, -0.76778, 0.63462],
      "illumination": 0.99891,
      "phaseAngle": 3.7758,
      "elongation": 141.2206,
      "brightLimbAngle": 243.5297,
      "parallacticAngle": -4.0732,
      "ringTilt": 6.3802
    },
    … 3 more
  ]
}

GET /api/rise-set

Rise, transit (highest point) and set in a window after time. Rise and set use the upper limb and standard refraction for the Sun and Moon, so they match almanacs.

With SKYMAP_OFFLINE=1: worksIn the app with no connection: computed in the browserServer cache: None.

ParameterDefaultMeaning
targetsunAny object /api/position knows.
latrequiredLatitude in degrees, north positive (−90 to 90).
lonrequiredLongitude in degrees, east positive (−180 to 360).
elevation0Height above sea level in metres (−500 to 9000).
timenowThe moment: ISO 8601 (2026-11-09T21:00:00Z), Unix seconds or milliseconds, or now.
hours24Window length in hours (1–744).
Example: GET Run it
curl 'http://localhost:8080/api/rise-set?target=moon&lat=51.48&lon=0&time=2026-11-09T12:00:00Z'
Response · 200
{
  "target": "moon",
  "events": [
    {
      "type": "set",
      "time": "2026-11-09T15:45:49.477Z",
      "azimuth": 231.1618,
      "altitude": -0.20103,
      "direction": "SW"
    },
    {
      "type": "rise",
      "time": "2026-11-10T08:53:45.880Z",
      "azimuth": 132.9868,
      "altitude": -0.20004,
      "direction": "SE"
    }
  ],
  "rise": {
    "type": "rise",
    "time": "2026-11-10T08:53:45.880Z",
    "azimuth": 132.9868,
    "altitude": -0.20004,
    "direction": "SE"
  },
  "transit": null,
  "set": {
    "type": "set",
    "time": "2026-11-09T15:45:49.477Z",
    "azimuth": 231.1618,
    "altitude": -0.20103,
    "direction": "SW"
  },
  "alwaysUp": false,
  "alwaysDown": false
}

alwaysUp / alwaysDown are true when the object never sets or never rises in the window (polar day and night).

Errors: 404 no object by that name. The body is { "error": "…" }.

GET /api/sun

The local day’s sunrise, sunset, solar noon and civil, nautical and astronomical twilight, plus where the Sun is at time.

With SKYMAP_OFFLINE=1: worksIn the app with no connection: computed in the browserServer cache: None.

ParameterDefaultMeaning
latrequiredLatitude in degrees, north positive (−90 to 90).
lonrequiredLongitude in degrees, east positive (−180 to 360).
elevation0Height above sea level in metres (−500 to 9000).
timenowThe moment: ISO 8601 (2026-11-09T21:00:00Z), Unix seconds or milliseconds, or now.
tznearest town’sIANA time zone for local dates and words (Europe/London); also timeZone.
Example: GET Run it
curl 'http://localhost:8080/api/sun?lat=51.48&lon=0&time=2026-11-09T12:00:00Z&tz=Europe/London'
Response · 200
{
  "date": "2026-11-09T00:00:00.000Z",
  "timeZone": "Europe/London",
  "astronomicalDawn": "2026-11-09T05:12:08.035Z",
  "nauticalDawn": "2026-11-09T05:51:09.315Z",
  "civilDawn": "2026-11-09T06:31:17.560Z",
  "sunrise": "2026-11-09T07:07:25.593Z",
  "solarNoon": "2026-11-09T11:43:49.067Z",
  "solarNoonAltitude": 21.6237,
  "sunset": "2026-11-09T16:19:34.305Z",
  "civilDusk": "2026-11-09T16:55:40.693Z",
  "nauticalDusk": "2026-11-09T17:35:46.538Z",
  "astronomicalDusk": "2026-11-09T18:14:44.662Z",
  "dayLengthHours": 9.2024,
  "now": {
    "id": "sun",
    "name": "Sun",
    "type": "star",
    "time": "2026-11-09T12:00:00.000Z",
    "altitude": 21.5293,
    "azimuth": 184.1591,
    "altitudeGeometric": 21.487,
    "direction": "S",
    "aboveHorizon": true,
    "ra": 14.9503,
    "dec": -16.8328,
    "raOfDate": 14.9755,
    "decOfDate": -16.9416,
    "distanceKm": 148189148,
    "distanceAU": 0.99058,
    "magnitude": -26.7626,
    "angularDiameter": 1936.7,
    "constellation": {
      "id": "Lib",
      "name": "Libra"
    },
    "vector": [-0.06747, -0.92778, 0.36698]
  }
}

Times are ISO instants (UTC); date is the local day in timeZone. A missing twilight is null (it never gets that dark, or never that light).

GET /api/moon

The Moon’s phase, illumination, age and the next new, first-quarter, full and last-quarter Moons; with a place, also its position and rise and set.

With SKYMAP_OFFLINE=1: worksIn the app with no connection: computed in the browserServer cache: None.

ParameterDefaultMeaning
timenowThe moment: ISO 8601 (2026-11-09T21:00:00Z), Unix seconds or milliseconds, or now.
lat, lonoptionalAdd position and riseSet for this place.
elevation0Height above sea level in metres (−500 to 9000).
Example: GET Run it
curl 'http://localhost:8080/api/moon?lat=51.48&lon=0&time=2026-11-09T21:00:00Z'
Response · 200 · 90 lines
{
  "time": "2026-11-09T21:00:00.000Z",
  "phase": 0.01833,
  "elongation": 6.5977,
  "illumination": 0.00522,
  "ageDays": 0.5412,
  "name": "Waxing Crescent",
  "nextNewMoon": "2026-12-09T00:52:31.284Z",
  "nextFirstQuarter": "2026-11-17T11:48:27.140Z",
  "nextFullMoon": "2026-11-24T14:54:04.191Z",
  "nextLastQuarter": "2026-12-01T06:09:14.538Z",
  "position": {
    "id": "moon",
    "name": "Moon",
    "type": "moon",
    "time": "2026-11-09T21:00:00.000Z",
    "altitude": -45.3565,
    "azimuth": 290.3385,
    "altitudeGeometric": -45.6785,
    "direction": "WNW",
    "aboveHorizon": false,
    "ra": 15.3013,
    "dec": -24.0124,
    "raOfDate": 15.3277,
    "decOfDate": -24.1112,
    "distanceKm": 403953,
    "distanceAU": 0.0027,
    "magnitude": -4.7214,
    "angularDiameter": 1774.3,
    "constellation": {
      "id": "Lib",
      "name": "Libra"
    },
    "vector": [-0.65888, 0.24423, -0.71149],
    "illumination": 0.00522,
    "phaseAngle": 171.7114,
    "elongation": 8.2709,
    "brightLimbAngle": 326.0687,
    "parallacticAngle": 39.7753,
    "phase": 0.01833,
    "phaseName": "Waxing Crescent",
    "ageDays": 0.5412,
    "libration": {
      "lat": 6.5854,
      "lon": 3.5502
    }
  },
  "riseSet": {
    "events": [
      {
        "type": "rise",
        "time": "2026-11-10T08:53:45.880Z",
        "azimuth": 132.9868,
        "altitude": -0.20004,
        "direction": "SE"
      },
      {
        "type": "transit",
        "time": "2026-11-10T12:36:40.450Z",
        "azimuth": 179.9999,
        "altitude": 12.2747,
        "direction": "S"
      },
      … 1 more
    ],
    "rise": {
      "type": "rise",
      "time": "2026-11-10T08:53:45.880Z",
      "azimuth": 132.9868,
      "altitude": -0.20004,
      "direction": "SE"
    },
    "transit": {
      "type": "transit",
      "time": "2026-11-10T12:36:40.450Z",
      "azimuth": 179.9999,
      "altitude": 12.2747,
      "direction": "S"
    },
    "set": {
      "type": "set",
      "time": "2026-11-10T16:13:47.027Z",
      "azimuth": 225.5443,
      "altitude": -0.19965,
      "direction": "SW"
    },
    "alwaysUp": false,
    "alwaysDown": false
  }
}

GET /api/tonight

The coming night in one answer: twilight times, the dark window, the Moon, the planets worth seeing (when and where), meteor showers, the next eclipses and the visible satellite passes brighter than magnitude 4.5. The home dashboard example is built on it.

With SKYMAP_OFFLINE=1: worksIn the app with no connection: computed in the browserServer cache: Satellite passes are cached in memory per place and 5-minute start.

ParameterDefaultMeaning
latrequiredLatitude in degrees, north positive (−90 to 90).
lonrequiredLongitude in degrees, east positive (−180 to 360).
elevation0Height above sea level in metres (−500 to 9000).
timenowThe moment: ISO 8601 (2026-11-09T21:00:00Z), Unix seconds or milliseconds, or now.
tznearest town’sIANA time zone for local dates and words (Europe/London); also timeZone.
satellites10 leaves out satellite passes.
passLimit20At most this many passes (1–100).
minAltitude10Passes must climb this high (degrees).
groupsstations,visualCelesTrak groups to load (see /api/satellites/groups).
Example: GET Run it
curl 'http://localhost:8080/api/tonight?lat=51.48&lon=0&time=2026-11-09T18:00:00Z&tz=Europe/London&passLimit=2'
Response · 200 · 155 lines
{
  "time": "2026-11-09T18:00:00.000Z",
  "observer": {
    "lat": 51.48,
    "lon": 0,
    "elevation": 0
  },
  "night": {
    "start": "2026-11-09T16:19:34.305Z",
    "end": "2026-11-10T07:09:10.651Z",
    "hours": 14.8268
  },
  "twilight": {
    "sunset": "2026-11-09T16:19:34.305Z",
    "civilDusk": "2026-11-09T16:55:40.694Z",
    "nauticalDusk": "2026-11-09T17:35:46.539Z",
    "astronomicalDusk": "2026-11-09T18:14:44.663Z",
    "astronomicalDawn": "2026-11-10T05:13:36.915Z",
    "nauticalDawn": "2026-11-10T05:52:41.008Z",
    "civilDawn": "2026-11-10T06:32:54.834Z",
    "sunrise": "2026-11-10T07:09:10.651Z",
    "midnightSun": false,
    "polarNight": false
  },
  "darkness": {
    "start": "2026-11-09T18:19:34.305Z",
    "end": "2026-11-10T05:09:34.305Z",
    "hours": 11,
    "moonFreeHours": 11
  },
  "moon": {
    "phaseName": "New Moon",
    "illumination": 0.0066,
    "ageDays": 0.42527,
    "phase": 0.0144,
    "rise": "2026-11-10T08:53:45.879Z",
    "set": null,
    "riseAzimuth": 132.9868,
    "setAzimuth": null,
    "nextFullMoon": "2026-11-24T14:54:04.191Z",
    "nextNewMoon": "2026-12-09T00:52:31.284Z",
    "upDuringDarknessHours": 0
  },
  "planets": [
    {
      "id": "venus",
      "name": "Venus",
      "magnitude": -4.6,
      "constellation": "Virgo",
      "visible": true,
      "nakedEye": true,
      "bestTime": "2026-11-10T06:29:34.305Z",
      "bestAltitude": 12.0703,
      "bestAzimuth": 126.2002,
      "direction": "SE",
      "hoursUp": 1,
      "when": "before dawn",
      "illumination": 0.0915,
      "angularDiameter": 54.0373
    },
    … 6 more
  ],
  "meteorShowers": [
    {
      "id": "NTA",
      "name": "Northern Taurids",
      "zhr": 5,
      "speedKmS": 29,
      "peak": "2026-11-12T18:17:32.239Z",
      "daysFromPeak": -3.0122,
      "radiant": {
        "ra": 3.6659,
        "dec": 21.3976
      }
    },
    … 1 more
  ],
  "eclipses": {
    "lunar": {
      "kind": "penumbral",
      "peak": "2027-02-20T23:12:44.142Z",
      "obscuration": 0,
      "partialMinutes": 0,
      "totalMinutes": 0,
      "moonAltitudeAtPeak": 45.9135,
      "visible": true
    },
    "solar": {
      "kind": "partial",
      "obscuration": 0.41869,
      "peak": "2027-08-02T09:00:08.145Z",
      "sunAltitudeAtPeak": 40.3132,
      "start": "2027-08-02T08:03:35.196Z",
      "end": "2027-08-02T09:59:29.760Z"
    }
  },
  "timeZone": "Europe/London",
  "place": {
    "name": "London",
    "region": "England",
    "country": "United Kingdom",
    "countryCode": "GB",
    "lat": 51.5085,
    "lon": -0.1257,
    "elevation": 25,
    "timeZone": "Europe/London",
    "population": 8961989,
    "label": "London, England, United Kingdom",
    "distanceKm": 9
  },
  "satellitePasses": [
    {
      "id": 8459,
      "name": "SL-8 rocket body",
      "rise": {
        "time": "2026-11-09T16:42:02.720Z",
        "altitude": 0.00398,
        "azimuth": 187.388,
        "direction": "S"
      },
      "culmination": {
        "time": "2026-11-09T16:49:28.875Z",
        "altitude": 53.2849,
        "azimuth": 107.5096,
        "direction": "ESE"
      },
      "set": {
        "time": "2026-11-09T16:57:01.470Z",
        "altitude": 0.02196,
        "azimuth": 28.1231,
        "direction": "NNE"
      },
      "durationSeconds": 899,
      "maxAltitude": 53.2849,
      "visible": true,
      "visibleStart": {
        "time": "2026-11-09T16:42:22.720Z",
        "altitude": 1.2015,
        "azimuth": 186.9581,
        "direction": "S"
      },
      "visibleEnd": {
        "time": "2026-11-09T16:56:52.720Z",
        "altitude": 0.53134,
        "azimuth": 28.2871,
        "direction": "NNE"
      },
      "magnitude": 3,
      "sunlitAtCulmination": true,
      "observerSunAltitude": -5.0802
    },
    … 1 more
  ],
  "satelliteElementsUpdated": "2026-11-09T16:35:07.404Z"
}

satelliteError appears instead of passes if the elements could not be loaded; place is the nearest town (GeoNames) with its time zone.

GET /api/lighting

Sunlight, moonlight and skylight for a 3D scene or smart lights: directions (ENU and three.js axes, y up, north −z), colours after atmospheric extinction, and illuminance in lux. The house example lights its scene with it.

With SKYMAP_OFFLINE=1: worksIn the app with no connection: computed in the browserServer cache: None.

ParameterDefaultMeaning
latrequiredLatitude in degrees, north positive (−90 to 90).
lonrequiredLongitude in degrees, east positive (−180 to 360).
elevation0Height above sea level in metres (−500 to 9000).
timenowThe moment: ISO 8601 (2026-11-09T21:00:00Z), Unix seconds or milliseconds, or now.
Example: GET Run it
curl 'http://localhost:8080/api/lighting?lat=51.48&lon=0&time=2026-11-09T21:00:00Z'
Response · 200
{
  "time": "2026-11-09T21:00:00.000Z",
  "phase": "night",
  "sun": {
    "altitude": -42.4221,
    "azimuth": 301.3807,
    "direction": {
      "x": -0.63022,
      "y": -0.67459,
      "z": -0.38439
    },
    "enu": {
      "east": -0.63022,
      "north": 0.38439,
      "up": -0.67459
    },
    "color": [0, 0, 0],
    "illuminance": 0,
    "horizontalIlluminance": 0
  },
  "moon": {
    "altitude": -45.3565,
    "azimuth": 290.3385,
    "direction": {
      "x": -0.65888,
      "y": -0.71149,
      "z": -0.24423
    },
    "enu": {
      "east": -0.65888,
      "north": 0.24423,
      "up": -0.71149
    },
    "color": [0, 0, 0],
    "illuminance": 0,
    "horizontalIlluminance": 0,
    "illumination": 0.00522,
    "phaseName": "Waxing Crescent"
  },
  "sky": {
    "illuminance": 0.00076,
    "zenithColor": [0.012, 0.016, 0.03],
    "horizonColor": [0.02, 0.025, 0.04]
  },
  "totalIlluminance": 0.00076
}

GET /api/meteor-showers

Meteor showers active at time, with their peak, rate (ZHR), speed and the radiant where it is that night; all is the whole IMO working list the app uses.

With SKYMAP_OFFLINE=1: worksIn the app with no connection: computed in the browserServer cache: None.

ParameterDefaultMeaning
timenowThe moment: ISO 8601 (2026-11-09T21:00:00Z), Unix seconds or milliseconds, or now.
Example: GET Run it
curl 'http://localhost:8080/api/meteor-showers?time=2026-12-13T22:00:00Z'
Response · 200 · 49 lines
{
  "time": "2026-12-13T22:00:00.000Z",
  "showers": [
    {
      "id": "GEM",
      "name": "Geminids",
      "zhr": 150,
      "speedKmS": 35,
      "peak": "2026-12-14T13:49:23.574Z",
      "daysFromPeak": -0.6593,
      "radiant": {
        "ra": 7.4227,
        "dec": 33.0659
      }
    },
    {
      "id": "HYD",
      "name": "σ-Hydrids",
      "zhr": 7,
      "speedKmS": 58,
      "peak": "2026-12-09T11:04:21.557Z",
      "daysFromPeak": 4.4553,
      "radiant": {
        "ra": 8.5709,
        "dec": 1.1089
      }
    },
    … 1 more
  ],
  "all": [
    {
      "id": "QUA",
      "code": "010 QUA",
      "name": "Quadrantids",
      "start": [12, 28],
      "end": [1, 12],
      "peakLon": 283.15,
      "ra": 230,
      "dec": 49,
      "dra": 0.6,
      "ddec": -0.2,
      "speed": 41,
      "r": 2.1,
      "zhr": 80,
      "B": 2
    },
    … 21 more
  ]
}

GET /api/eclipses

The next lunar eclipse (and whether it is visible from here) and the next solar eclipse seen from this place, with how much of the Sun is covered.

With SKYMAP_OFFLINE=1: worksIn the app with no connection: computed in the browserServer cache: None.

ParameterDefaultMeaning
latrequiredLatitude in degrees, north positive (−90 to 90).
lonrequiredLongitude in degrees, east positive (−180 to 360).
elevation0Height above sea level in metres (−500 to 9000).
timenowThe moment: ISO 8601 (2026-11-09T21:00:00Z), Unix seconds or milliseconds, or now.
Example: GET Run it
curl 'http://localhost:8080/api/eclipses?lat=51.48&lon=0&time=2026-11-09T00:00:00Z'
Response · 200
{
  "lunar": {
    "kind": "penumbral",
    "peak": "2027-02-20T23:12:44.142Z",
    "obscuration": 0,
    "partialMinutes": 0,
    "totalMinutes": 0,
    "moonAltitudeAtPeak": 45.9135,
    "visible": true
  },
  "solar": {
    "kind": "partial",
    "obscuration": 0.41869,
    "peak": "2027-08-02T09:00:08.145Z",
    "sunAltitudeAtPeak": 40.3132,
    "start": "2027-08-02T08:03:35.196Z",
    "end": "2027-08-02T09:59:29.760Z"
  }
}

For the full eclipse calendar with contact times, use /api/events?types=lunar-eclipse,solar-eclipse.

GET /api/night

The night’s timeline: sunset to sunrise (or a 24-hour window in polar day and night), the twilight stages, the dark window, the darkest moment, the Moon up and down, and segments by sky state.

With SKYMAP_OFFLINE=1: worksIn the app with no connection: computed in the browserServer cache: None.

ParameterDefaultMeaning
latrequiredLatitude in degrees, north positive (−90 to 90).
lonrequiredLongitude in degrees, east positive (−180 to 360).
elevation0Height above sea level in metres (−500 to 9000).
timenowThe moment: ISO 8601 (2026-11-09T21:00:00Z), Unix seconds or milliseconds, or now.
tznearest town’sIANA time zone for local dates and words (Europe/London); also timeZone.
Example: GET Run it
curl 'http://localhost:8080/api/night?lat=51.48&lon=0&tz=Europe/London&time=2026-11-09T18:00:00Z'
Response · 200 · 56 lines
{
  "kind": "night",
  "timeZone": "Europe/London",
  "date": "2026-11-09",
  "start": "2026-11-09T16:19:34.305Z",
  "end": "2026-11-10T07:09:10.637Z",
  "hours": 14.83,
  "sun": {
    "set": "2026-11-09T16:19:34.305Z",
    "rise": "2026-11-10T07:09:10.637Z",
    "lowestAltitude": -55.59,
    "lowestTime": "2026-11-09T23:40:00.000Z"
  },
  "twilight": {
    "civilDusk": "2026-11-09T16:55:40.694Z",
    "nauticalDusk": "2026-11-09T17:35:46.539Z",
    "astronomicalDusk": "2026-11-09T18:14:44.663Z",
    "astronomicalDawn": "2026-11-10T05:13:36.915Z",
    "nauticalDawn": "2026-11-10T05:52:41.008Z",
    "civilDawn": "2026-11-10T06:32:54.834Z"
  },
  "darkness": {
    "start": "2026-11-09T18:14:44.663Z",
    "end": "2026-11-10T05:13:36.915Z",
    "hours": 10.98
  },
  "darkest": {
    "time": "2026-11-09T23:40:00.000Z",
    "sunAltitude": -55.59
  },
  "moon": {
    "rise": null,
    "set": null,
    "up": [],
    "illumination": 0.007,
    "phase": 0.0218,
    "phaseName": "Waxing Crescent",
    "ageDays": 0.64,
    "upDuringDarknessHours": 0
  },
  "segments": [
    {
      "start": "2026-11-09T16:19:34.305Z",
      "end": "2026-11-09T16:55:40.694Z",
      "sky": "civil",
      "moonUp": false
    },
    {
      "start": "2026-11-09T16:55:40.694Z",
      "end": "2026-11-09T17:35:46.539Z",
      "sky": "nautical",
      "moonUp": false
    },
    … 5 more
  ]
}

GET /api/sky-brightness

How bright the sky is toward a direction (mag/arcsec² and cd/m²) and the faintest star the eye can see there, from natural airglow, light pollution, twilight and moonlight.

With SKYMAP_OFFLINE=1: worksIn the app with no connection: computed in the browserServer cache: None.

ParameterDefaultMeaning
latrequiredLatitude in degrees, north positive (−90 to 90).
lonrequiredLongitude in degrees, east positive (−180 to 360).
elevation0Height above sea level in metres (−500 to 9000).
timenowThe moment: ISO 8601 (2026-11-09T21:00:00Z), Unix seconds or milliseconds, or now.
alt90Altitude of the direction (−10 to 90).
az0Azimuth of the direction.
bortle | sqmBortle 4Sky darkness: Bortle class 1–9, or a sky-quality reading in mag/arcsec² (14–22.5).
aodmodelAerosol optical depth (0–5) for the extinction.
Example: GET Run it
curl 'http://localhost:8080/api/sky-brightness?lat=51.48&lon=0&time=2026-11-09T22:00:00Z&alt=90&bortle=5'
Response · 200
{
  "altitude": 90,
  "azimuth": 0,
  "mpsas": 20,
  "luminance": 0.00108,
  "nelm": 5.82,
  "bortle": 5,
  "zenithSqm": 20,
  "extinction": 0.233,
  "components": {
    "natural": 21.99,
    "lightPollution": 20.19,
    "moon": null,
    "twilight": null
  },
  "sun": {
    "altitude": -49.89,
    "azimuth": 319.49
  },
  "moon": {
    "altitude": -53.36,
    "azimuth": 306.55,
    "phaseAngle": 171.33,
    "eclipseFactor": 1
  }
}

Search and places

GET /api/places

Offline place search over 34,000 towns and cities (GeoNames), or the largest place in a time zone (the app’s first guess of where you are, with no permission prompt). Coordinates typed as text (48.85, 2.35) give that point.

With SKYMAP_OFFLINE=1: worksIn the app with no connection: computed in the browserServer cache: Loaded once at start-up.

ParameterDefaultMeaning
q—Name to search for (any language GeoNames has).
tz—Instead of q: an IANA time zone.
limit10 (1 with tz)1–50.
Example: GET Run it
curl 'http://localhost:8080/api/places?q=reykjav&limit=1'
Response · 200
{
  "query": "reykjav",
  "results": [
    {
      "name": "Reykjavík",
      "region": "Capital Region",
      "country": "Iceland",
      "countryCode": "IS",
      "lat": 64.1355,
      "lon": -21.8954,
      "elevation": 37,
      "timeZone": "Atlantic/Reykjavik",
      "population": 118918,
      "label": "Reykjavík, Capital Region, Iceland"
    }
  ]
}
Also: GET Run it
curl 'http://localhost:8080/api/places?tz=Europe/Lisbon'
Response · 200
{
  "timeZone": "Europe/Lisbon",
  "results": [
    {
      "name": "Lisbon",
      "region": "Lisbon",
      "country": "Portugal",
      "countryCode": "PT",
      "lat": 38.7251,
      "lon": -9.1498,
      "elevation": 68,
      "timeZone": "Europe/Lisbon",
      "population": 517802,
      "label": "Lisbon, Portugal"
    }
  ]
}

GET /api/places/nearest

Reverse lookup: the nearest town to a point, its distance and its time zone.

With SKYMAP_OFFLINE=1: worksIn the app with no connection: computed in the browserServer cache: None.

ParameterDefaultMeaning
latrequiredLatitude in degrees, north positive (−90 to 90).
lonrequiredLongitude in degrees, east positive (−180 to 360).
point01: name the point itself (with the nearest town in its label) when no town is within about 12 km.
Example: GET Run it
curl 'http://localhost:8080/api/places/nearest?lat=51.48&lon=0'
Response · 200
{
  "name": "London",
  "region": "England",
  "country": "United Kingdom",
  "countryCode": "GB",
  "lat": 51.5085,
  "lon": -0.1257,
  "elevation": 25,
  "timeZone": "Europe/London",
  "population": 8961989,
  "label": "London, England, United Kingdom",
  "distanceKm": 9
}

Satellites

GET /api/satellites/groups

The CelesTrak groups this server will fetch.

With SKYMAP_OFFLINE=1: worksServer cache: None.

Example: GET Run it
curl 'http://localhost:8080/api/satellites/groups'
Response · 200
{
  "groups": {
    "stations": "Space stations (ISS, Tiangong)",
    "visual": "100 (or so) brightest satellites",
    "gps-ops": "GPS operational",
    "weather": "Weather satellites",
    "science": "Space & Earth science",
    "starlink": "Starlink (several thousand objects)",
    "geo": "Geostationary",
    "last-30-days": "Launched in the last 30 days (fresh Starlink trains)"
  }
}

GET /api/satellites/elements

Orbital elements (OMM JSON, as CelesTrak publishes them) for the browser’s own SGP4 (satellites.js loadSatellites()). Refreshed from CelesTrak at most every 6 hours; a bundled snapshot is used when nothing fresher is available.

With SKYMAP_OFFLINE=1: from its cacheIn the app with no connection: from the last answer keptServer cache: Per group: memory and server/cache/<group>.json, 6 hours; then the bundled snapshot (server/data/satellites-snapshot.json).

ParameterDefaultMeaning
groupsstations,visualCelesTrak groups to load (see /api/satellites/groups).
Example: GET Run it
curl 'http://localhost:8080/api/satellites/elements?groups=stations'
Response · 200
{
  "updated": "2026-11-09T16:35:07.404Z",
  "groups": [
    {
      "name": "stations",
      "fetchedAt": "2026-11-09T16:35:07.404Z",
      "source": "https://celestrak.org/NORAD/elements/gp.php?GROUP=stations&FORMAT=json",
      "elements": [
        {
          "OBJECT_NAME": "ISS (ZARYA)",
          "OBJECT_ID": "1998-067A",
          "EPOCH": "2026-11-09T04:58:46.240896",
          "MEAN_MOTION": 15.4927,
          "ECCENTRICITY": 0.00073,
          "INCLINATION": 51.6321,
          "RA_OF_ASC_NODE": 302.4538,
          "ARG_OF_PERICENTER": 5.2479,
          "MEAN_ANOMALY": 354.8585,
          "EPHEMERIS_TYPE": 0,
          "CLASSIFICATION_TYPE": "U",
          "NORAD_CAT_ID": 25544,
          "ELEMENT_SET_NO": 999,
          "REV_AT_EPOCH": 59423,
          "BSTAR": 0.00016,
          "MEAN_MOTION_DOT": 0.00008,
          "MEAN_MOTION_DDOT": 0
        },
        … 18 more
      ]
    }
  ]
}

Errors: 400 unknown group. The body is { "error": "…" }.

GET /api/satellites/overhead

Every satellite of the groups above the horizon now, with whether it is sunlit and visible to the eye, and its magnitude.

With SKYMAP_OFFLINE=1: from its cacheIn the app with no connection: from the last answer keptServer cache: Elements as above; positions are computed per request.

ParameterDefaultMeaning
latrequiredLatitude in degrees, north positive (−90 to 90).
lonrequiredLongitude in degrees, east positive (−180 to 360).
elevation0Height above sea level in metres (−500 to 9000).
timenowThe moment: ISO 8601 (2026-11-09T21:00:00Z), Unix seconds or milliseconds, or now.
minAltitude0Degrees (−90 to 90).
visibleOnly01: only sunlit ones in a dark enough sky.
groupsstations,visualCelesTrak groups to load (see /api/satellites/groups).
ids—Only these NORAD catalogue numbers, comma-separated.
names—Only satellites whose name contains one of these, comma-separated.
Example: GET Run it
curl 'http://localhost:8080/api/satellites/overhead?lat=51.48&lon=0&time=2026-11-09T21:00:00Z&minAltitude=10'
Response · 200
{
  "time": "2026-11-09T21:00:00.000Z",
  "elementsUpdated": "2026-11-09T16:35:07.404Z",
  "count": 5,
  "satellites": [
    {
      "id": 22830,
      "name": "ARIANE 40 rocket body",
      "time": "2026-11-09T21:00:00.000Z",
      "altitude": 73.7679,
      "azimuth": 51.5347,
      "direction": "NE",
      "rangeKm": 824.4014,
      "heightKm": 795.2372,
      "subpoint": {
        "lat": 52.6022,
        "lon": 2.3691
      },
      "sunlit": false,
      "shadowFraction": 1,
      "observerSunAltitude": -42.7468,
      "visible": false,
      "magnitude": null,
      "velocityKmS": 7.4585
    },
    … 4 more
  ]
}

GET /api/satellites/passes

Pass predictions: rise, culmination and set (and the visible part), with the maximum altitude and magnitude. Checked against skyfield to within 2 s.

With SKYMAP_OFFLINE=1: from its cacheIn the app with no connection: from the last answer keptServer cache: In memory per place, 5-minute start and parameters.

ParameterDefaultMeaning
latrequiredLatitude in degrees, north positive (−90 to 90).
lonrequiredLongitude in degrees, east positive (−180 to 360).
elevation0Height above sea level in metres (−500 to 9000).
startnowStart of the window (same forms as time).
hours24Window length (0.1–240).
minAltitude10Passes must climb this high (0–89).
visibleOnly01: only passes you can see (sunlit, in a dark sky).
limit100At most this many passes (1–500).
groupsstations,visualCelesTrak groups to load (see /api/satellites/groups).
ids—Only these NORAD catalogue numbers, comma-separated.
names—Only satellites whose name contains one of these, comma-separated.
Example: GET Run it
curl 'http://localhost:8080/api/satellites/passes?lat=51.48&lon=0&ids=25544&start=2026-11-09T12:00:00Z&hours=12'
Response · 200
{
  "start": "2026-11-09T12:00:00.000Z",
  "hours": 12,
  "minAltitude": 10,
  "elementsUpdated": "2026-11-09T16:35:07.404Z",
  "passes": [
    {
      "id": 25544,
      "name": "ISS",
      "rise": {
        "time": "2026-11-09T19:05:35.098Z",
        "altitude": 0.01952,
        "azimuth": 196.2411,
        "direction": "SSW"
      },
      "culmination": {
        "time": "2026-11-09T19:10:07.621Z",
        "altitude": 12.9454,
        "azimuth": 138.5284,
        "direction": "SE"
      },
      "set": {
        "time": "2026-11-09T19:14:41.973Z",
        "altitude": 0.0194,
        "azimuth": 81.0863,
        "direction": "E"
      },
      "durationSeconds": 547,
      "maxAltitude": 12.9454,
      "visible": false,
      "visibleStart": null,
      "visibleEnd": null,
      "magnitude": null,
      "sunlitAtCulmination": false,
      "observerSunAltitude": -26.5845
    },
    … 3 more
  ]
}

GET /api/satellites/position

One satellite now: where it is in your sky, its height, ground point, range, speed, whether it is sunlit and visible, and its magnitude.

With SKYMAP_OFFLINE=1: from its cacheIn the app with no connection: from the last answer keptServer cache: Elements as above.

ParameterDefaultMeaning
idrequiredNORAD catalogue number (25544 is the ISS).
latrequiredLatitude in degrees, north positive (−90 to 90).
lonrequiredLongitude in degrees, east positive (−180 to 360).
elevation0Height above sea level in metres (−500 to 9000).
timenowThe moment: ISO 8601 (2026-11-09T21:00:00Z), Unix seconds or milliseconds, or now.
groupsstations,visualCelesTrak groups to load (see /api/satellites/groups).
Example: GET Run it
curl 'http://localhost:8080/api/satellites/position?id=25544&lat=51.48&lon=0&time=2026-11-09T21:00:00Z'
Response · 200
{
  "id": 25544,
  "name": "ISS",
  "time": "2026-11-09T21:00:00.000Z",
  "altitude": -21.6255,
  "azimuth": 72.3699,
  "direction": "ENE",
  "rangeKm": 5694.4,
  "heightKm": 424.5045,
  "subpoint": {
    "lat": 39.6997,
    "lon": 74.2897
  },
  "sunlit": false,
  "shadowFraction": 1,
  "observerSunAltitude": -42.7468,
  "visible": false,
  "magnitude": null,
  "velocityKmS": 7.6605,
  "epoch": "2026-11-09T04:58:46.240Z",
  "elementsUpdated": "2026-11-09T16:35:07.404Z"
}

Errors: 404 not in the loaded groups. The body is { "error": "…" }.

GET /api/satellites/bright-passes

The passes worth going out for: the ISS, Tiangong, Hubble, other bright satellites and fresh Starlink trains, each with the visible part, a worth-it score and reasons, and an English summary. What Plan › Satellites shows.

With SKYMAP_OFFLINE=1: from its cacheIn the app with no connection: from the last answer keptServer cache: In memory, 10 minutes per place (0.01°) and window.

ParameterDefaultMeaning
latrequiredLatitude in degrees, north positive (−90 to 90).
lonrequiredLongitude in degrees, east positive (−180 to 360).
elevation0Height above sea level in metres (−500 to 9000).
startnowStart of the window (same forms as time).
hours240.5–72.
includepopularpopular (stations, Hubble, trains, the brightest) or all bright ones.
maxMagnitude3.5Faintest magnitude at the brightest point (−6 to 6).
minAltitude100–80.
horizonflatYour horizon as az:alt,az:alt,… or a JSON array of [az, alt] pairs, degrees.
tznearest town’sIANA time zone for local dates and words (Europe/London); also timeZone.
limit501–500.
Example: GET Run it
curl 'http://localhost:8080/api/satellites/bright-passes?lat=51.48&lon=0&tz=Europe/London&start=2026-11-09T12:00:00Z&hours=24&limit=3'
Response · 200 · 68 lines
{
  "start": "2026-11-09T12:00:00.000Z",
  "hours": 24,
  "passes": [
    {
      "id": 67232,
      "name": "SPACEMOBILE-006",
      "kind": "satellite",
      "magnitude": -0.1,
      "magnitudeSource": "estimated",
      "tier": "bright",
      "crewed": false,
      "start": {
        "time": "2026-11-10T05:00:15.222Z",
        "altitude": 61.4,
        "azimuth": 306.3,
        "direction": "NW",
        "directionWords": "northwest"
      },
      "max": {
        "time": "2026-11-10T05:00:50.222Z",
        "altitude": 76.5,
        "azimuth": 12.4,
        "direction": "NNE",
        "directionWords": "north-northeast"
      },
      "end": {
        "time": "2026-11-10T05:05:40.222Z",
        "altitude": 5.2,
        "azimuth": 97.7,
        "direction": "E",
        "directionWords": "east"
      },
      "rise": {
        "time": "2026-11-10T04:54:40.222Z",
        "altitude": 0,
        "azimuth": 281.29,
        "direction": "WNW",
        "directionWords": "west-northwest"
      },
      "set": {
        "time": "2026-11-10T05:06:56.276Z",
        "altitude": 0,
        "azimuth": 98.71,
        "direction": "E",
        "directionWords": "east"
      },
      "durationSeconds": 736,
      "visibleSeconds": 325,
      "startsInShadow": true,
      "endsInShadow": false,
      "observerSunAltitude": -19.2,
      "worth": {
        "score": 73,
        "label": "great",
        "reasons": [
          "bright",
          "high-pass",
          … 1 more
        ]
      },
      "summary": "SPACEMOBILE-006: Tue 10 Nov 05:00–05:05, from the northwest to the east, highest 77° in the north-northeast at 05:00, magnitude -0.1."
    }
  ],
  "elementsUpdated": "2026-11-09T16:35:07.404Z",
  "satellites": 164,
  "trains": true
}

Comets

GET /api/comets

Comets brighter than a magnitude at time, brightest first, from the IAU Minor Planet Center’s elements.

With SKYMAP_OFFLINE=1: from its cacheIn the app with no connection: from the last answer keptServer cache: Elements: memory and server/cache/CometEls.txt, 24 hours; then the bundled extract of bright comets.

ParameterDefaultMeaning
timenowThe moment: ISO 8601 (2026-11-09T21:00:00Z), Unix seconds or milliseconds, or now.
maxMagnitude12−5 to 20.
Example: GET Run it
curl 'http://localhost:8080/api/comets?time=2026-11-09T21:00:00Z&maxMagnitude=12'
Response · 200
{
  "time": "2026-11-09T21:00:00.000Z",
  "maxMagnitude": 12,
  "source": "https://www.minorplanetcenter.net/iau/MPCORB/CometEls.txt",
  "fetchedAt": "2026-11-09T13:17:45.530Z",
  "credit": "Comet orbital elements: IAU Minor Planet Center (minorplanetcenter.net), CometEls.txt",
  "count": 970,
  "comets": [
    {
      "id": "161P",
      "name": "161P/Hartley-IRAS",
      "designation": "161P",
      "magnitude": 10.4,
      "r": 1.288,
      "delta": 1.098,
      "elongation": 76,
      "ra": 19.6063,
      "dec": 15.954,
      "constellation": "Aql",
      "perihelion": "2026-11-27T04:16:53.760Z",
      "q": 1.2651,
      "e": 0.83617,
      "epoch": "20261108"
    }
  ]
}

GET /api/comets/elements

The MPC element lines of the comets that are bright around now (six months back to a year ahead), for comets.js loadComets() in the browser.

With SKYMAP_OFFLINE=1: from its cacheIn the app with no connection: from the last answer keptServer cache: 6 hours per element set.

ParameterDefaultMeaning
maxMagnitude15−5 to 20.
Example: GET Run it
curl 'http://localhost:8080/api/comets/elements?maxMagnitude=12'
Response · 200
{
  "updated": "2026-11-09T13:17:45.530Z",
  "source": "https://www.minorplanetcenter.net/iau/MPCORB/CometEls.txt",
  "credit": "Comet orbital elements: IAU Minor Planet Center (minorplanetcenter.net), CometEls.txt",
  "maxMagnitude": 12,
  "count": 11,
  "elements": [
    "0342P         2027 02  7.7832  0.051751  0.982975   27.7105   73.2501   11.6729  20261108  20.0  4.0  342P/SOHO                            …",
    "0045P         2027 08 31.7964  0.558352  0.817352  327.9645   87.6666    4.3237  20261108  13.5  8.0  45P/Honda-Mrkos-Pajdusakova          …",
    … 9 more
  ]
}

GET /api/comet

One comet’s position, like /api/position, with its orbit, distance from the Sun and an estimated coma size.

With SKYMAP_OFFLINE=1: from its cacheIn the app with no connection: from the last answer keptServer cache: Elements as above.

ParameterDefaultMeaning
idrequiredDesignation or name: 2P, C/2023 A3, Encke. Also target.
latrequiredLatitude in degrees, north positive (−90 to 90).
lonrequiredLongitude in degrees, east positive (−180 to 360).
elevation0Height above sea level in metres (−500 to 9000).
timenowThe moment: ISO 8601 (2026-11-09T21:00:00Z), Unix seconds or milliseconds, or now.
Example: GET Run it
curl 'http://localhost:8080/api/comet?id=2P&lat=51.48&lon=0&time=2026-11-09T21:00:00Z'
Response · 200
{
  "id": "2P",
  "name": "2P/Encke",
  "type": "comet",
  "designation": "2P",
  "time": "2026-11-09T21:00:00.000Z",
  "altitude": 49.1919,
  "azimuth": 202.7642,
  "altitudeGeometric": 49.1773,
  "direction": "SSW",
  "aboveHorizon": true,
  "ra": 23.2461,
  "dec": 12.3651,
  "raOfDate": 23.2687,
  "decOfDate": 12.5122,
  "distanceAU": 0.92877,
  "distanceKm": 138942105,
  "sunDistanceAU": 1.7092,
  "r": 1.7092,
  "delta": 0.92877,
  "magnitude": 16.7675,
  "elongation": 125.8487,
  "phaseAngle": 151.9818,
  "constellation": {
    "id": "Peg",
    "name": "Pegasus"
  },
  "vector": [-0.25288, -0.60262, 0.7569],
  "perihelion": "2027-02-10T05:28:10.560Z",
  "perihelionDistanceAU": 0.33859,
  "eccentricity": 0.84732,
  "orbit": "elliptic",
  "coma": {
    "diameterArcmin": 2.5
  }
}

Errors: 400 missing id; 404 unknown comet. The body is { "error": "…" }.

Planning

GET /api/events

The events calendar: Moon phases, conjunctions and occultations, oppositions and elongations, meteor showers with tonight’s conditions, lunar and solar eclipses with contact times, Algol and other variable-star events, bright comets and the seasons, each with when to look from here, a visibility verdict, an importance score and an English summary.

With SKYMAP_OFFLINE=1: worksIn the app with no connection: computed in the browserServer cache: In memory, 1 hour per place (0.001°), hour and parameters.

ParameterDefaultMeaning
latrequiredLatitude in degrees, north positive (−90 to 90).
lonrequiredLongitude in degrees, east positive (−180 to 360).
elevation0Height above sea level in metres (−500 to 9000).
startnowStart of the window (same forms as time).
days301–400.
tznearest town’sIANA time zone for local dates and words (Europe/London); also timeZone.
horizonflatYour horizon as az:alt,az:alt,… or a JSON array of [az, alt] pairs, degrees.
bortle | sqmBortle 4Sky darkness: Bortle class 1–9, or a sky-quality reading in mag/arcsec² (14–22.5).
visibleOnly10 keeps events you cannot see from here.
typesallComma-separated: moon-phase, conjunction, occultation, opposition, greatest-elongation, greatest-brilliancy, meteor-shower, lunar-eclipse, solar-eclipse, variable, comet, season, …
minImportance00–100.
comets10 leaves comets out.
Example: GET Run it
curl 'http://localhost:8080/api/events?lat=51.48&lon=0&tz=Europe/London&start=2026-11-09&days=30'
Response · 200 · 57 lines
{
  "observer": {
    "lat": 51.48,
    "lon": 0,
    "elevation": 0
  },
  "timeZone": "Europe/London",
  "start": "2026-11-09T00:00:00.000Z",
  "end": "2026-12-09T00:00:00.000Z",
  "days": 30,
  "events": [
    {
      "id": "moon-phase:new:2026-11-09",
      "type": "moon-phase",
      "subtype": "new",
      "time": "2026-11-09T07:02:42.392Z",
      "window": null,
      "bodies": [
        {
          "id": "moon",
          "name": "Moon",
          "kind": "moon",
          "magnitude": null
        }
      ],
      "data": {
        "phase": "new",
        "distanceKm": 397761,
        "illumination": 0.002,
        "supermoon": false,
        "micromoon": false,
        "nearestPerigee": {
          "time": "2026-10-28T18:04:10.352Z",
          "distanceKm": 364397
        }
      },
      "best": null,
      "visibility": {
        "verdict": "info",
        "reason": "new-moon"
      },
      "importance": 10,
      "summary": "New Moon on Mon 9 Nov at 07:02."
    },
    … 28 more
  ],
  "counts": {
    "moon-phase": 4,
    "conjunction": 9,
    "variable": 10,
    "meteor-shower": 3,
    "greatest-elongation": 1,
    "opposition": 1,
    "greatest-brilliancy": 1
  },
  "elapsedMs": 1054
}

GET POST /api/plan

Tonight’s observing plan: the night’s timeline hour by hour, the conditions (darkness, weather, transparency, seeing, dew), one verdict for the night with its best windows, and ranked targets with go / maybe / skip, reasons, the best time and where to look, and how each looks through your gear. POST takes the same fields as JSON, with gear as objects and your own weather, passes or targets inline.

With SKYMAP_OFFLINE=1: plans without weather unless a forecast is cachedIn the app with no connection: computed in the browserServer cache: Weather, passes and comets come from their own caches; the plan itself is computed per request (100–400 ms).

ParameterDefaultMeaning
latrequiredLatitude in degrees, north positive (−90 to 90).
lonrequiredLongitude in degrees, east positive (−180 to 360).
elevation0Height above sea level in metres (−500 to 9000).
timenowThe moment: ISO 8601 (2026-11-09T21:00:00Z), Unix seconds or milliseconds, or now.
tznearest town’sIANA time zone for local dates and words (Europe/London); also timeZone.
geareyes,binoculars-10x50Comma-separated presets from /api/gear (POST: preset ids or gear objects).
bortle | sqmBortle 4Sky darkness: Bortle class 1–9, or a sky-quality reading in mag/arcsec² (14–22.5).
horizonflatYour horizon as az:alt,az:alt,… or a JSON array of [az, alt] pairs, degrees.
weather10: plan without a forecast.
satellites10: leave out satellite passes.
events10: leave out tonight’s events.
kindsallComma-separated: planet, moon, dso, double, star, variable, constellation, comet, satellite, event.
maxTargets301–100.
experienceaveragebeginner, average or expert.
start, endthe nightYour session, HH:MM local or ISO.
seeingforecastSeeing in arcseconds (0.3–10).
minAltitudeper kind0–80.
age—Observer’s age, for the eye’s pupil (5–100).
Example: GET Run it
curl 'http://localhost:8080/api/plan?lat=51.48&lon=0&tz=Europe/London&time=2026-11-09T18:00:00Z&gear=eyes,binoculars-10x50&bortle=5&maxTargets=4'
Response · 200 · 438 lines
{
  "version": 2,
  "observer": {
    "lat": 51.48,
    "lon": 0,
    "elevation": 0
  },
  "timeZone": "Europe/London",
  "generated": "2026-11-09T19:03:15.698Z",
  "night": {
    "kind": "night",
    "timeZone": "Europe/London",
    "date": "2026-11-09",
    "start": "2026-11-09T16:19:34.305Z",
    "end": "2026-11-10T07:09:10.637Z",
    "hours": [
      {
        "time": "2026-11-09T16:19:34.305Z",
        "sky": "civil",
        "sunAltitude": -0.8,
        "moonAltitude": -4.4,
        "zenithSqm": 7.13,
        "nakedEyeLimit": -2.2,
        "weather": {
          "verdict": "go",
          "deepSky": "maybe",
          "highPower": "go",
          "cloud": 20,
          "transparency": "poor",
          "seeing": 1.5,
          "seeingLabel": "good",
          "reasons": [
            "poor-transparency"
          ]
        }
      },
      {
        "time": "2026-11-09T17:10:00.000Z",
        "sky": "nautical",
        "sunAltitude": -8.1,
        "moonAltitude": -11.2,
        "zenithSqm": 14.53,
        "nakedEyeLimit": 2.2,
        "weather": {
          "verdict": "go",
          "deepSky": "maybe",
          "highPower": "go",
          "cloud": 3,
          "transparency": "poor",
          "seeing": 1.5,
          "seeingLabel": "good",
          "reasons": [
            "poor-transparency"
          ]
        }
      },
      … 14 more
    ],
    "sun": {
      "set": "2026-11-09T16:19:34.305Z",
      "rise": "2026-11-10T07:09:10.637Z",
      "lowestAltitude": -55.59,
      "lowestTime": "2026-11-09T23:40:00.000Z"
    },
    "twilight": {
      "civilDusk": "2026-11-09T16:55:40.694Z",
      "nauticalDusk": "2026-11-09T17:35:46.539Z",
      "astronomicalDusk": "2026-11-09T18:14:44.663Z",
      "astronomicalDawn": "2026-11-10T05:13:36.915Z",
      "nauticalDawn": "2026-11-10T05:52:41.008Z",
      "civilDawn": "2026-11-10T06:32:54.834Z"
    },
    "darkness": {
      "start": "2026-11-09T18:14:44.663Z",
      "end": "2026-11-10T05:13:36.915Z",
      "hours": 10.98
    },
    "darkest": {
      "time": "2026-11-09T23:40:00.000Z",
      "sunAltitude": -55.59
    },
    "moon": {
      "rise": null,
      "set": null,
      "up": [],
      "illumination": 0.007,
      "phase": 0.0218,
      "phaseName": "Waxing Crescent",
      "ageDays": 0.64,
      "upDuringDarknessHours": 0
    },
    "segments": [
      {
        "start": "2026-11-09T16:19:34.305Z",
        "end": "2026-11-09T16:55:40.694Z",
        "sky": "civil",
        "moonUp": false
      },
      {
        "start": "2026-11-09T16:55:40.694Z",
        "end": "2026-11-09T17:35:46.539Z",
        "sky": "nautical",
        "moonUp": false
      },
      … 5 more
    ]
  },
  "conditions": {
    "sqm": 20,
    "bortle": 5,
    "extinction": 0.233,
    "seeing": "good",
    "darkestZenithSqm": 20,
    "weather": {
      "available": true,
      "verdict": "maybe",
      "score": 0.41,
      "clearHours": 7,
      "darkHours": 15,
      "cloudMean": 35,
      "bestWindow": {
        "start": "2026-11-10T01:00:00.000Z",
        "end": "2026-11-10T04:00:00.000Z",
        "hours": 3
      },
      "transparency": "bad",
      "seeing": "good",
      "dewRisk": "high",
      "reasons": [
        "haze",
        "poor-transparency",
        … 1 more
      ],
      "source": "open-meteo",
      "fetchedAt": "2026-11-09T18:48:27.812Z",
      "stale": false,
      "attribution": {
        "text": "Weather data by Open-Meteo.com",
        "url": "https://open-meteo.com/",
        "licence": "CC BY 4.0",
        "licenceUrl": "https://creativecommons.org/licenses/by/4.0/",
        "aerosols": "Aerosol optical depth: Copernicus Atmosphere Monitoring Service (CAMS), via Open-Meteo"
      }
    }
  },
  "verdict": {
    "rating": "fair",
    "score": 60,
    "weatherKnown": true,
    "window": {
      "start": "2026-11-10T00:40:00.000Z",
      "end": "2026-11-10T03:40:00.000Z"
    },
    "windows": [
      {
        "start": "2026-11-09T16:19:34.305Z",
        "end": "2026-11-09T17:40:00.000Z",
        "rating": "fair",
        "sky": "twilight",
        "reasons": [
          {
            "code": "clear",
            "cloud": 9
          },
          {
            "code": "twilight"
          },
          … 1 more
        ]
      },
      {
        "start": "2026-11-09T17:40:00.000Z",
        "end": "2026-11-09T18:40:00.000Z",
        "rating": "good",
        "sky": "dark",
        "reasons": [
          {
            "code": "clear",
            "cloud": 8
          },
          {
            "code": "dark"
          },
          … 1 more
        ]
      },
      … 6 more
    ],
    "reasons": [
      {
        "code": "partly-cloudy",
        "cloud": 35
      },
      {
        "code": "poor-transparency"
      },
      … 4 more
    ],
    "goodHours": 5.3,
    "darkHours": 12.3,
    "usableHours": 11.2,
    "summary": "Clear at dusk (16:19–18:40), cloudy until 22:40, then good until 07:09 (mostly clear); hazy; Venus, Jupiter, Mars and Saturn are still worth a look."
  },
  "gear": [
    {
      "id": "eyes",
      "type": "eyes",
      "name": "Eyes",
      "aperture": 6.2,
      "magnification": 1,
      "fieldDeg": 120
    },
    {
      "id": "binoculars-10x50",
      "type": "binoculars",
      "name": "10×50 binoculars",
      "aperture": 50,
      "magnification": 10,
      "fieldDeg": 6.5
    }
  ],
  "targets": [
    {
      "rank": 1,
      "id": "jupiter",
      "kind": "planet",
      "name": "Jupiter",
      "type": "planet",
      "designation": null,
      "constellation": null,
      "magnitude": -2.1,
      "sizeArcmin": null,
      "angularDiameter": 36.8,
      "illumination": 0.99,
      "interest": 1,
      "score": 100,
      "verdict": "go",
      "reasons": [
        {
          "code": "well-placed"
        }
      ],
      "best": {
        "time": "2026-11-10T05:10:00.000Z",
        "altitude": 48.7,
        "azimuth": 148.2,
        "direction": "SSE",
        "directionWords": "south-southeast",
        "height": "halfway up",
        "heightBand": "halfway"
      },
      "window": {
        "start": "2026-11-10T00:10:00.000Z",
        "end": "2026-11-10T07:09:10.637Z"
      },
      "windows": [
        {
          "start": "2026-11-10T00:10:00.000Z",
          "end": "2026-11-10T07:09:10.637Z"
        }
      ],
      "minutesVisible": 429,
      "finder": null,
      "views": [
        {
          "gear": "eyes",
          "gearType": "eyes",
          "visible": true,
          "margin": 7.66,
          "appearance": "brilliant point",
          "details": [],
          "rating": 1,
          "magnification": 1,
          "notes": [],
          "limitingMagnitude": 5.59,
          "verdict": "go"
        },
        {
          "gear": "binoculars-10x50",
          "gearType": "binoculars",
          "visible": true,
          "margin": 11.34,
          "appearance": "disc with moons",
          "details": [
            {
              "feature": "moons",
              "visible": true,
              "count": 4,
              "names": [
                "Io",
                "Europa",
                … 2 more
              ]
            }
          ],
          "rating": 2,
          "magnification": 10,
          "notes": [],
          "limitingMagnitude": 9.27,
          "verdict": "go"
        }
      ],
      "summary": "Jupiter: best at 05:10, 49° up in the south-southeast (visible 00:10–07:09); disc with moons in binoculars."
    },
    … 3 more
  ],
  "events": [
    {
      "id": "variable:algol-minimum:2026-11-10T00:27",
      "type": "variable",
      "subtype": "algol-minimum",
      "time": "2026-11-10T00:27:42.080Z",
      "window": {
        "start": "2026-11-09T21:57:42.080Z",
        "end": "2026-11-10T02:57:42.080Z"
      },
      "bodies": [
        {
          "id": "HIP 14576",
          "name": "Algol",
          "kind": "star",
          "magnitude": 2.1
        }
      ],
      "data": {
        "star": {
          "id": "HIP 14576",
          "name": "Algol",
          "designation": "β Per"
        },
        "magnitudes": {
          "normal": 2.1,
          "minimum": 3.4,
          "atBest": 3.4
        },
        "minimum": "2026-11-10T00:27:42.080Z",
        "fadingStarts": "2026-11-09T19:38:40.333Z",
        "backToNormal": "2026-11-10T05:16:43.826Z",
        "prediction": true,
        "uncertaintyMinutes": 8,
        "elements": {
          "epoch": 2459743,
          "period": 2.8674,
          "timeSystem": "BJD_TDB",
          "source": "Fitted to NASA TESS photometry (sectors 18, 58, 85; 19 minima, 2019–2024)",
          "fitted": "2026-11-09"
        }
      },
      "best": {
        "time": "2026-11-10T00:27:42.080Z",
        "altitude": 78.01,
        "azimuth": 213.01,
        "direction": "SSW",
        "sunAltitude": -54.52
      },
      "visibility": {
        "verdict": "visible",
        "reason": "ok"
      },
      "importance": 34,
      "summary": "Algol fades from 2.1 to 3.4; minimum at 00:27 on Tue 10 Nov, 78° up in the south-southwest. It stays near its faintest for about two hours and is back to norma…"
    }
  ],
  "passes": [
    {
      "id": 67232,
      "name": "SPACEMOBILE-006",
      "kind": "satellite",
      "magnitude": -0.1,
      "magnitudeSource": "estimated",
      "tier": "bright",
      "crewed": false,
      "start": {
        "time": "2026-11-10T05:00:15.286Z",
        "altitude": 61.5,
        "azimuth": 306.4,
        "direction": "NW",
        "directionWords": "northwest"
      },
      "max": {
        "time": "2026-11-10T05:00:50.286Z",
        "altitude": 76.5,
        "azimuth": 12.6,
        "direction": "NNE",
        "directionWords": "north-northeast"
      },
      "end": {
        "time": "2026-11-10T05:05:40.286Z",
        "altitude": 5.2,
        "azimuth": 97.7,
        "direction": "E",
        "directionWords": "east"
      },
      "rise": {
        "time": "2026-11-10T04:54:40.286Z",
        "altitude": 0,
        "azimuth": 281.29,
        "direction": "WNW",
        "directionWords": "west-northwest"
      },
      "set": {
        "time": "2026-11-10T05:06:56.223Z",
        "altitude": 0,
        "azimuth": 98.71,
        "direction": "E",
        "directionWords": "east"
      },
      "durationSeconds": 736,
      "visibleSeconds": 325,
      "startsInShadow": true,
      "endsInShadow": false,
      "observerSunAltitude": -19.2,
      "worth": {
        "score": 73,
        "label": "great",
        "reasons": [
          "bright",
          "high-pass",
          … 1 more
        ]
      },
      "summary": "SPACEMOBILE-006: Tue 10 Nov 05:00–05:05, from the northwest to the east, highest 77° in the north-northeast at 05:00, magnitude -0.1."
    }
  ],
  "timing": {
    "ms": 373,
    "candidates": 263,
    "evaluated": 86,
    "steps": 91,
    "parts": {
      "night": 57.8,
      "candidates": 12.4,
      "evaluate": 199.9,
      "satellites+events": 78.6,
      "views": 18.8
    }
  }
}
Also: POST
curl -X POST http://localhost:8080/api/plan \
  -H 'Content-Type: application/json' \
  -d '{"lat":51.48,"lon":0,"timeZone":"Europe/London","time":"2026-11-09T18:00:00Z","gear":["binoculars-10x50"],"bortle":5,"preferences":{"maxTargets":3,"kinds":["planet","dso"]}}'
Response · 200 · 301 lines
{
  "version": 2,
  "observer": {
    "lat": 51.48,
    "lon": 0,
    "elevation": 0
  },
  "timeZone": "Europe/London",
  "generated": "2026-11-09T19:03:15.888Z",
  "night": {
    "kind": "night",
    "timeZone": "Europe/London",
    "date": "2026-11-09",
    "start": "2026-11-09T16:19:34.305Z",
    "end": "2026-11-10T07:09:10.637Z",
    "hours": [
      {
        "time": "2026-11-09T16:19:34.305Z",
        "sky": "civil",
        "sunAltitude": -0.8,
        "moonAltitude": -4.4,
        "zenithSqm": 7.13,
        "nakedEyeLimit": -2.2,
        "weather": {
          "verdict": "go",
          "deepSky": "maybe",
          "highPower": "go",
          "cloud": 20,
          "transparency": "poor",
          "seeing": 1.5,
          "seeingLabel": "good",
          "reasons": [
            "poor-transparency"
          ]
        }
      },
      {
        "time": "2026-11-09T17:10:00.000Z",
        "sky": "nautical",
        "sunAltitude": -8.1,
        "moonAltitude": -11.2,
        "zenithSqm": 14.53,
        "nakedEyeLimit": 2.2,
        "weather": {
          "verdict": "go",
          "deepSky": "maybe",
          "highPower": "go",
          "cloud": 3,
          "transparency": "poor",
          "seeing": 1.5,
          "seeingLabel": "good",
          "reasons": [
            "poor-transparency"
          ]
        }
      },
      … 14 more
    ],
    "sun": {
      "set": "2026-11-09T16:19:34.305Z",
      "rise": "2026-11-10T07:09:10.637Z",
      "lowestAltitude": -55.59,
      "lowestTime": "2026-11-09T23:40:00.000Z"
    },
    "twilight": {
      "civilDusk": "2026-11-09T16:55:40.694Z",
      "nauticalDusk": "2026-11-09T17:35:46.539Z",
      "astronomicalDusk": "2026-11-09T18:14:44.663Z",
      "astronomicalDawn": "2026-11-10T05:13:36.915Z",
      "nauticalDawn": "2026-11-10T05:52:41.008Z",
      "civilDawn": "2026-11-10T06:32:54.834Z"
    },
    "darkness": {
      "start": "2026-11-09T18:14:44.663Z",
      "end": "2026-11-10T05:13:36.915Z",
      "hours": 10.98
    },
    "darkest": {
      "time": "2026-11-09T23:40:00.000Z",
      "sunAltitude": -55.59
    },
    "moon": {
      "rise": null,
      "set": null,
      "up": [],
      "illumination": 0.007,
      "phase": 0.0218,
      "phaseName": "Waxing Crescent",
      "ageDays": 0.64,
      "upDuringDarknessHours": 0
    },
    "segments": [
      {
        "start": "2026-11-09T16:19:34.305Z",
        "end": "2026-11-09T16:55:40.694Z",
        "sky": "civil",
        "moonUp": false
      },
      {
        "start": "2026-11-09T16:55:40.694Z",
        "end": "2026-11-09T17:35:46.539Z",
        "sky": "nautical",
        "moonUp": false
      },
      … 5 more
    ]
  },
  "conditions": {
    "sqm": 20,
    "bortle": 5,
    "extinction": 0.233,
    "seeing": "good",
    "darkestZenithSqm": 20,
    "weather": {
      "available": true,
      "verdict": "maybe",
      "score": 0.41,
      "clearHours": 7,
      "darkHours": 15,
      "cloudMean": 35,
      "bestWindow": {
        "start": "2026-11-10T01:00:00.000Z",
        "end": "2026-11-10T04:00:00.000Z",
        "hours": 3
      },
      "transparency": "bad",
      "seeing": "good",
      "dewRisk": "high",
      "reasons": [
        "haze",
        "poor-transparency",
        … 1 more
      ],
      "source": "open-meteo",
      "fetchedAt": "2026-11-09T18:48:27.812Z",
      "stale": false,
      "attribution": {
        "text": "Weather data by Open-Meteo.com",
        "url": "https://open-meteo.com/",
        "licence": "CC BY 4.0",
        "licenceUrl": "https://creativecommons.org/licenses/by/4.0/",
        "aerosols": "Aerosol optical depth: Copernicus Atmosphere Monitoring Service (CAMS), via Open-Meteo"
      }
    }
  },
  "verdict": {
    "rating": "fair",
    "score": 60,
    "weatherKnown": true,
    "window": {
      "start": "2026-11-10T00:40:00.000Z",
      "end": "2026-11-10T03:40:00.000Z"
    },
    "windows": [
      {
        "start": "2026-11-09T16:19:34.305Z",
        "end": "2026-11-09T17:40:00.000Z",
        "rating": "fair",
        "sky": "twilight",
        "reasons": [
          {
            "code": "clear",
            "cloud": 9
          },
          {
            "code": "twilight"
          },
          … 1 more
        ]
      },
      {
        "start": "2026-11-09T17:40:00.000Z",
        "end": "2026-11-09T18:40:00.000Z",
        "rating": "good",
        "sky": "dark",
        "reasons": [
          {
            "code": "clear",
            "cloud": 8
          },
          {
            "code": "dark"
          },
          … 1 more
        ]
      },
      … 6 more
    ],
    "reasons": [
      {
        "code": "partly-cloudy",
        "cloud": 35
      },
      {
        "code": "poor-transparency"
      },
      … 4 more
    ],
    "goodHours": 5.3,
    "darkHours": 12.3,
    "usableHours": 11.2,
    "summary": "Clear at dusk (16:19–18:40), cloudy until 22:40, then good until 07:09 (mostly clear); hazy; Venus, Jupiter, Mars and Saturn are still worth a look."
  },
  "gear": [
    {
      "id": "binoculars-10x50",
      "type": "binoculars",
      "name": "10×50 binoculars",
      "aperture": 50,
      "magnification": 10,
      "fieldDeg": 6.5
    }
  ],
  "targets": [
    {
      "rank": 1,
      "id": "jupiter",
      "kind": "planet",
      "name": "Jupiter",
      "type": "planet",
      "designation": null,
      "constellation": null,
      "magnitude": -2.1,
      "sizeArcmin": null,
      "angularDiameter": 36.8,
      "illumination": 0.99,
      "interest": 1,
      "score": 100,
      "verdict": "go",
      "reasons": [
        {
          "code": "well-placed"
        }
      ],
      "best": {
        "time": "2026-11-10T05:10:00.000Z",
        "altitude": 48.7,
        "azimuth": 148.2,
        "direction": "SSE",
        "directionWords": "south-southeast",
        "height": "halfway up",
        "heightBand": "halfway"
      },
      "window": {
        "start": "2026-11-10T00:10:00.000Z",
        "end": "2026-11-10T07:09:10.637Z"
      },
      "windows": [
        {
          "start": "2026-11-10T00:10:00.000Z",
          "end": "2026-11-10T07:09:10.637Z"
        }
      ],
      "minutesVisible": 429,
      "finder": null,
      "views": [
        {
          "gear": "binoculars-10x50",
          "gearType": "binoculars",
          "visible": true,
          "margin": 11.34,
          "appearance": "disc with moons",
          "details": [
            {
              "feature": "moons",
              "visible": true,
              "count": 4,
              "names": [
                "Io",
                "Europa",
                … 2 more
              ]
            }
          ],
          "rating": 2,
          "magnification": 10,
          "notes": [],
          "limitingMagnitude": 9.27,
          "verdict": "go"
        }
      ],
      "summary": "Jupiter: best at 05:10, 49° up in the south-southeast (visible 00:10–07:09); disc with moons in binoculars."
    },
    … 2 more
  ],
  "events": [],
  "passes": [],
  "timing": {
    "ms": 136,
    "candidates": 170,
    "evaluated": 79,
    "steps": 91,
    "parts": {
      "night": 52,
      "candidates": 1.2,
      "evaluate": 80.5,
      "satellites+events": 0,
      "views": 1.6
    }
  }
}

GET /api/weather

The hourly forecast for observing (cloud at three heights, visibility, humidity and dew point, wind, the jet stream for seeing, aerosols for transparency) from Open-Meteo, for your town: the server rounds the place to 0.1° before asking. Each night gets a verdict, its clear and dark hours and its best window.

With SKYMAP_OFFLINE=1: the last forecast kept, or hourly: [] with an errorIn the app with no connection: from the last answer keptServer cache: 30 minutes per 0.1° cell (memory and server/cache/weather/); if Open-Meteo cannot be reached, the last forecast with stale: true and its age.

ParameterDefaultMeaning
latrequiredLatitude in degrees, north positive (−90 to 90).
lonrequiredLongitude in degrees, east positive (−180 to 360).
days4Forecast days (1–7).
nights3Nights summarised (0–7).
tznearest town’sIANA time zone for local dates and words (Europe/London); also timeZone.
Example: GET Run it
curl 'http://localhost:8080/api/weather?lat=51.48&lon=0&tz=Europe/London&nights=2'
Response · 200 · 72 lines
{
  "location": {
    "lat": 51.5,
    "lon": 0,
    "elevation": 4
  },
  "fetchedAt": "2026-11-09T18:48:27.812Z",
  "ageMinutes": 15,
  "stale": false,
  "source": "open-meteo",
  "attribution": {
    "text": "Weather data by Open-Meteo.com",
    "url": "https://open-meteo.com/",
    "licence": "CC BY 4.0",
    "licenceUrl": "https://creativecommons.org/licenses/by/4.0/",
    "aerosols": "Aerosol optical depth: Copernicus Atmosphere Monitoring Service (CAMS), via Open-Meteo"
  },
  "aerosols": true,
  "hourly": [
    {
      "time": "2026-11-09T00:00:00.000Z",
      "cloudCover": 0,
      "cloudLow": 0,
      "cloudMid": 0,
      "cloudHigh": 0,
      "visibility": 1880,
      "humidity": 92,
      "dewPoint": 4.9,
      "temperature": 6.1,
      "windSpeed": 0.7,
      "windGusts": 1.5,
      "precipitationProbability": 0,
      "jetWind": 50.33,
      "aod": 0.16
    },
    … 95 more
  ],
  "timeZone": "Europe/London",
  "nights": [
    {
      "date": "2026-11-09",
      "start": "2026-11-09T16:19:30.414Z",
      "end": "2026-11-10T07:09:14.589Z",
      "kind": "night",
      "darkness": {
        "start": "2026-11-09T18:14:44.691Z",
        "end": "2026-11-10T05:13:36.915Z",
        "hours": 10.98
      },
      "available": true,
      "verdict": "maybe",
      "score": 0.41,
      "clearHours": 7,
      "darkHours": 15,
      "cloudMean": 35,
      "bestWindow": {
        "start": "2026-11-10T01:00:00.000Z",
        "end": "2026-11-10T04:00:00.000Z",
        "hours": 3
      },
      "transparency": "bad",
      "seeing": "good",
      "dewRisk": "high",
      "reasons": [
        "haze",
        "poor-transparency",
        … 1 more
      ]
    },
    … 1 more
  ]
}

Show attribution (“Weather data by Open-Meteo.com”, CC BY 4.0) wherever you show the forecast.

GET /api/alerts

What is worth an alert in the coming days from here — bright satellite passes, eclipses, close conjunctions and occultations, showers at their peak, bright comets, oppositions — each with an importance score, the reasons it matters (the forecast among them, when known) and an English summary. The push scheduler picks from these (and adds clear-night alerts from the plan’s verdict).

With SKYMAP_OFFLINE=1: without weather unless cachedIn the app with no connection: computed in the browserServer cache: Inputs from their caches.

ParameterDefaultMeaning
latrequiredLatitude in degrees, north positive (−90 to 90).
lonrequiredLongitude in degrees, east positive (−180 to 360).
elevation0Height above sea level in metres (−500 to 9000).
startnowStart of the window (same forms as time).
days70.5–30.
tznearest town’sIANA time zone for local dates and words (Europe/London); also timeZone.
horizonflatYour horizon as az:alt,az:alt,… or a JSON array of [az, alt] pairs, degrees.
bortle | sqmBortle 4Sky darkness: Bortle class 1–9, or a sky-quality reading in mag/arcsec² (14–22.5).
weather10: without the forecast.
satellites10: without passes.
minImportance400–100.
Example: GET Run it
curl 'http://localhost:8080/api/alerts?lat=51.48&lon=0&tz=Europe/London&start=2026-11-09T12:00:00Z&days=7'
Response · 200
{
  "observer": {
    "lat": 51.48,
    "lon": 0,
    "elevation": 0
  },
  "timeZone": "Europe/London",
  "start": "2026-11-09T12:00:00.000Z",
  "end": "2026-11-16T12:00:00.000Z",
  "candidates": [
    {
      "id": "alert:conjunction:mars-jupiter:2026-11-16",
      "kind": "conjunction",
      "source": {
        "type": "event",
        "id": "conjunction:mars-jupiter:2026-11-16"
      },
      "time": "2026-11-16T02:30:00.000Z",
      "window": {
        "start": "2026-11-16T01:00:00.000Z",
        "end": "2026-11-16T04:00:00.000Z"
      },
      "title": "Mars meets Jupiter",
      "importance": 60,
      "reasons": [
        {
          "code": "visible-here",
          "verdict": "visible"
        },
        {
          "code": "close-pair",
          "separation": 1.194
        }
      ],
      "tonight": false,
      "summary": "Mars passes 1.2° north of Jupiter on Mon 16 Nov at 02:03; best seen at 02:30, 32° up in the east-southeast."
    }
  ],
  "summary": "1 notable thing coming up; the biggest: Mars meets Jupiter, Mon 16 Nov at 02:30."
}

GET /api/gear

The gear presets (eyes, binoculars, telescopes, smart telescopes, cameras) with their derived optics; with id, one preset in full (eyepieces with magnification, true field and exit pupil; a camera’s field and pixel scale).

With SKYMAP_OFFLINE=1: worksIn the app with no connection: computed in the browserServer cache: None.

ParameterDefaultMeaning
id—One preset, e.g. dobsonian-200.
Example: GET Run it
curl 'http://localhost:8080/api/gear'
Response · 200 · 68 lines
{
  "presets": {
    "eyes": [
      {
        "id": "eyes",
        "name": "Eyes"
      }
    ],
    "binoculars": [
      {
        "id": "binoculars-7x35",
        "name": "7×35 binoculars"
      },
      {
        "id": "binoculars-7x50",
        "name": "7×50 binoculars"
      },
      … 3 more
    ],
    "telescope": [
      {
        "id": "refractor-70",
        "name": "70 mm refractor"
      },
      {
        "id": "refractor-80",
        "name": "80 mm ED refractor"
      },
      … 6 more
    ],
    "smart-telescope": [
      {
        "id": "seestar-s50",
        "name": "ZWO Seestar S50"
      },
      {
        "id": "seestar-s50-pro",
        "name": "ZWO Seestar S50 Pro"
      },
      … 9 more
    ],
    "camera": [
      {
        "id": "camera-ff-24mm",
        "name": "Full-frame camera, 24 mm f/1.4"
      },
      {
        "id": "camera-ff-50mm",
        "name": "Full-frame camera, 50 mm f/1.8"
      },
      … 3 more
    ]
  },
  "profiles": [
    {
      "id": "eyes",
      "type": "eyes",
      "name": "Eyes",
      "pupil": 6.2,
      "aperture": 6.2,
      "magnification": 1,
      "fieldDeg": 120,
      "transmission": 1,
      "resolutionArcsec": 60
    },
    … 29 more
  ]
}
Also: GET Run it
curl 'http://localhost:8080/api/gear?id=dobsonian-200'
Response · 200
{
  "id": "dobsonian-200",
  "type": "telescope",
  "name": "200 mm Dobsonian",
  "design": "newtonian",
  "aperture": 200,
  "focalLength": 1200,
  "obstruction": 0.2,
  "eyepieces": [
    {
      "focalLength": 30,
      "afov": 68,
      "magnification": 40,
      "trueField": 1.7,
      "exitPupil": 5
    },
    {
      "focalLength": 25,
      "afov": 52,
      "magnification": 48,
      "trueField": 1.0833,
      "exitPupil": 4.1667
    },
    … 2 more
  ],
  "pupil": 6.2,
  "computed": true,
  "fRatio": 6,
  "transmission": 0.768,
  "minUsefulMagnification": 32.2581,
  "maxUsefulMagnification": 350,
  "dawesArcsec": 0.58,
  "resolutionArcsec": 0.58
}

Errors: 404 unknown preset (the answer lists the known ones). The body is { "error": "…" }.

GET /api/gear/view

How a target looks right now through each piece of gear: visible or not, the margin above the limit, what you will see (“bright core”, “faint smudge”), a 0–5 rating and how it fits the field.

With SKYMAP_OFFLINE=1: worksIn the app with no connection: computed in the browserServer cache: None.

ParameterDefaultMeaning
targetrequiredAny object /api/position knows.
geareyesComma-separated presets.
latrequiredLatitude in degrees, north positive (−90 to 90).
lonrequiredLongitude in degrees, east positive (−180 to 360).
elevation0Height above sea level in metres (−500 to 9000).
timenowThe moment: ISO 8601 (2026-11-09T21:00:00Z), Unix seconds or milliseconds, or now.
bortle | sqmBortle 4Sky darkness: Bortle class 1–9, or a sky-quality reading in mag/arcsec² (14–22.5).
seeing2.5Arcseconds.
experienceaveragebeginner, average, expert.
Example: GET Run it
curl 'http://localhost:8080/api/gear/view?target=M31&gear=eyes,binoculars-10x50&lat=51.48&lon=0&time=2026-11-09T22:00:00Z&bortle=5'
Response · 200 · 49 lines
{
  "target": {
    "id": "M31",
    "name": "Andromeda Galaxy",
    "kind": "dso",
    "type": "galaxy",
    "magnitude": 3.4,
    "altitude": 78.5395,
    "azimuth": 211.7998,
    "direction": "SSW"
  },
  "sky": {
    "mpsas": 20,
    "nelm": 5.81,
    "zenithSqm": 20
  },
  "views": [
    {
      "gear": "eyes",
      "gearType": "eyes",
      "visible": true,
      "margin": 0.78,
      "appearance": "faint smudge",
      "details": [],
      "rating": 2,
      "magnification": 1,
      "notes": [],
      "limitingMagnitude": 5.81,
      "exitPupil": 6.2,
      "trueField": 120,
      "framing": "fits"
    },
    {
      "gear": "binoculars-10x50",
      "gearType": "binoculars",
      "visible": true,
      "margin": 3.03,
      "appearance": "bright core",
      "details": [],
      "rating": 4,
      "magnification": 10,
      "notes": [],
      "limitingMagnitude": 9.84,
      "exitPupil": 5,
      "trueField": 6.5,
      "framing": "fits"
    }
  ]
}

Errors: 400 missing target; 404 unknown target. The body is { "error": "…" }.

Alerts by web push

GET /api/alerts/vapid

This server’s VAPID public key, for PushManager.subscribe({ applicationServerKey }). The key pair is made on first use and kept in SKYMAP_PUSH_DIR.

With SKYMAP_OFFLINE=1: worksIn the app with no connection: needs this serverServer cache: The key pair is permanent (vapid.json, mode 600).

Example: GET Run it
curl 'http://localhost:8080/api/alerts/vapid'
Response · 200
{
  "publicKey": "BDf3V50c5lZW8VP0qrp-EPYsL9rCsiMZYfFoZVa-sLCYo9a3cWZay8F6MfxO9hnzk6MzNFRRUOoAu4V86pcwLdE"
}

POST DELETE /api/alerts/subscribe

POST stores a push subscription with what alerts need — the endpoint and its keys, a town-level place (rounded here to 0.1°), the time zone, the alert choices and reminders — and plans the next 36 hours of alerts. DELETE with { endpoint } removes it.

With SKYMAP_OFFLINE=1: stores and plans; sending needs the networkIn the app with no connection: needs this serverServer cache: One JSON file per subscription in SKYMAP_PUSH_DIR/alerts/; re-planned every 20 minutes.

JSON fieldDefaultMeaning
subscriptionrequiredPushSubscription.toJSON(): { endpoint, keys: { p256dh, auth } }. The endpoint must be https on a known push service (FCM, Mozilla, Apple, Windows; SKYMAP_PUSH_HOSTS adds more).
placerequired{ lat, lon }; stored rounded to 0.1°.
timeZoneUTCIANA zone for wording and quiet hours.
prefsall but clear nights{ kinds: { passes, showers, eclipses, conjunctions, comets, clearNight }, lead: { passes, events } (minutes), quiet: { on, from, to }, lang, hourCycle }.
reminders[]Explicit reminders the reader set.
muted[]Alert ids not to send.
Example: POST
curl -X POST http://localhost:8080/api/alerts/subscribe \
  -H 'Content-Type: application/json' \
  -d '{"subscription":{"endpoint":"https://fcm.googleapis.com/fcm/send/docs-example","keys":{"p256dh":"BNC2MAJfaiHoK4kUYIHkq_P-fiWxPS3Y9Gn1Ux_8UK1XNqUFNe6GhXh0G5u_aoKXeiwACTzWarKGJcJX89LD5FE","auth":"BwcHBwcHBwcHBwcHBwcHBw"}},"place":{"lat":51.4779,"lon":-0.0015},"timeZone":"Europe/London","prefs":{"kinds":{"passes":false,"showers":false,"eclipses":false,"conjunctions":false,"comets":false,"clearNight":false}}}'
Response · 200
{
  "id": "66aee911aa4eb63ab6a2eb49",
  "place": {
    "lat": 51.5,
    "lon": 0
  },
  "scheduled": []
}
Also: DELETE
curl -X DELETE http://localhost:8080/api/alerts/subscribe \
  -H 'Content-Type: application/json' \
  -d '{"endpoint":"https://fcm.googleapis.com/fcm/send/docs-example"}'
Response · 200
{
  "removed": true
}
Also: GET (405) Run it
curl 'http://localhost:8080/api/alerts/subscribe'
Response · 405
{
  "error": "Use POST to subscribe or DELETE to unsubscribe"
}

Errors: 400 a bad subscription, place or endpoint; 405 GET; 503 over 2,000 subscriptions on this server. The body is { "error": "…" }.

POST /api/alerts/status

Is this endpoint subscribed, and what is scheduled for it.

With SKYMAP_OFFLINE=1: worksIn the app with no connection: needs this serverServer cache: None.

JSON fieldDefaultMeaning
endpointrequiredThe push endpoint.
Example: POST
curl -X POST http://localhost:8080/api/alerts/status \
  -H 'Content-Type: application/json' \
  -d '{"endpoint":"https://fcm.googleapis.com/fcm/send/docs-example"}'
Response · 200
{
  "subscribed": true,
  "place": {
    "lat": 51.5,
    "lon": 0
  },
  "timeZone": "Europe/London",
  "prefs": {
    "kinds": {
      "passes": false,
      "showers": false,
      "eclipses": false,
      "conjunctions": false,
      "comets": false,
      "clearNight": false
    },
    "lead": {
      "passes": 10,
      "events": 60
    },
    "quiet": {
      "on": false,
      "from": "23:00",
      "to": "07:00"
    },
    "lang": "en",
    "hourCycle": "h23"
  },
  "scheduled": []
}
Also: POST
curl -X POST http://localhost:8080/api/alerts/status \
  -H 'Content-Type: application/json' \
  -d '{"endpoint":"https://fcm.googleapis.com/fcm/send/not-subscribed"}'
Response · 200
{
  "subscribed": false,
  "scheduled": []
}

Errors: 400 missing endpoint; 405 GET. The body is { "error": "…" }.

POST /api/alerts/test

Sends one test notification to a subscribed endpoint now. Answers { status, ok, gone } with the push service’s HTTP status; a subscription the push service says is gone is deleted.

With SKYMAP_OFFLINE=1: needs the networkIn the app with no connection: needs this serverServer cache: None.

JSON fieldDefaultMeaning
endpointrequiredA subscribed push endpoint.
Example: POST (404)
curl -X POST http://localhost:8080/api/alerts/test \
  -H 'Content-Type: application/json' \
  -d '{"endpoint":"https://fcm.googleapis.com/fcm/send/not-subscribed"}'
Response · 404
{
  "error": "Not subscribed"
}

Errors: 404 not subscribed; 405 GET. The body is { "error": "…" }.

Guide

GET /api/guide/status

Whether this server can answer in more depth (it has ANTHROPIC_API_KEY), and with which model. Never an error: without a key, available: false.

With SKYMAP_OFFLINE=1: worksServer cache: None.

Example: GET Run it
curl 'http://localhost:8080/api/guide/status'
Response · 200
{
  "available": false,
  "offline": true
}

With a key: { "available": true, "offline": true, "model": "claude-opus-5-5" } (or SKYMAP_GUIDE_MODEL).

GET /api/guide/answer

The guide’s offline engine (the same one the app runs in the browser): a plain-language answer about the sky from here, with what the app would do (fly, point, select), follow-up questions and the claims behind it. No language model is involved.

With SKYMAP_OFFLINE=1: worksIn the app with no connection: computed in the browserServer cache: None.

ParameterDefaultMeaning
qrequiredThe question, in English: “what is that bright one in the west?”, “can I see Saturn tonight?”, “when does the ISS pass?”.
latrequiredLatitude in degrees, north positive (−90 to 90).
lonrequiredLongitude in degrees, east positive (−180 to 360).
elevation0Height above sea level in metres (−500 to 9000).
timenowThe moment: ISO 8601 (2026-11-09T21:00:00Z), Unix seconds or milliseconds, or now.
tznearest town’sIANA time zone for local dates and words (Europe/London); also timeZone.
langenLanguage code passed to the engine.
Example: GET Run it
curl 'http://localhost:8080/api/guide/answer?q=where%20is%20saturn%3F&lat=51.48&lon=0&time=2026-11-09T21:00:00Z&tz=Europe/London'
Response · 200 · 71 lines
{
  "question": "where is saturn?",
  "intent": "locate",
  "sub": null,
  "confidence": 0.92,
  "text": "Saturn is in the south, halfway up (39°).",
  "speech": "Saturn is in the south, halfway up (39 degrees).",
  "subject": {
    "id": "saturn",
    "kind": "planet",
    "name": "Saturn"
  },
  "actions": [
    {
      "type": "fly",
      "target": {
        "kind": "body",
        "id": "saturn"
      }
    },
    {
      "type": "annotate",
      "spec": {
        "type": "pointer",
        "target": {
          "kind": "body",
          "id": "saturn"
        },
        "text": "Saturn"
      }
    },
    … 1 more
  ],
  "followUps": [
    {
      "text": "When does it set?",
      "query": {
        "intent": "visibility",
        "sub": "set",
        "slots": {
          "object": {
            "id": "saturn",
            "kind": "planet",
            "name": "Saturn",
            "title": "Saturn",
            "ref": {
              "kind": "body",
              "id": "saturn"
            },
            "score": 1,
            "matched": "Saturn",
            "fuzzy": false
          }
        }
      }
    },
    … 2 more
  ],
  "claims": [
    {
      "id": "saturn",
      "name": "Saturn",
      "time": "2026-11-09T21:00:00.000Z",
      "altitude": 39.4
    }
  ],
  "data": {},
  "timeZone": "Europe/London",
  "time": "2026-11-09T21:00:00.000Z",
  "ms": 124
}

Errors: 400 missing q. The body is { "error": "…" }.

POST GET /api/guide/ask

Answers in more depth, from Claude (Anthropic’s Messages API) through this server, only when it has ANTHROPIC_API_KEY. POST starts a question and returns { id }; GET ?id=…&since=n polls it: { events: [{ type: "tool", name, label }], next, done, answer? | error? }. The model uses the app’s own libraries as tools, and every number in its answer is checked against their results (grounded); the app does not show an answer that fails.

With SKYMAP_OFFLINE=1: sends to Anthropic: never offlineIn the app with no connection: needs this serverServer cache: Jobs live 5 minutes in memory; questions are never logged.

JSON fieldDefaultMeaning
questionrequiredUp to 500 characters are used.
placerequired{ lat, lon, name?, timeZone? }; rounded again to 0.1° here.
timenowThe sky’s time, ISO.
langenLanguage to answer in.
offline—The offline engine’s { intent, text }, as context.
Example: POST (404)
curl -X POST http://localhost:8080/api/guide/ask \
  -H 'Content-Type: application/json' \
  -d '{"question":"Why is Saturn so bright?","place":{"lat":51.5,"lon":0},"time":"2026-11-09T21:00:00Z","lang":"en"}'
Response · 404
{
  "error": "Answers in more depth are not available on this server"
}
Also: GET (404) Run it
curl 'http://localhost:8080/api/guide/ask?id=g123'
Response · 404
{
  "error": "No such question (it may have expired)"
}

A finished answer: { text, grounded, unverified: [numbers not found in the tools’ results], model, tools: [names] }.

Errors: 404 no key on this server (POST), or an unknown or expired id (GET); 400 missing question or place; 429 more than 30 questions in 10 minutes. The body is { "error": "…" }.

Examples

Small, commented pages in public/examples/, each a starting point to copy. They use only this server and the library.

Running the server

node server.js                       # or npm start → http://localhost:8080, and on your network
PORT=3000 HOST=127.0.0.1 node server.js

No npm install is needed to run: the libraries are vendored in public/vendor/ and the catalogues are prebuilt in public/data/. The server reads these settings from its environment:

VariableDefaultWhat it does
PORT8080The port to listen on.
HOST0.0.0.0The interface: all of them by default, so a wall tablet on your network can open the app; 127.0.0.1 keeps it to this computer.
SKYMAP_TLS_CERT, SKYMAP_TLS_KEYunsetPaths to a PEM certificate and its key: the server speaks HTTPS, which phones need for the compass, the motion sensors and the camera (localhost counts as secure; a network address does not).
SKYMAP_OFFLINEunset1 (or true, yes, on): no outbound requests at all: no weather, satellite or comet downloads, no guide model calls, no web push. Any other value, 0 included, means off. See Offline.
ANTHROPIC_API_KEYunsetTurns on the guide’s answers in more depth, written by Claude through Anthropic’s Messages API. Without it the guide answers offline only and the app hides the button.
SKYMAP_GUIDE_MODELclaude-opus-5-5The model for those answers.
SKYMAP_GUIDE_EFFORTmediumThe effort level sent with each request.
SKYMAP_GUIDE_FALLBACKSon0 turns off the API’s server-side fallback to another model when the first declines (never used with Haiku models).
SKYMAP_GUIDE_DAILY_MAX200The most questions answered in more depth per day (UTC) for the whole server. Besides it: 6 at once per client, then one every 2 minutes; 30 in any 10 minutes and 8 at a time for the server. Each answer logs its token usage, never the question.
SKYMAP_ALERTSonoff turns web push off: the alert routes answer 404 { error, available: false }, nothing is written and the scheduler does not run. Alerts in the open page keep working.
SKYMAP_PUSH_DIRserver/cacheWhere web-push subscriptions (alerts/) and the VAPID key pair (vapid.json) are kept.
SKYMAP_PUSH_SUBJECTmailto:sky-map@localhostThe VAPID contact (mailto: or https:) the push services may use to reach whoever runs the server. Set your own.
SKYMAP_PUSH_HOSTSemptyMore push-service host suffixes, comma-separated. Built in: fcm.googleapis.com, push.services.mozilla.com, push.apple.com, notify.windows.com. Pushes go nowhere else.
SKYMAP_PUSH_ALLOW_LOCALoff1 allows local and plain-http push endpoints. For tests only.
SKYMAP_WEATHER_DAILY_MAX8000Upstream calls to Open-Meteo per day (UTC), two per forecast (the free tier is under 10,000). Per client, 20 new forecast cells at once, then 20 an hour; the alert scheduler may use half the day at most. Past a limit the last forecast kept is served, marked stale.
SKYMAP_TRUST_PROXY0How many proxies in front append to X-Forwarded-For (1 for a load balancer, 2 for a CDN in front of one): the client is the address that many entries from the right, and X-Forwarded-Proto: https turns on HSTS. Unset, the client is the socket's address.
SKYMAP_RATE_LIMIT1Scales the per-client rate limits (static files, the API, heavy routes such as passes, plans and events, alert subscribe and test calls); 0 or off turns them off. Over a limit: 429 with Retry-After; heavy computations beyond two at a time and 16 waiting: 503 with Retry-After.
SKYMAP_ALLOWED_ORIGINSemptyOther origins allowed to make POST, PUT and DELETE requests, comma-separated (e.g. https://localhost,capacitor://localhost for app wrappers). Writes must be JSON and otherwise come from this site or from no browser; GET routes stay open to every origin.
SKYMAP_KEEP_ALIVE_MS65000How long an idle keep-alive connection stays open: above the idle timeout of a load balancer in front.
SKYMAP_ACCESS_LOGoff1 logs one line per request: method, path without the query, status, milliseconds and bytes. Never addresses or queries.
SKYMAP_USER_AGENTSkyMap/2.0 (sky map server)The User-Agent of the server's own downloads (Open-Meteo, CelesTrak, the Minor Planet Center).
SKYMAP_SATELLITE_SOURCECelesTrakAnother address to fetch satellite elements from, answering CelesTrak's own query (?GROUP=visual&FORMAT=json) with the same JSON. For a host CelesTrak does not answer (from Google Cloud the connection times out); deploy/relay/worker.js is a relay to deploy on Cloudflare.

Satellite elements are cached in server/cache/ (refreshed from CelesTrak at most every 6 hours, with a bundled snapshot), comet elements for 24 hours (with a bundled extract) and forecasts for 30 minutes per 0.1° cell. The console prints the address to open, on this computer and on your network.

Accuracy

Positions are checked against independent references. The latest runs (10 November 2026), all within tolerance:

CheckAgainstToleranceLatest
node test/accuracy.mjsJPL Horizons: Sun, Moon and planets, 5 sites × 6 dates 1990–2035 (270 positions)1′worst 18.4″ (Uranus); every comparison
python3 test/accuracy_stars.pyastropy: 10 bright stars, 3 sites, 2 dates (60 positions)10″ (aim 4″)worst 3.8″, RMS 2.0″
python3 test/accuracy_passes.pyskyfield (an independent SGP4): 6 satellites, 4 sites, 24 h, both pass finders (192 passes)2 s, 0.1°worst 0.65 s, 0.004°
node test/accuracy_events.mjsUSNO seasons and Moon phases; NASA eclipse contacts and the 2026 Aug 12 path; IMO shower peaks; JPL Horizons conjunctions, oppositions, elongations and comets; published Algol minima1 min to 1 h by kind99 Moon phases within 79 s; eclipse contacts within 38 s; 16 shower peaks within 31 min; comets within 56″

Privacy

The browser talks only to this server. Anything that goes further leaves at town level: the weather (the server rounds the place to 0.1°, about 11 km, before asking Open-Meteo), alerts by web push (the server keeps the push endpoint, a 0.1° place, the time zone and the alert choices; the encrypted alerts go through the browser’s push service) and, only when the server has a key and the reader has chosen “Ask in more depth”, the guide’s question with a 0.1° place to Anthropic. No analytics, no tracking, no cookies. The full account is in the app (Settings › About › Privacy) and in README.md, in the project folder.

Credits and licences

Sansar Maps is built on open data and open software: the HYG and Gaia star catalogues, OpenNGC, Stellarium’s sky cultures, Wikidata’s names, Wikimedia Commons pictures, NASA’s Milky Way and Moon, GeoNames, Open-Meteo, CelesTrak, the Minor Planet Center, Astronomy Engine, satellite.js, three.js, and the Source Serif, Source Sans and Inter typefaces. Every source and licence is listed in the app (Settings › About › Credits, searchable, from credits.json) and in README.md.

Non-commercial data. The deep stars (about 3.4 million Gaia DR3 stars, ESA/Gaia/DPAC, in public/data/deepstars/ and the two deep-star download packs) are licensed CC BY-NC 3.0 IGO: non-commercial use only. Commercial use needs ESA’s permission, or a deep-star catalogue under another licence. The Hipparcos measurements in the base star catalogue (HYG, CC BY-SA 4.0) come from ESA under the same terms.