An ascendant calculation API takes a date, a time and a place of birth and returns the zodiac sign and exact degree that was rising on the eastern horizon at that moment. In the Vedika API that is a single request: POST /v2/astrology/ascendant with the birth datetime, latitude, longitude and timezone returns the sign, the degree inside the sign, the full 0 to 360 degree longitude, the nakshatra with its pada, the sign lord, and a short interpretation block.
This guide shows the request and response with a real worked example, explains the three inputs that decide whether the answer is right, and gives copy-ready code. If you are building a full chart feature rather than one value, the birth chart calculator API returns the ascendant together with every planet and house in one call.
What the ascendant is, and why it is the hard part of a chart
The ascendant, called lagna in Vedic astrology, is the point of the ecliptic that is crossing the eastern horizon at the birth place and time. The houses, their cusps and the tenth house are all counted from it.
It is also the most sensitive value in a chart. The sky turns through 360 degrees in about 24 hours, so the ascendant advances roughly one degree every four minutes, and a sign changes about every two hours. A birth time that is wrong by ten minutes can move the ascendant by two or three degrees, and a time that is wrong by an hour can change the sign. A planet position barely cares about a ten minute error. The ascendant does, which is why an ascendant calculator is a good test of whether the inputs you collect are good enough.
The request
Send a JSON body to https://api.vedika.io/v2/astrology/ascendant. Latitude and longitude are required. The moment of birth is given either as one ISO datetime or as a date plus a time field in local time.
| Field | Required | What it is |
|---|---|---|
datetime | Yes, or date and time | Local birth moment as ISO 8601, for example 1990-05-15T10:30:00 |
latitude | Yes | Degrees, -90 to 90. North is positive. |
longitude | Yes | Degrees, -180 to 180. East is positive. |
timezone | Recommended | An IANA name or a UTC offset such as +05:30, or a number of hours such as 5.5 |
Send your key as a bearer token in the Authorization header (Authorization: Bearer <key>). The free sandbox lets you try the call without a key before you create one.
curl -X POST https://api.vedika.io/v2/astrology/ascendant \
-H "Authorization: Bearer $VEDIKA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"datetime":"1990-05-15T10:30:00","latitude":19.07,"longitude":72.87,"timezone":"+05:30"}'
The response
The example above, a birth in Mumbai on 15 May 1990 at 10:30 local time, returns this data block. The response also carries a billing block and a meta block beside it; they describe the call itself and are left out of the example below.
{
"success": true,
"data": {
"sign": "Cancer",
"signNumber": 4,
"signLord": "Moon",
"degree": 2.41,
"fullDegree": 92.41,
"nakshatra": { "id": 7, "name": "Punarvasu", "pada": 4, "lord": "Jupiter", "deity": "Aditi" },
"interpretation": { "element": "Water", "quality": "Cardinal (Movable)", "symbol": "The Crab" }
}
}
Read it field by field. sign and signNumber give the rising sign, here Cancer, the fourth sign. degree is the position inside that sign, 2.41 degrees. fullDegree is the same point measured from the start of Aries, 92.41, which is 90 degrees for the three signs before Cancer plus 2.41. Use fullDegree when you need to place the ascendant on a wheel or compare it with a planet longitude, and degree when you show it to a person.
nakshatra is the lunar mansion the ascendant falls in, with its number, lord, deity and the pada, which is the quarter of the nakshatra from 1 to 4. The interpretation block carries short descriptive text for the sign, such as its element and quality, ready to display. The billing block reports what the call cost, so read that field instead of hard-coding a price; the pricing page lists current rates.
Checking the answer yourself
You should not have to take a calculator on trust, and an ascendant can be checked by hand. For the example above, convert the local time to universal time, which is 05:00 on 15 May 1990 for an offset of +05:30. Compute the local sidereal time for longitude 72.87 degrees east, then the ascendant from the sidereal time, the obliquity of the ecliptic and the latitude. That gives a tropical ascendant of about 116.13 degrees.
The Vedic chart is sidereal, so subtract the Lahiri ayanamsa, which was about 23.72 degrees in May 1990. The result is about 92.41 degrees, the value the API returned. If your own check of a result disagrees by more than a small fraction of a degree, look at the three inputs below before you suspect the calculator.
The three inputs that decide whether the ascendant is right
1. The timezone must be the one in force at that place on that date
The most common wrong ascendant comes from sending the current offset of a place instead of the offset at the time of birth. Some places have changed their offset over the years, and many apply daylight saving time in summer. An IANA name such as America/New_York lets the service apply the rule for that date. A fixed offset such as -05:00 does not, so in a summer birth you must send -04:00 yourself. An hour of error moves the ascendant by about fifteen degrees.
2. Latitude and longitude need the right sign
North latitude and east longitude are positive. A birth in New York needs a negative longitude. Swapping the two values, or dropping the minus sign, still returns a valid looking answer, which makes this error hard to see. If you take coordinates from a geocoder, validate them against the city the user typed.
3. The time of birth has to be local, not universal
Send the clock time written on the birth record together with the timezone, and let the service do the conversion. Converting to universal time yourself and then also sending a timezone applies the offset twice.
Calling it from code
const res = await fetch('https://api.vedika.io/v2/astrology/ascendant', {
method: 'POST',
headers: { 'Authorization': `Bearer ${process.env.VEDIKA_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
datetime: '1990-05-15T10:30:00',
latitude: 19.07,
longitude: 72.87,
timezone: '+05:30'
})
});
if (!res.ok) throw new Error('ascendant request failed: ' + res.status);
const { data } = await res.json();
console.log(`${data.sign} ${data.degree.toFixed(2)} degrees, ${data.nakshatra.name} pada ${data.nakshatra.pada}`);
import os, requests
r = requests.post(
'https://api.vedika.io/v2/astrology/ascendant',
headers={'Authorization': f"Bearer {os.environ['VEDIKA_API_KEY']}"},
json={'datetime': '1990-05-15T10:30:00', 'latitude': 19.07, 'longitude': 72.87, 'timezone': '+05:30'},
timeout=30,
)
r.raise_for_status()
d = r.json()['data']
print(d['sign'], round(d['degree'], 2), d['nakshatra']['name'], d['nakshatra']['pada'])
Handling edge cases in your product
Handle a missing or approximate birth time in your product. If the user does not know the time, do not send noon and show the result as a fact. Ask for a range, or label the ascendant as unknown and show only the values that do not depend on it. A noon default produces a confident Cancer or Leo for someone whose real ascendant could be any sign.
Near a sign boundary, a few minutes of uncertainty changes the answer. When degree is below one or above twenty-nine, tell the user that the rising sign depends on the exact minute and offer to adjust the time. This is the case where a plain value hides the most doubt.
Validate before you call. Check that latitude is between -90 and 90, longitude between -180 and 180, and the datetime parses. A request with a bad body returns an error response, and checking first saves a round trip. Never put your key in browser code; call the API from your server and return only the fields your page needs.
Where the ascendant fits in a larger feature
The ascendant on its own suits a rising sign badge, a profile summary, or a quick onboarding step that shows a user something real before they sign up. For a full reading you will want the rest of the chart. The birth chart calculator API returns every planet, house and the ascendant from one request, and the API reference lists the other chart, dasha and divisional chart routes that share the same birth fields, so the input form you build for the ascendant works for all of them.
The ascendant is one route among many in the astrology API, which also covers dashas, divisional charts, matching and the panchang API for daily timings. The same key and the same birth fields work across all of them.
Frequently asked questions
What does an ascendant calculation API return?
It returns the rising sign at the birth moment and place, the exact degree inside that sign, the full 0 to 360 degree longitude, the nakshatra and pada, the sign lord and a short interpretation block. The Vedika route is POST /v2/astrology/ascendant.
What inputs does the ascendant endpoint need?
Latitude and longitude are required, plus the birth moment as an ISO datetime or as a date and a local time. A timezone, given as an IANA name or a UTC offset, is strongly recommended so the local time is converted correctly.
Why is my ascendant wrong by a sign?
The usual causes are a wrong timezone offset for that date, a missing daylight saving adjustment, a swapped or unsigned latitude and longitude, or sending a universal time together with a timezone. The ascendant moves about one degree every four minutes, so an hour of error can change the sign.
Is the ascendant sidereal or tropical?
The Vedic ascendant returned by this route is sidereal. For the 15 May 1990 Mumbai example the API returned 92.41 degrees, and an independent calculation using the Lahiri ayanamsa gives about 92.41 degrees.
How much does one call cost?
Every response includes a billing block with the amount charged. Read that field rather than a fixed number; the pricing page lists current rates.
Can I try it without an API key?
Yes. The free sandbox on the Vedika site lets you send test requests without a key, so you can build the form and the display before you create an account.