Skip to content
POST/api/astro/star/1 credit

Fixed stars

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.

https://yogataraapi.prahlad.app/api/astro/star/
Test Request

Authentication

Send your key in the X-API-Key header. Keys are server-side credentials — never put one in browser JavaScript or a mobile app.

X-API-Key: yt_live_a1b2c3d4_…
Content-Type: application/json

Request fields

FieldTypeRequiredNotes
date_timestring (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.

keysarrayrequired

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.

namestringrequired
AldebaranRohiniAlgolAntaresRegulusSiriusSpicaTrappist-1Galactic CenterGal. CenterGreat AttractorVirgo Cluster

A 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_floatnumber (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

latitudenumber (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

longitudenumber (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

Available keys (10)

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.

KeyExtra fields neededDescription
declinationdate_timeThe 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.
distancedate_timeThe star's distance from Earth at `date_time`, a single number in astronomical units rounded to three decimals.
ecliptic_speedsdate_timeHow 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_speedsdate_timeHow 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.
latitudedate_timeThe 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.
longitudedate_timeThe star's sidereal ecliptic longitude at `date_time`: a single number of degrees from 0 to 360, rounded to three decimals.
magnitudeThe 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.
retrogradedate_timeWhether 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_ascensiondate_timeThe 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_positionsA 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.

Example request

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"]}'

Response

{
  "data": {
    "set_default_positions": null,
    "magnitude": 0.86
  },
  "status": 200,
  "is_error": false,
  "message": "successful"
}

Captured from a real call using the exact request above. Results sit under data, keyed by what you requested.

Errors

Metering errors return { "error": "…", "message": "<code>", "is_error": true }. Show error to people and branch on message. See the error reference.