curl -X POST https://yogataraapi.prahlad.app/api/astro/star/ \
-H "X-API-Key: $OCCULT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"date_time":"2026-09-01T06:00:00+05:30","timezone_as_float":5.5,"latitude":26.9124,"longitude":75.7873,"name":"Aldebaran","keys":["set_default_positions","magnitude"]}'Positional data for a named fixed star, taken from the Swiss Ephemeris star catalogue. Both Vedic and Western astrology use a handful of bright stars as markers — Aldebaran, Regulus, Spica, Antares — and the nakshatras are themselves named after their yogataras, the junction stars that define them. This endpoint gives a star's ecliptic and equatorial coordinates, its rate of change, and its brightness. Send `name` as either a traditional name (`Aldebaran`, `Regulus`) or a Bayer designation (`alTau`, `alLeo`); matching ignores case and spaces, and a leading comma forces the Bayer form. Add `date_time`, `timezone_as_float`, and the `keys` you want. Important: list `set_default_positions` as the first entry of `keys`. Keys are executed in the order you give them, and every positional key depends on the calculation flags that call installs — without it they fail. Only `magnitude`, which comes straight from the catalogue, works on its own. Positions are sidereal. `latitude` and `longitude` are accepted but not used; a fixed star's geocentric position does not depend on where you stand.
| Field | Type | Required | Notes |
|---|---|---|---|
| date_time | string (date-time) | required | The moment to calculate for, ISO 8601. ALWAYS include an offset or a trailing Z - a value with no zone is read as Asia/Kolkata (UTC+05:30), not UTC, and can return the previous day's result with a 200. '2026-09-01T06:00:00Z' and '2026-09-01 06:00:00' are different instants and give different answers. |
| keys | array | required | Which calculations to return, as a list of names. See the key table for this endpoint; an unrecognised name rejects the whole request. One call costs one credit however many keys you ask for, so request everything you need at once rather than making several calls. |
| name | string | required | AldebaranRohiniAlgolAntaresRegulusSiriusSpicaTrappist-1Galactic CenterGal. CenterGreat AttractorVirgo ClusterA fixed star from the Swiss Ephemeris catalogue: either a traditional name (Aldebaran, Regulus, Spica) or a Bayer designation (alTau, alLeo). Matching ignores case and spaces. Prefix a comma to force the Bayer form, e.g. ',alTau'. About 735 traditional names and 1117 designations are available, including non-stellar points such as Galactic Center. An unrecognised name returns 400. |
| timezone_as_float | number (double) | required | UTC offset of the place, in hours, as a decimal. Example: 5.5 for India (UTC+05:30), -5 for New York in winter, 5.75 for Nepal. This is NOT validated against date_time - if the two disagree you get a successful response for the wrong moment, so derive both from the same source. Use the offset in force on that date, not today's: a summer birth in a country with daylight saving needs the summer offset. min -12 · max 14 |
| latitude | number (double) | optional | Latitude of the place, in decimal degrees. Positive is north, negative is south. Example: 26.9124 for Jaipur, 40.7128 for New York. Minutes and seconds are not accepted - convert first. min -89.9 · max 89.9 |
| longitude | number (double) | optional | Longitude of the place, in decimal degrees. Positive is east, negative is west. Example: 75.7873 for Jaipur, -74.0060 for New York. Note the sign: a missing minus puts New York in China. min -180 · max 180 |
Ask for exactly the calculations you want by listing them in keys. An unknown key rejects the whole request, and you are charged 1 credit however many you ask for — so batch them.
| Key | Extra fields needed | Description | |
|---|---|---|---|
| declination | date_time | The star's declination at `date_time`, its angle north or south of the celestial equator, returned as `{degrees, minutes, seconds}`. The conversion takes the absolute value, so the sign is lost and a southern declination is indistinguishable from a northern one — take the hemisphere from the star's catalogue position if you need it. | |
| distance | date_time | The star's distance from Earth at `date_time`, a single number in astronomical units rounded to three decimals. | |
| ecliptic_speeds | date_time | How fast the star's ecliptic coordinates are changing at `date_time`, as `{longitude_speed, latitude_speed, distance_speed}` — the first two in degrees per day, the last in astronomical units per day. Values are minute, since a fixed star's apparent motion is precession and proper motion rather than orbital motion. | |
| equatorial_speeds | date_time | How fast the star's equatorial coordinates are changing at `date_time`, as `{right_ascension_speed, declination_speed, distance_speed}` — the first two in degrees per day, the last in astronomical units per day. | |
| latitude | date_time | The star's ecliptic latitude at `date_time` — how far it lies north or south of the ecliptic plane — as a single number of degrees rounded to three decimals, negative to the south. This is what puts a star off the zodiacal belt and is why some bright stars never conjoin a planet exactly. | |
| longitude | date_time | The star's sidereal ecliptic longitude at `date_time`: a single number of degrees from 0 to 360, rounded to three decimals. | |
| magnitude | — | The star's apparent visual magnitude from the catalogue, a single number; lower is brighter, so Aldebaran comes back as 0.86. The only key on the endpoint that needs neither a date nor a prior `set_default_positions` call. | |
| retrograde | date_time | Whether the star's ecliptic longitude is decreasing at `date_time`: a single boolean, true when `longitude_speed` is negative. For a fixed star this is effectively always false, because precession carries it forwards through the sidereal zodiac. | |
| right_ascension | date_time | The star's right ascension at `date_time`, its east-west coordinate on the celestial equator, returned as `{hours, minutes, seconds}` rather than as decimal degrees. | |
| set_default_positions | — | A switch, not a value: sets apparent geocentric positions with speeds, and unlike the identically named key on /api/astro/celestial/ it also sets the SIDEREAL flag - so this endpoint's default is sidereal, not tropical. Returns null. Put it first in `keys`: the switches apply only to the keys listed after them. |