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 Surya Nakshatra API

The Find Surya Nakshatra API returns the Sun’s Nakshatra (constellation) and its pada for a given date, time, and location, as per Indian Astrology. This is useful for daily panchang modules, horoscope generators, and astrology dashboards that need to show the solar nakshatra active on a specific day.


Step-by-Step Surya Nakshatra API Postman Testing Integration

For a visual walkthrough on how to test this API using Postman, refer to the official guide:
Step by Step Surya Nakshatra API Postman Testing Integration
https://support.divineapi.com/indian-astrology-apis/testing-panchang-api-find-surya-nakshatra-api-using-postman


Supported Language Codes

This API supports multiple Indian languages. You can get the response in a specific language by sending the lan field 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: Pass lan in the request body to switch languages. Default is en.


Endpoint

POST https://astroapi-1.divineapi.com/indian-api/v2/find-surya-nakshatra

This endpoint returns Surya (Sun) Nakshatra details for the given date and location.


Headers

NameTypeDescription
AuthorizationStringYour API Access Token. Example: Bearer {token}

Request Body

NameTypeRequiredDescription
api_keyStringYesYour Divine API key.
dayIntegerYesDay of Panchang, e.g. 24.
monthIntegerYesMonth of Panchang, e.g. 05.
yearIntegerYesYear of Panchang, e.g. 2023.
placeStringNoPlace name, e.g. New Delhi.
latFloatYesLatitude, e.g. 28.6139.
lonFloatYesLongitude, e.g. 77.2090.
tzoneFloatYesTimezone offset, e.g. 5.5. See: https://developers.divineapi.com/divine-api/understanding-time-zones-a-comprehensive-guide
lanStringNoLanguage code from the supported list. Default is en.

200: OK Surya Nakshatra details fetched successfully

{
    "success": 1,
    "data": {
        "sunrise": "2025-07-23 05:58:11",
        "sunset": "2025-07-23 20:46:48",
        "nakshatras": {
            "nakshatra_list": [
                "Pushya"
            ],
            "nakshatra_pada": [
                {
                    "nak_name": "Pushya",
                    "lord": "Saturn",
                    "deity": "Brihaspati",
                    "element": "Jala",
                    "symbol": "Cow's Udder",
                    "syllables": "हु, हे, हो, ड",
                    "pursuit": "Dharma",
                    "gana": "Dev",
                    "direction": "East",
                    "guna": "Sattavik",
                    "body_part": "Mouth, Face, connections to facial expressions, Bones, Joints, Elbows",
                    "color": "Red/Black",
                    "nak_number": 8,
                    "nak_pada": 1,
                    "end_time": "2025-07-23 07:38:11",
                    "end_time_seprated": {
                        "day": "23",
                        "month": "07",
                        "year": "2025",
                        "hour": "07",
                        "minute": "38",
                        "second": "11"
                    }
                },
                {
                    "nak_name": "Pushya",
                    "lord": "Saturn",
                    "deity": "Brihaspati",
                    "element": "Jala",
                    "symbol": "Cow's Udder",
                    "syllables": "हु, हे, हो, ड",
                    "pursuit": "Dharma",
                    "gana": "Dev",
                    "direction": "East",
                    "guna": "Sattavik",
                    "body_part": "Mouth, Face, connections to facial expressions, Bones, Joints, Elbows",
                    "color": "Red/Black",
                    "nak_number": 8,
                    "nak_pada": 2,
                    "end_time": ""
                }
            ]
        }
    }
}

Example Code Implementations

Below are example implementations in various programming environments.


cURL

curl --location 'https://astroapi-1.divineapi.com/indian-api/v2/find-surya-nakshatra' \
--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"'

Node.js

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://astroapi-1.divineapi.com/indian-api/v2/find-surya-nakshatra',
  '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-1.divineapi.com/indian-api/v2/find-surya-nakshatra",
  "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-1.divineapi.com/indian-api/v2/find-surya-nakshatra"

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)


Notes and Best Practices

Always send both Authorization: Bearer {Your Auth Token} and api_key in the same request.

Make sure latitude, longitude, and timezone match the user/location for correct Surya Nakshatra calculation.

The API returns the list of Surya Nakshatra and individual padas with rich metadata (deity, lord, element, guna, direction, body part, color).

Use the lan parameter to localize the output.

All requests must be made over HTTPS.