Skip to content

Search API

The Search API provides a unified interface for finding objects across the entire Craft catalog. It supports three search modes: semantic (natural language via pgvector embeddings), text (ILIKE pattern matching), and hybrid (both, with merged and boosted results).

The primary search endpoint. Searches across satellites, celestial objects (stars, DSOs, comets), launches, and frequencies in a single query.

GET /api/search
ParameterTypeDefaultDescription
qstringSearch query (min 1 character, required)
typesstringComma-separated type filter (e.g. satellite,star)
limitint20Max results (max 50)
modestringhybridSearch mode: hybrid, semantic, or text

Queries can include type prefixes to filter results without the types parameter:

PrefixFilters to
/satsatellite
/starstar
/dsodso
/launchlaunch
/freqfrequency
/cometcomet

For example, /sat ISS is equivalent to q=ISS&types=satellite.

{
"query": "weather satellite",
"results": [
{
"name": "NOAA 20 (JPSS-1)",
"target_type": "satellite",
"target_id": "43013",
"description": null,
"magnitude": null,
"score": 0.8234,
"source": "semantic",
"altitude_deg": 32.5,
"countdown_seconds": null,
"frequency_mhz": null,
"groups": ["weather"],
"url": "/catalog/satellite/43013"
},
{
"name": "GOES 16",
"target_type": "satellite",
"target_id": "41866",
"description": null,
"magnitude": null,
"score": 0.7891,
"source": "both",
"altitude_deg": -15.2,
"countdown_seconds": null,
"frequency_mhz": null,
"groups": ["weather", "geo"],
"url": "/catalog/satellite/41866"
}
],
"count": 2,
"mode": "hybrid"
}
FieldTypeDescription
namestringObject name
target_typestringsatellite, star, dso, comet, planet, launch, frequency
target_idstringObject identifier
descriptionstring|nullShort description
magnitudefloat|nullVisual magnitude (lower = brighter)
scorefloatRelevance score (0-1, higher is better)
sourcestringMatch type: semantic, text, or both
altitude_degfloat|nullCurrent altitude from observer (satellites only)
countdown_secondsfloat|nullSeconds until launch (launches only)
frequency_mhzfloat|nullFrequency in MHz (frequencies only)
groupslist|nullSatellite groups (satellites only)
urlstringFrontend catalog URL
ModeBehavior
hybridRuns both semantic and text search, merges results, boosts dual matches
semanticVector cosine similarity only. Falls back to text if embeddings fail
textILIKE pattern matching only. No embedding service required
  • Semantic results: Score is 1 - cosine_distance (closer to 1 = more relevant)
  • Text results: Fixed score of 0.5
  • Dual matches: When an object appears in both semantic and text results, its score is boosted by 0.1 and the source is marked as both

Results are sorted by score descending and deduplicated by (target_type, target_id).

Satellite results are enriched with live altitude data from the Skyfield engine. The altitude_deg field shows whether the satellite is currently above (> 0) or below (< 0) the observer’s horizon.

Terminal window
# Natural language search
curl "https://space.warehack.ing/api/search?q=amateur+radio+satellites"
# Type-filtered search
curl "https://space.warehack.ing/api/search?q=ISS&types=satellite"
# Using type shortcut
curl "https://space.warehack.ing/api/search?q=/sat+ISS"
# Text-only mode (no embedding service needed)
curl "https://space.warehack.ing/api/search?q=starlink&mode=text&limit=10"
# Search for launches
curl "https://space.warehack.ing/api/search?q=falcon+9&types=launch"

A dedicated semantic-only search endpoint on the targets router. Searches celestial objects, satellites, and frequencies using vector similarity.

GET /api/targets/semantic-search
ParameterTypeDefaultDescription
qstringSearch query (min 2 characters)
limitint10Max results (max 50)
{
"query": "bright nebula visible tonight",
"results": [
{
"name": "M42 - Orion Nebula",
"target_type": "dso",
"target_id": "156",
"description": "Diffuse nebula in Orion",
"magnitude": 4.0,
"distance": 0.1823
}
],
"count": 1
}

The distance field is the raw cosine distance (lower = more similar). This is the inverse of the score field in omnisearch.

StatusDescription
502Embedding service unavailable
503Embedding service not configured