Lunar Month info
Calculate the Hindu lunar month for a specific date, time, and geographical location using traditional Vedic calendar calculations. Supports both Amanta and Purnimanta lunar month systems, making it suitable for Panchang applications, Hindu calendars, and Vedic astrology software.
Overview
The Lunar Month Info API calculates the Hindu lunar month for a given date, time, and geographical location according to traditional Vedic calendar calculations. Unlike the Gregorian calendar, the Hindu lunar calendar is based on the phases of the Moon and the relationship between the Sun and Moon, making lunar month calculations essential for Panchang and Vedic astrology applications.
The API supports both the Amanta and Purnimanta systems of lunar month calculation. In the Amanta system, the lunar month ends with Amavasya (New Moon), whereas in the Purnimanta system, it ends with Purnima (Full Moon). These two traditional systems are followed in different regions of India, so supporting both helps developers build regionally appropriate Hindu calendars and Panchang applications.
The API returns the lunar month number, name, and full name, along with indicators for Adhika (intercalary month), Nija (regular month), and Kshaya (omitted month). These details are useful for Hindu festival calendars, religious event planning, Panchang applications, and Vedic astrology software.
To retrieve lunar month information, provide the year, month, date, time, latitude, longitude, and timezone. You can also configure the observation point as geocentric or topocentric and specify a supported Ayanamsha setting, such as Lahiri. The API returns the calculated information in JSON format for easy integration into web applications, mobile apps, and astrology platforms.
Request Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
year
|
integer | Yes | Year number, eg: 2023 | 2023 |
month
|
integer | Yes | Month number,with no leading zero | 7 |
date
|
integer | Yes | Day number,with no leading zero | 5 |
hours
|
integer | Yes | Hours number,with no leading zero | 1 |
minutes
|
integer | Yes | Minutes number,with no leading zero | 1 |
seconds
|
integer | Yes | Seconds number, with no leading zero | 0 |
latitude
|
float | Yes | Latitude number, in the range from -90 to 90 | 12.86 |
longitude
|
float | Yes | Longitude number, in the range from -180 to 180 | 123.5 |
timezone
|
float | Yes | Timezone of birth location, eg: 5.5 | 5.5 |
config
|
object | No | Contains optional configuration values | |
ayanamsha
|
string | No | Either "tropical" or "sayana" or "lahiri" | Either "tropical" or "sayana" or "lahiri" |
observation_point
|
string | No | Geocentric positions are calculated with respect to the center of Earth. Topocentric positions are calculated with respect to the actual given place | Either "topocentric" or "geocentric" |
Request Example
{
"year": 2022,
"month": 8,
"date": 11,
"hours": 6,
"minutes": 0,
"seconds": 0,
"latitude": 17.38333,
"longitude": 78.4666,
"timezone": 5.5,
"config": {
"observation_point": "topocentric",
"ayanamsha": "lahiri"
}
}
Response Examples
Example responses returned by this API.
{
"statusCode": 200,
"output": "{\"lunar_month_number\": 12, \"lunar_month_name\": \"Phalgunam\", \"lunar_month_full_name\": \"Phalgunam\", \"adhika\": 0, \"nija\": 0, \"kshaya\": 0}"
}
Code Examples
Use the following examples to integrate this API into your application.
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://json.freeastrologyapi.com/lunarmonthinfo',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"year": 2026,
"month": 3,
"date": 13,
"hours": 10,
"minutes": 10,
"seconds": 53,
"latitude": 17.383333,
"longitude": 78.466666,
"timezone":5.5,
"config": {
"language":"te",
"observation_point": "topocentric",
"ayanamsha": "lahiri"
}
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'x-api-key: YOUR_API_KEY_HERE'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
import json
url = "https://json.freeastrologyapi.com/lunarmonthinfo"
payload = json.dumps({
"year": 2026,
"month": 3,
"date": 13,
"hours": 10,
"minutes": 10,
"seconds": 53,
"latitude": 17.383333,
"longitude": 78.466666,
"timezone": 5.5,
"config": {
"language": "te",
"observation_point": "topocentric",
"ayanamsha": "lahiri"
}
})
headers = {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY_HERE'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://json.freeastrologyapi.com/lunarmonthinfo',
'headers': {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY_HERE'
},
body: JSON.stringify({
"year": 2026,
"month": 3,
"date": 13,
"hours": 10,
"minutes": 10,
"seconds": 53,
"latitude": 17.383333,
"longitude": 78.466666,
"timezone": 5.5,
"config": {
"language": "te",
"observation_point": "topocentric",
"ayanamsha": "lahiri"
}
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});