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

Transit crossings

This endpoint searches for moments rather than describing a chart at a fixed time. It answers questions of the form: when does the Sun next reach 0 degrees of Aries, when does Mars next cross a given degree between two dates, when do Saturn and the Sun next share an ecliptic longitude, and where exactly does a body stand at an instant. Two of the keys are mode switches rather than calculations. `set_default_transit` selects the plain tropical ephemeris and `set_sidereal_transit` selects the sidereal one, and both return null. Keys in a request are evaluated in the order you list them, so put the switch first if you want the searches that follow to be sidereal. The `planet`, `celestial`, `celestial1` and `celestial2` fields use upper-case Swiss Ephemeris names (`SUN`, `MOON`, `MEAN_NODE`, `TRUE_NODE`, `CHIRON`, the Uranian points and several planetary moons), which is a different vocabulary from the `Sun`/`Moon` names used on most other endpoints here. `tz` is a plain hour offset applied to every timestamp that comes back, `when` chooses whether to search 'after' or 'before' the reference time, and `datetime_start`/`datetime_end` bound the window for `planet_transit`.

https://yogataraapi.prahlad.app/api/astro/transit/
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.

datetime_endstring (date-time)required
datetime_startstring (date-time)required
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.

planetstringrequired
SUNMOONMERCURYVENUSMARSJUPITERSATURNURANUSNEPTUNEPLUTOMEAN_NODETRUE_NODE

36 accepted values covering the 10 planets, the two lunar nodes, 6 asteroids, 9 Uranian/fictitious bodies and 9 planetary moons. An unrecognised name silently maps to None rather than erroring, which then fails deeper inside swisseph. Note the nodes use the underscored forms MEAN_NODE / TRUE_NODE (there is no 'RAHU'/'KETU' alias).

tznumber (double)required

min -12 · max 14

celestialstringoptional
SUNMOONMERCURYVENUSMARSJUPITERSATURNURANUSNEPTUNEPLUTOMEAN_NODETRUE_NODE

36 accepted values covering the 10 planets, the two lunar nodes, 6 asteroids, 9 Uranian/fictitious bodies and 9 planetary moons. An unrecognised name silently maps to None rather than erroring, which then fails deeper inside swisseph. Note the nodes use the underscored forms MEAN_NODE / TRUE_NODE (there is no 'RAHU'/'KETU' alias).

celestial1stringoptional
SUNMOONMERCURYVENUSMARSJUPITERSATURNURANUSNEPTUNEPLUTOMEAN_NODETRUE_NODE

36 accepted values covering the 10 planets, the two lunar nodes, 6 asteroids, 9 Uranian/fictitious bodies and 9 planetary moons. An unrecognised name silently maps to None rather than erroring, which then fails deeper inside swisseph. Note the nodes use the underscored forms MEAN_NODE / TRUE_NODE (there is no 'RAHU'/'KETU' alias).

celestial2stringoptional
SUNMOONMERCURYVENUSMARSJUPITERSATURNURANUSNEPTUNEPLUTOMEAN_NODETRUE_NODE

36 accepted values covering the 10 planets, the two lunar nodes, 6 asteroids, 9 Uranian/fictitious bodies and 9 planetary moons. An unrecognised name silently maps to None rather than erroring, which then fails deeper inside swisseph. Note the nodes use the underscored forms MEAN_NODE / TRUE_NODE (there is no 'RAHU'/'KETU' alias).

degrnumber (double)optional
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

nakshatrasstringoptional
special

DEAD PARAMETER at the HTTP layer: TransitView never forwards it, so sending it has no effect. In the engine the only meaningful value is the literal 'special', which selects the 28-entry nakshatras_special table over the default 27-entry one.

whenstringoptional
afterbefore

Engine default is 'after'. Used by the 'solar_crossing', 'find_moon_crossing', 'moon_node_crossing' and 'celestial_conjunction' keys.

x2crossnumber (double)optional

Available keys (8)

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
celestial_conjunctioncelestial1, celestial2, datetime_start, whenThe first moment after `datetime_start` at which `celestial1` and `celestial2` share an ecliptic longitude. Returns an object with `long1` and `long2`, the two longitudes at the moment found — near but not exactly equal, since the search converges to a tolerance — and `date`, the ISO timestamp.
find_moon_crossingx2cross, date_time, tz, whenThe instant the Moon reaches the ecliptic longitude given in `x2cross`, searching forward or backward from `date_time` according to `when`. Returns a single ISO timestamp shifted by `tz`. Because the Moon moves about 13 degrees a day, the answer is normally within a month of the reference time.
moon_node_crossingdate_time, tz, whenThe next or previous crossing of the lunar node, searching from `date_time` in the direction given by `when`. Returns an object with `date`, the ISO timestamp shifted by `tz`, together with `long` and `lat`, the ecliptic longitude and latitude at that moment. Useful for locating eclipse seasons.
planet_transitdegr, planet, datetime_start, datetime_end, tzThe moment the body named in `planet` crosses the ecliptic longitude given in `degr`, searched between `datetime_start` and `datetime_end`. Returns a single ISO timestamp shifted by `tz`, or null when the body never reaches that degree inside the window. Unlike the Sun and Moon crossings this one is bounded, so give it a range wide enough to contain the event.
set_default_transitA mode switch, not a calculation: sets the ephemeris to tropical (plain Swiss Ephemeris, no ayanamsa) for the rest of the request. Returns null. Keys are evaluated in the order you list them, so place this before the crossing keys it should affect.
set_sidereal_transitA mode switch, not a calculation: sets the ephemeris to sidereal, so subsequent crossings and positions in the same request are measured against the ayanamsa rather than the tropical zero point. Returns null, and must be listed before the keys it should affect.
solar_crossingx2cross, date_time, tz, whenThe instant the Sun reaches the ecliptic longitude given in `x2cross`, searching forward or backward from `date_time` according to `when`. Returns a single ISO timestamp shifted by the `tz` hour offset. Pass 0 to find a sidereal new year, or a natal solar longitude to find a birthday to the minute.
transit_detailscelestial, date_time, tzA full positional readout for the body named in `celestial` at `date_time`. Returns an object with `longitude` as a preformatted display string, `nakshatra` and its `nakshatra_lord`, `padam` (the quarter of the nakshatra, 1-4), `full_degree` (the sidereal longitude divided by 30, so the sign number plus the fraction through it), `latitude_shara` as `{degrees, minutes, seconds}`, `speed` in degrees per day as a string, `right_ascension` formatted 'hh.mm.ss.ss' and `declination_kranti` in degrees as a string.

Example request

curl -X POST https://yogataraapi.prahlad.app/api/astro/transit/ \
  -H "X-API-Key: $OCCULT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date_time":"2024-11-20T06:52:42.466Z","keys":["set_sidereal_transit","planet_transit","solar_crossing","celestial_conjunction","transit_details"],"latitude":26.1046,"longitude":75.7873,"tz":5.5,"planet":"MARS","datetime_start":"2024-11-20T06:52:42.466Z","datetime_end":"2040-11-20T06:52:42.466Z","degr":0,"x2cross":0,"celestial1":"SATURN","celestial2":"SUN","celestial":"MARS","when":"after"}'

Response

{
  "data": {
    "set_sidereal_transit": null,
    "planet_transit": "2026-05-11T12:38:41+05:30",
    "solar_crossing": "2025-04-14T03:21:25+05:30",
    "celestial_conjunction": {
      "long1": 327.886,
      "long2": 327.877,
      "date": "2025-03-12T10:13:52.466000Z"
    },
    "transit_details": {
      "longitude": "4° Mesh 4'° 25\"",
      "nakshatra": "Makha",
      "padam": 2,
      "nakshatra_lord": "Ketu",
      "full_degree": 4.15,
      "latitude_shara": {
        "degrees": 2,
        "minutes": 5,
        "seconds": 52.8
      },
      "speed": "0.2",
      "right_ascension": "08.29.10.92",
      "declination_kranti": "21.19"
    }
  },
  "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.