Samvat information
Calculate traditional Hindu Samvat (calendar year) information for a specific date, time, and geographical location. Retrieve Vikram Samvat and other relevant Hindu calendar year details for Panchang applications, religious calendars, and Vedic astrology software.
Overview
The Samvat Information API calculates traditional Hindu calendar year details for a given date, time, and geographical location. It provides information about important Hindu calendar systems, helping developers identify the corresponding Samvat year and its traditional year name.
The API returns Saka Salivahana Samvat and Vikram Samvat information, including the year number, the name number, and the traditional name of the year. These details are useful for displaying Hindu calendar years in Panchang applications, religious calendars, festival planners, and Vedic astrology software.
To retrieve Samvat information, provide the year, month, date, time, latitude, longitude, and timezone. The API also supports observation-point configuration, allowing you to specify geocentric or topocentric calculations. The response is returned in JSON format, making it easy to integrate traditional Hindu calendar year information 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": "\"{\\\"status\\\": \\\"success\\\", \\\"timestamp\\\": \\\"2026-03-19 05:33:32\\\", \\\"saka_salivahana_number\\\": 1948, \\\"saka_salivahana_name_number\\\": 40, \\\"saka_salivahana_year_name\\\": \\\"Paraabhava\\\", \\\"vikram_chaitradi_number\\\": 2083, \\\"vikram_chaitradi_name_number\\\": 54, \\\"vikram_chaitradi_year_name\\\": \\\"Rowdri\\\"}\""
}
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/samvatinfo',
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": 4,
"date": 1,
"hours": 10,
"minutes": 25,
"seconds": 43,
"latitude": 17.68009,
"longitude": 83.20161,
"timezone": 5.5,
"config": {
"observation_point": "topocentric",
"ayanamsha": "lahiri" ,
"lunar_month_definition":"amanta",
"language":"te"
}
}',
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/samvatinfo"
payload = json.dumps({
"year": 2026,
"month": 4,
"date": 1,
"hours": 10,
"minutes": 25,
"seconds": 43,
"latitude": 17.68009,
"longitude": 83.20161,
"timezone": 5.5,
"config": {
"observation_point": "topocentric",
"ayanamsha": "lahiri",
"lunar_month_definition": "amanta",
"language": "te"
}
})
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/samvatinfo',
'headers': {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY_HERE'
},
body: JSON.stringify({
"year": 2026,
"month": 4,
"date": 1,
"hours": 10,
"minutes": 25,
"seconds": 43,
"latitude": 17.68009,
"longitude": 83.20161,
"timezone": 5.5,
"config": {
"observation_point": "topocentric",
"ayanamsha": "lahiri",
"lunar_month_definition": "amanta",
"language": "te"
}
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});