Skip to content

Images API

The Images API provides contextual imagery for celestial objects and satellites. Each endpoint uses a tiered resolution strategy, starting with curated photo archives and falling back through progressively more general sources. All image responses include an X-Image-Source header indicating which tier served the result, and X-Image-Credit where attribution is available.

Proxies NASA SkyView observatory cutouts (DSS2 Red survey) to the client, avoiding browser CORS and Opaque Response Blocking (ORB) issues. SkyView uses a 302-redirect CGI pipeline that returns HTML on name-resolution failures — which triggers Chrome’s ORB protection when fetched directly from the browser.

GET /api/images/skyview
ParameterTypeDefaultRangeDescription
namestringmin 1 charTarget name, SIMBAD-resolvable (e.g. “M31”, “Vega”, “NGC 7000”)
pixelsinteger20050 – 800Image size in pixels
fovfloat0.50.01 – 10.0Field of view in degrees

Returns a JPEG image with the following headers:

HeaderValue
Content-Typeimage/jpeg
Cache-Controlpublic, max-age=604800, immutable (1 week)
X-Image-Sourceskyview

On failure (unresolvable name, timeout), returns a transparent 1x1 PNG with status 404 and a 1-hour cache TTL.


Tiered comet image resolution. The endpoint attempts three sources in order to find the best available image for a given comet.

GET /api/images/comet/{comet_id}
ParameterTypeDescription
comet_idintegerInternal comet ID (path parameter)
ParameterTypeDefaultRangeDescription
pixelsinteger30050 – 800Image size in pixels
fovfloat0.50.1 – 5.0Field of view in degrees
  1. NASA Image Library — Searches for real comet photographs by extracting the common name from the MPC designation (e.g. “Hale-Bopp” from C/1995 O1 (Hale-Bopp)). Returns actual photos for roughly 100 well-known comets.

  2. SkyView DSS2 cutout — Computes the comet’s current RA/Dec position using Skyfield orbital mechanics (Kepler’s third law from MPC orbital elements), then fetches the DSS2 Red star field at those coordinates. The image shows the sky region where the comet currently sits.

  3. Transparent placeholder — Returns a 1x1 transparent PNG with status 404 when both tiers above fail.

HeaderValuesDescription
X-Image-Sourcenasa or skyview-coordsWhich tier served the image
X-Image-CreditNASA or SkyView/NASA GSFC (DSS2)Attribution string
X-Comet-RAe.g. 187.2340Right ascension in degrees (tier 2 only)
X-Comet-Dece.g. -12.4560Declination in degrees (tier 2 only)
TierCache TTL
NASA photo hit1 week
SkyView cutout hit24 hours
Placeholder miss1 hour
NASA search result24 hours

Tiered satellite image resolution. Every satellite gets a meaningful image — there are no transparent placeholders in the success path. If curated sources fail, the endpoint generates a unique orbital diagram from the satellite’s TLE data.

GET /api/images/satellite/{norad_id}
ParameterTypeDescription
norad_idintegerNORAD catalog number (path parameter)
  1. Wikipedia / Wikimedia Commons — Searches Wikipedia for a matching article, validates that it describes a space object (keyword matching against terms like “satellite”, “spacecraft”, “telescope”, “probe”), and extracts the article’s lead thumbnail. Covers roughly 1000+ named satellites.

  2. NASA Image Library — Searches for spacecraft photography. Results undergo relevance validation: the title or description must mention the search term. Covers roughly 200+ well-known spacecraft.

  3. Generated orbital diagram — A unique SVG visualization computed from the satellite’s TLE line 2 data. The diagram shows the orbit’s shape, altitude, inclination, and a deterministic starfield seeded from the NORAD ID for visual consistency across requests.

HeaderValues
X-Image-Sourcewikipedia, nasa, or orbital-diagram
X-Image-CreditWikimedia Commons, NASA, or Craft (TLE)
Content-Type: image/jpeg (tiers 1 and 2)
Content-Type: image/svg+xml (tier 3 — orbital diagram)

When tiers 1 and 2 fail, the SVG diagram is generated entirely from TLE line 2 orbital elements:

TLE ParameterVisual Effect
InclinationProjected orbit tilt and ellipse height
EccentricityOrbit shape (circular → elongated)
Mean anomalySatellite position along the orbit path
Mean motionSemi-major axis via Kepler’s third law → altitude classification

Orbit classification by altitude:

AltitudeClassificationColor
< 2,000 kmLEOBlue
2,000 – 20,200 kmMEOGreen
20,200 – 37,000 kmGEOAmber
> 37,000 kmHEORed
TierCache TTL
Wikipedia photo1 week
NASA photo1 week
Orbital SVG24 hours
Image search result24 hours