search

Copy page

Copy page as Markdown for LLMs

View as Markdown

View this page as plain text


Open in ChatGPT

Ask ChatGPT about this page

Open in Claude

Ask Claude about this page

Find Uday Lagna API

Unveil the ascendant (Lagna) windows throughout the day with the Find Uday Lagna API. This API returns a time-sliced list of rising signs (Capricorn, Aquarius, Pisces, etc.) with exact start and end timestamps for the given date, place, and timezone. This helps you align beginnings, rituals, and actions with a suitable Lagna as per Indian Astrology.


Step-by-Step Find Uday Lagna API Postman Testing Integration

Refer to the official guide to learn how to test this API using Postman:

Step by Step Find Uday Lagna API Postman Testing Integration
https://support.divineapi.com/indian-astrology-apis/testing-panchang-api-find-uday-lagna-api-using-postman


Supported Language Codes

You can request the response in multiple languages by passing the lan parameter in the body.

Reference article:
https://support.divineapi.com/general-api-support/translating-an-indian-vedic-apis-into-a-different-language

CodeLanguage
enEnglish
hiHindi
bnBengali
maMarathi
tmTamil
tlTelugu
mlMalayalam
knKannada

Guide: If lan is not provided, the response defaults to en.


API Endpoint

POST https://astroapi-3.divineapi.com/indian-api/v2/uday-lagna

This endpoint returns all Uday Lagna slots (rising signs) for the specified date and location.


Headers

NameTypeDescription
Authorization*StringYour API Access Token, e.g. Bearer {token}

Request Body

NameTypeRequiredDescription
api_keyStringYesYour API key from Divine.
dayIntegerYesPanchang day, e.g. 24.
monthIntegerYesPanchang month, e.g. 05.
yearIntegerYesPanchang year, e.g. 2023.
placeStringNoPlace name, e.g. New Delhi.
latFloatYesLatitude of the place, e.g. 28.6139.
lonFloatYesLongitude of the place, e.g. 77.2090.
tzoneFloatYesTimezone offset, e.g. 5.5. See: https://developers.divineapi.com/divine-api/understanding-time-zones-a-comprehensive-guide
lanStringNoResponse language code. Default is en.

200: OK Uday Lagna fetched successfully

{
    "success": 1,
    "data": {
        "date": "2025-2-05",
        "sunrise": "2025-02-05 07:07:27",
        "sunset": "2025-02-05 18:04:00",
        "uday_lagna": [
            {
                "sign": "Capricorn",
                "start_time": "2025-02-05 07:07:27",
                "end_time": "2025-02-05 07:35:27"
            },
            {
                "sign": "Aquarius",
                "start_time": "2025-02-05 07:36:27",
                "end_time": "2025-02-05 09:02:27"
            },
            {
                "sign": "Pisces",
                "start_time": "2025-02-05 09:03:27",
                "end_time": "2025-02-05 10:27:27"
            },
            {
                "sign": "Aries",
                "start_time": "2025-02-05 10:28:27",
                "end_time": "2025-02-05 12:02:27"
            },
            {
                "sign": "Taurus",
                "start_time": "2025-02-05 12:03:27",
                "end_time": "2025-02-05 13:58:27"
            },
            {
                "sign": "Gemini",
                "start_time": "2025-02-05 13:59:27",
                "end_time": "2025-02-05 16:12:27"
            },
            {
                "sign": "Cancer",
                "start_time": "2025-02-05 16:13:27",
                "end_time": "2025-02-05 18:33:27"
            },
            {
                "sign": "Leo",
                "start_time": "2025-02-05 18:34:27",
                "end_time": "2025-02-05 20:50:27"
            },
            {
                "sign": "Virgo",
                "start_time": "2025-02-05 20:51:27",
                "end_time": "2025-02-05 23:07:27"
            },
            {
                "sign": "Libra",
                "start_time": "2025-02-05 23:08:27",
                "end_time": "2025-02-06 01:26:27"
            },
            {
                "sign": "Scorpio",
                "start_time": "2025-02-06 01:27:27",
                "end_time": "2025-02-06 03:45:27"
            },
            {
                "sign": "Sagittarius",
                "start_time": "2025-02-06 03:46:27",
                "end_time": "2025-02-06 05:49:27"
            },
            {
                "sign": "Capricorn",
                "start_time": "2025-02-06 05:50:27",
                "end_time": "2025-02-06 07:06:47"
            }
        ]
    }
}

Response Fields Explained

success
1 indicates the request was processed successfully.

data.date
The date for which Uday Lagna has been calculated.

data.sunrise / data.sunset
Location-specific sunrise and sunset times that mark the base for Lagna calculations.

data.uday_lagna
An array of Lagna windows for that date. Each object contains:

sign: Ascendant (rising) sign during that interval.

start_time: Beginning of the Lagna.

end_time: End of the Lagna.

This makes it straightforward to pick the next available Lagna suitable for starting an activity.


Usage Notes

You must supply both Authorization: Bearer {Your Auth Token} and a valid api_key in the body.

Since Lagna depends on local sunrise, always provide accurate lat, lon, and tzone.

You can filter the returned list on the client side to show only the upcoming Lagna from current time.

Combine this API with Auspicious/ Inauspicious Timings and Tithi/Nakshatra APIs to build a complete muhurta selection flow.


Example Code Implementations

Below are example implementations in various programming environments.


cURL

curl --location 'https://astroapi-3.divineapi.com/indian-api/v2/uday-lagna' \
--header 'Authorization: Bearer {Your Auth Token}' \
--form 'api_key="{Your API Key}"' \
--form 'day="24"' \
--form 'month="05"' \
--form 'year="2023"' \
--form 'place="New Delhi"' \
--form 'lat="28.6139"' \
--form 'lon="77.2090"' \
--form 'tzone="5.5"' \
--form 'lan="en"'

NodeJS

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://astroapi-3.divineapi.com/indian-api/v2/uday-lagna',
  'headers': {
    'Authorization': 'Bearer {Your Auth Token}'
  },
  formData: {
    'api_key': '{Your API Key}',
    'day': '24',
    'month': '05',
    'year': '2023',
    'Place': 'New Delhi',
    'lat': '28.6139',
    'lon': '77.2090',
    'tzone': '5.5',
    'lan': 'en'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});


JavaScript jQuery AJAX

var form = new FormData();
form.append("api_key", "{Your API Key}");
form.append("day", "24");
form.append("month", "05");
form.append("year", "2023");
form.append("Place", "New Delhi");
form.append("lat", "28.6139");
form.append("lon", "77.2090");
form.append("tzone", "5.5");
form.append("lan", "en");

var settings = {
  "url": "https://astroapi-3.divineapi.com/indian-api/v2/uday-lagna",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer {Your Auth Token}"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});

Python

import requests

url = "https://astroapi-3.divineapi.com/indian-api/v2/uday-lagna"

payload = {'api_key': '{Your API Key}',
'day': '24',
'month': '05',
'year': '2023',
'Place': 'New Delhi',
'lat': '28.6139',
'lon': '77.2090',
'tzone': '5.5',
'lan': 'en'}

headers = {
  'Authorization': 'Bearer {Your Auth Token}'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)


Implementation Tips

Store the returned list and map it to local time for your user to show “Next Lagna in your location”.

If your app is in a non-English language, always pass lan to avoid post-processing on your side.

Since the API gives you a full 24-hour chain (from sunrise to next sunrise), it works well for calendar integrations and muhurta recommendation engines.