Skip to content

Celestial Objects API

The Celestial Objects API covers everything beyond satellites: planets, stars, deep sky objects (DSOs), comets, the Sun, and the Moon. Object positions are computed in real time using the Skyfield library.

Search across all target types — satellites, celestial objects, and built-in solar system bodies. This is the primary unified search endpoint used by the target picker.

GET /api/targets/search
ParameterTypeDefaultDescription
qstring""Search query. Empty string returns browse-mode results
typestringFilter by type: satellite, star, dso, comet, planet, sun, moon, meteor_shower
limitint50Max results (max 200)
{
"query": "vega",
"results": [
{
"name": "Vega",
"target_type": "star",
"target_id": "42",
"description": "Alpha Lyrae - brightest star in Lyra",
"magnitude": 0.03
}
],
"count": 1
}
Terminal window
# Browse all planets and solar system bodies
curl "https://space.warehack.ing/api/targets/search"
# Search for deep sky objects
curl "https://space.warehack.ing/api/targets/search?q=andromeda&type=dso"
# Search for comets
curl "https://space.warehack.ing/api/targets/search?q=halley&type=comet"

Get the current position of any target object (computed in real time from the observer’s location).

GET /api/targets/{target_type}/{target_id}/position
ParameterTypeDescription
target_typestringOne of: satellite, planet, star, dso, comet, sun, moon
target_idstringObject identifier (NORAD ID for satellites, DB ID for celestial objects, name for planets)
{
"name": "Mars",
"target_type": "planet",
"target_id": "mars",
"altitude_deg": 42.3,
"azimuth_deg": 185.7,
"distance_km": 225000000.0,
"ra_hours": 14.23,
"dec_deg": -12.45,
"is_above_horizon": true,
"timestamp": "2026-02-14T22:30:00Z"
}
Terminal window
# Current position of Mars
curl "https://space.warehack.ing/api/targets/planet/mars/position"
# Current position of the ISS
curl "https://space.warehack.ing/api/targets/satellite/25544/position"
# Current position of a star by DB ID
curl "https://space.warehack.ing/api/targets/star/42/position"

Find objects similar to a given target using cross-type vector similarity. This searches across all four embedding stores (satellites, celestial objects, frequencies, and launches) to find semantically related objects.

GET /api/targets/{target_type}/{target_id}/related
ParameterTypeDescription
target_typestringSource object type
target_idstringSource object identifier
ParameterTypeDefaultDescription
limitint6Max results (max 20)
{
"source_type": "satellite",
"source_id": "25544",
"results": [
{
"name": "Tiangong",
"target_type": "satellite",
"target_id": "48274",
"description": null,
"similarity": 0.8921,
"url": "/catalog/satellite/48274"
}
],
"count": 1
}

satellite, planet, star, dso, comet, frequency, launch, sun, moon


List all objects currently above a minimum altitude from the observer’s location.

GET /api/sky/up
ParameterTypeDefaultDescription
min_altfloat10.0Minimum altitude in degrees
Terminal window
# What's visible right now above 10 degrees
curl "https://space.warehack.ing/api/sky/up"
# Lower the minimum to see more objects
curl "https://space.warehack.ing/api/sky/up?min_alt=5"

Get objects that will be observable during tonight’s dark hours.

GET /api/sky/tonight
Terminal window
curl "https://space.warehack.ing/api/sky/tonight"

Get rise and set times for a named target.

GET /api/sky/rise-set
ParameterTypeDefaultDescription
targetstringTarget name (e.g. mars, vega)
target_typestringplanetType of target
daysint1Number of days to compute (max 7)
Terminal window
# When does Mars rise and set today?
curl "https://space.warehack.ing/api/sky/rise-set?target=mars"
# Rise/set times for Vega over the next 3 days
curl "https://space.warehack.ing/api/sky/rise-set?target=vega&target_type=star&days=3"

Retrieve all comets in the database with their orbital parameters.

GET /api/comets
{
"count": 1024,
"comets": [
{
"id": 1,
"name": "C/1995 O1 (Hale-Bopp)",
"designation": "C/1995 O1",
"perihelion_au": 0.914,
"eccentricity": 0.995,
"inclination_deg": 89.43,
"magnitude_g": 4.0,
"magnitude_k": 4.0,
"perihelion_year": 1997,
"perihelion_month": 4,
"perihelion_day": 1.14
}
]
}

GET /api/comets/{comet_id}

Returns full orbital elements including argument of perihelion, longitude of ascending node, epoch, and current computed RA/Dec.


GET /api/comets/count
{
"count": 1024
}

Trigger a background refresh of comet data from the Minor Planet Center (MPC).

POST /api/comets/refresh

Retrieve an image for a comet, resolved through a tiered system:

  1. NASA Image Library — real comet photographs for famous comets
  2. SkyView DSS2 — sky survey cutout at the comet’s computed RA/Dec
  3. Transparent placeholder — returned as 404 if no image is available
GET /api/images/comet/{comet_id}
ParameterTypeDefaultDescription
pixelsint300Image size in pixels (50-800)
fovfloat0.5Field of view in degrees (0.1-5)
HeaderDescription
X-Image-Sourcenasa, skyview-coords
X-Image-CreditAttribution string
X-Comet-RAComputed RA in degrees (SkyView)
X-Comet-DecComputed Dec in degrees (SkyView)

Proxy endpoint for SkyView observatory survey cutouts. This avoids browser CORS/ORB issues with SkyView’s redirect-based CGI pipeline.

GET /api/images/skyview
ParameterTypeDefaultDescription
namestringObject name (SIMBAD-resolvable)
pixelsint200Image size in pixels (50-800)
fovfloat0.5Field of view in degrees (0.01-10)
Terminal window
# Get a DSS2 Red survey image of M31
curl -o m31.jpg "https://space.warehack.ing/api/images/skyview?name=M31&pixels=400&fov=2.0"