import { ArrowRight, Code2 } from 'lucide-react'; import Link from 'next/link'; import { FreshnessBadge } from '@/components/ui/badges'; import { Section } from '@/components/ui/section'; import { Unavailable } from '@/components/ui/unavailable'; import { fmtAgo } from '@/lib/format'; import { routes } from '@/lib/site'; import type { HomePayload } from '@/lib/types'; type Source = HomePayload['sources'][number]; /** Freshness from the connector's own cadence: ≤ 2 intervals fresh, ≤ 6 aging, else stale. */ export function freshnessOf(s: Source, now = Date.now()): 'fresh' | 'aging' | 'stale' | 'unavailable' | 'not_enabled' { if (!s.enabled) return 'not_enabled'; if (!s.last_success_at) return 'unavailable'; const age = (now - new Date(s.last_success_at).getTime()) / 1000; const iv = s.interval_seconds ?? 86_400; if (age <= iv * 2) return 'fresh'; if (age <= iv * 6) return 'aging'; return 'stale'; } export function DataSources({ sources }: { sources: HomePayload['sources'] }) { const grouped = new Map(); for (const s of sources) grouped.set(s.id, [...(grouped.get(s.id) ?? []), s]); const attributions = [...new Set(sources.map((s) => s.attribution_text).filter((t): t is string => Boolean(t)))]; return (
{grouped.size === 0 ? ( ) : (
    {[...grouped.entries()].map(([id, conns]) => { const first = conns[0]!; return (
  • {first.name} {first.official ? 'Official' : 'Public'}

    {first.attribution_text &&

    {first.attribution_text}

    }
      {conns.map((c) => (
    • {c.connector ?? '—'} updated {fmtAgo(c.last_success_at)}
    • ))}
  • ); })}
)} {attributions.length > 0 &&

{attributions.join(' ')} Derived classifications follow the published methodology.

}
); } export function ApiTeaser() { return (

Every number on this page is served by the public JSON API — catalogue, search, live SGP4 positions, constellations, operators, launches, debris, reentries, events and the statistics snapshot. Interactive OpenAPI docs at{' '} /api/v1/docs.

# live position of the ISS

GET /api/v1/satellites/25544/live

# all tracked objects, two SGP4 epochs

GET /api/v1/orbit/positions

# full-text search across entities

GET /api/v1/search?q=starlink

API documentation
); }