# Sidereal Time API
> Sidereal-time astronomy as an API, computed locally and deterministically. The gmst endpoint computes the Greenwich Mean Sidereal Time for a UT date and time, GMST = 18.697374558 + 24.06570982441908·(JD − 2451545.0) hours modulo 24, returning it in hours, degrees and hours-minutes-seconds together with the Julian Day — sidereal time tracks the stars rather than the sun and gains about three minutes and fifty-six seconds each day. The lst endpoint adds the observer's longitude to give the Local Sidereal Time, LST = GMST + longitude/15 (east positive), which equals the right ascension of any star currently crossing the local meridian. The hour-angle endpoint computes the hour angle of a celestial object, HA = LST − RA, from its right ascension and the local sidereal time (or a date, time and longitude): an hour angle of zero means the object is on the meridian at its highest point, a positive hour angle means it is west of the meridian and setting, and a negative one means it is east and rising. Dates are YYYY-MM-DD and times HH:MM:SS in UT, longitude in degrees and right ascension in hours. Everything is computed locally and deterministically, so it is instant and private. Ideal for astronomy, telescope-control, planetarium, observatory and astrophotography app developers, star-pointing and transit tools, and astronomy education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is sidereal time; for the sun's position use a solar-position API and for sunrise and sunset times a sunrise API.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/sidereal-api/..."
```

## Pricing
- **Free** (Free) — 3,300 calls/Mo, 2 req/s
- **Starter** ($6/Mo) — 41,500 calls/Mo, 6 req/s
- **Pro** ($16/Mo) — 233,000 calls/Mo, 15 req/s
- **Mega** ($53/Mo) — 1,355,000 calls/Mo, 40 req/s

## Endpoints

### Sidereal

#### `GET /v1/gmst` — Greenwich sidereal time

**Parameters:**
- `date` (query, required, string) — UT date (YYYY-MM-DD) Example: `2000-01-01`
- `time` (query, optional, string) — UT time (HH:MM:SS) Example: `12:00:00`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/sidereal-api/v1/gmst?date=2000-01-01&time=12%3A00%3A00"
```

**Response:**
```json
{
    "data": {
        "note": "Greenwich Mean Sidereal Time = 18.697374558 + 24.06570982441908·(JD − 2451545.0) hours, mod 24. Sidereal time tracks the stars, not the sun, gaining ~3m56s per day.",
        "inputs": {
            "date": "2000-01-01",
            "time": "12:00:00"
        },
        "gmst_hms": "18:41:50.55",
        "gmst_hours": 18.69737456,
        "julian_day": 2451545,
        "gmst_degrees": 280.460618
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:26.573Z",
        "request_id": "d501d97b-2299-473d-b33c-a339de789c48"
    },
    "status": "ok",
    "message": "Greenwich sidereal time",
    "success": true
}
```

#### `GET /v1/hour-angle` — Hour angle

**Parameters:**
- `right_ascension` (query, required, string) — Right ascension (hours) Example: `12`
- `lst` (query, optional, string) — Local sidereal time (hours) Example: `18`
- `date` (query, optional, string) — Or UT date
- `time` (query, optional, string) — UT time
- `longitude` (query, optional, string) — Longitude (°)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/sidereal-api/v1/hour-angle?right_ascension=12&lst=18"
```

**Response:**
```json
{
    "data": {
        "note": "Hour angle HA = LST − RA. HA = 0 means the object is on the local meridian (highest point); positive HA is west of the meridian, negative is east.",
        "inputs": {
            "lst": 18,
            "right_ascension": 12
        },
        "position": "west of the meridian (setting)",
        "gmst_hours": null,
        "hour_angle_hours": 6,
        "hour_angle_degrees": 90,
        "hour_angle_signed_hours": 6
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:26.693Z",
        "request_id": "d5ef4164-89bd-4377-8335-676ae731e28a"
    },
    "status": "ok",
    "message": "Hour angle",
    "success": true
}
```

#### `GET /v1/lst` — Local sidereal time

**Parameters:**
- `date` (query, required, string) — UT date (YYYY-MM-DD) Example: `2000-01-01`
- `time` (query, optional, string) — UT time (HH:MM:SS) Example: `12:00:00`
- `longitude` (query, required, string) — Longitude (°, east +) Example: `15`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/sidereal-api/v1/lst?date=2000-01-01&time=12%3A00%3A00&longitude=15"
```

**Response:**
```json
{
    "data": {
        "note": "Local Sidereal Time = GMST + longitude/15 (east positive). The LST equals the right ascension of a star currently on the local meridian.",
        "inputs": {
            "date": "2000-01-01",
            "time": "12:00:00",
            "longitude": 15
        },
        "lst_hms": "19:41:50.55",
        "lst_hours": 19.69737456,
        "gmst_hours": 18.69737456,
        "lst_degrees": 295.460618
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:26.800Z",
        "request_id": "46efbc15-da42-475c-90af-784ee3558289"
    },
    "status": "ok",
    "message": "Local sidereal time",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/sidereal-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "notes": "Date YYYY-MM-DD, time HH:MM[:SS] in UT, longitude in degrees (east positive), right ascension and sidereal time in hours.",
        "service": "sidereal-api",
        "formulae": {
            "lst": "LST = GMST + longitude/15",
            "gmst": "GMST(h) = 18.697374558 + 24.06570982441908·(JD − 2451545)",
            "hour_angle": "HA = LST − RA"
        },
        "endpoints": {
            "GET /v1/lst": "Local Sidereal Time for a longitude.",
            "GET /v1/gmst": "Greenwich Mean Sidereal Time for a UT date and time.",
            "GET /v1/meta": "This document.",
            "GET /v1/hour-angle": "Hour angle from right ascension and local sidereal time (or date/time/longitude)."
        },
        "description": "Sidereal-time calculator: Greenwich mean sidereal time, local sidereal time for a longitude, and the hour angle of an object from its right ascension."
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:26.908Z",
        "request_id": "0690874e-f58f-4f48-be02-6d56f863ff0b"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/sidereal-api
OpenAPI spec: https://www.oanor.com/api/sidereal-api/openapi.json
