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 Chandramasa API

The Find Chandramasa API helps identify the lunar month (Chandramasa) as per the Indian Vedic calendar. It provides insights into the lunar cycle and determines whether the month is Amanta, Purnimanta, or Adhik (Leap), based on the given date, time, and place.


Step-by-Step Postman Testing Integration

For a complete guide on how to test this API using Postman, refer to the official documentation:
Step by Step Find Chandramasa API Postman Testing Integration
https://support.divineapi.com/indian-astrology-apis/testing-panchang-api-find-chandramasa-api-using-postman


Supported Language Codes

This API supports multiple Indian languages for localized responses. You can specify the language by passing the lan parameter in the request 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:
Include the lan field in the request body to get responses in a different language. Default is 'en'.


Endpoint

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

This endpoint returns the Chandramasa (lunar month) based on the provided date, time, and coordinates.


Headers

NameTypeDescription
AuthorizationStringYour API access token. Example: Bearer {token}

Request Body

NameTypeRequiredDescription
api_keyStringYesYour Divine API key.
dayIntegerYesDate of input. Example: 24.
monthIntegerYesMonth of input. Example: 05.
yearIntegerYesYear of input. Example: 2023.
placeStringNoLocation name. Example: New Delhi.
latFloatYesLatitude of the place. Example: 28.6139.
lonFloatYesLongitude of the place. Example: 77.2090.
tzoneFloatYesTimezone offset (e.g., 5.5). See: https://developers.divineapi.com/divine-api/understanding-time-zones-a-comprehensive-guide
lanStringNoLanguage code (default 'en').
month_typeStringNoType of lunar month calculation: amanta, purnimanta, or both. Default is amanta.

200: OK Planets Chandramasa Table Successfully 

{
    "success": 1,
    "data": {
        "date": "2023-05-24",
        "chandramasa": "Jyeshtha",
        "adhik": "false",
        "type": "Amanta"
    }
}

Example Code Implementations

Below are example implementations in various programming environments.


cURL

curl --location 'https://astroapi-3.divineapi.com/indian-api/v2/chandramasa' \
--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-3.divineapi.com/indian-api/v2/chandramasa',
  '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/chandramasa",
  "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/chandramasa"

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 include both Authorization (Bearer token) and api_key in your requests.

Ensure the latitude, longitude, and timezone accurately represent the location.

The month_type determines which lunar system (Amanta, Purnimanta, or both) is applied.

Responses are localized if the lan parameter is provided.

Use HTTPS only- non-secure endpoints are not supported.