Index Statistics

...
Loading
Query Interface
API Documentation

Region Query

Results

Run a query to see results

REST API Reference

All endpoints return JSON with {"success": true, "data": ...} on success or {"success": false, "error": "..."} on failure.

GET /api/query/paginated

Query stars in a rectangular region with pagination. Returns full star details (RA, Dec, magnitude, parallax, color).

ParameterTypeDescription
ra_min requiredf64Minimum Right Ascension (0-360°)
ra_max requiredf64Maximum Right Ascension (0-360°)
dec_min requiredf64Minimum Declination (-90 to 90°)
dec_max requiredf64Maximum Declination (-90 to 90°)
max_mag requiredf32Maximum magnitude filter (brighter = lower)
offset requiredusizeSkip first N results
limit requiredusizeMaximum results to return

Example

curl "https://lumen.deepskies.observer/api/query/paginated?ra_min=180&ra_max=181&dec_min=0&dec_max=1&max_mag=15&offset=0&limit=10"

Response

{
  "success": true,
  "data": {
    "stars": [
      {
        "source_id": 3698956337898276352,
        "ra": 180.0526,
        "dec": 0.0042,
        "magnitude": 13.99,
        "parallax": 1.02,
        "bp_rp": 0.84
      }
    ],
    "total_count": 4187,
    "offset": 0,
    "has_more": true
  }
}
GET /api/query/binary

Binary endpoint for efficient bulk data transfer. Returns raw bytes optimized for GPU upload. Same parameters as /api/query/paginated.

Binary Format

Header (12 bytes):
  - star_count:  u32 LE (4 bytes)
  - total_count: u32 LE (4 bytes)
  - has_more:    u8     (1 byte)
  - padding:     3 bytes

Per Star (28 bytes):
  - source_id:  u64 LE (8 bytes)
  - ra:         f32 LE (4 bytes)
  - dec:        f32 LE (4 bytes)
  - magnitude:  f32 LE (4 bytes)
  - parallax:   f32 LE (4 bytes)
  - bp_rp:      f32 LE (4 bytes)

Example (JavaScript)

const response = await fetch('/api/query/binary?ra_min=180&ra_max=181&dec_min=0&dec_max=1&max_mag=15&offset=0&limit=1000');
const buffer = await response.arrayBuffer();
const view = new DataView(buffer);

const starCount = view.getUint32(0, true);
const totalCount = view.getUint32(4, true);
const hasMore = view.getUint8(8) === 1;

for (let i = 0; i < starCount; i++) {
    const offset = 12 + i * 28;
    const sourceId = view.getBigUint64(offset, true);
    const ra = view.getFloat32(offset + 8, true);
    const dec = view.getFloat32(offset + 12, true);
    const mag = view.getFloat32(offset + 16, true);
    // ...
}
GET /api/count

Count stars in a region without returning data. Fast way to check query size before fetching.

ParameterTypeDescription
ra_minf64Minimum RA
ra_maxf64Maximum RA
dec_minf64Minimum Dec
dec_maxf64Maximum Dec
curl "https://lumen.deepskies.observer/api/count?ra_min=0&ra_max=360&dec_min=-90&dec_max=90"
{"success": true, "data": 1347293721}
GET /api/count/filtered

Count stars with magnitude filter.

ParameterTypeDescription
ra_min, ra_max, dec_min, dec_maxf64Region bounds
max_magf32Maximum magnitude
curl "https://lumen.deepskies.observer/api/count/filtered?ra_min=180&ra_max=181&dec_min=0&dec_max=1&max_mag=15"
{"success": true, "data": 20}
GET /api/nearest

Find K nearest stars to a point.

ParameterTypeDescription
ra requiredf64Right Ascension (0-360°)
dec requiredf64Declination (-90 to 90°)
kusizeNumber of nearest stars (default: 10)
curl "https://lumen.deepskies.observer/api/nearest?ra=180&dec=0&k=5"
GET /api/stats

Get index statistics including entry count and memory usage.

curl "https://lumen.deepskies.observer/api/stats"
{
  "success": true,
  "data": {
    "num_entries": 1347293721,
    "morton_bytes": 6245881660,
    "source_id_bytes": 10701874505,
    "magnitude_bytes": 1347293721,
    "parallax_bytes": 2694587442,
    "color_bytes": 1347293721,
    "total_bytes": 22336931049
  }
}
GET /api/ping

Health check endpoint.

curl "https://lumen.deepskies.observer/api/ping"
{"success": true, "data": "pong"}

Star Data Reference

FieldTypeUnitDescription
source_idu64-Gaia DR3 unique source identifier
raf64degreesRight Ascension (ICRS J2016.0)
decf64degreesDeclination (ICRS J2016.0)
magnitudef32magG-band mean magnitude
parallaxf32 | nullmasParallax (null if not available, ~20% have parallax)
bp_rpf32 | nullmagBP-RP color index (blue stars < 0, red stars > 2)

Color Classification (BP-RP)

RangeColorSpectral Type
< 0.0BlueO, B (hot, massive)
0.0 - 0.8WhiteA, F (hot-warm)
0.8 - 1.4YellowG (Sun-like)
1.4 - 2.0OrangeK (cool)
> 2.0RedM (cool, small)

Distance from Parallax

distance_parsecs = 1000 / parallax_mas
distance_light_years = distance_parsecs * 3.26156