Copy page
Copy page as Markdown for LLMs
The Find Samvat API provides details about the Vikram Samvat and Shaka Samvat years based on a given date, time, and location. These traditional Indian calendar systems are central to astrological and historical timekeeping in Indian culture.
For a complete walkthrough on how to test this API using Postman, refer to the official documentation:
Step by Step Find Samvat API Postman Testing Integration
https://support.divineapi.com/indian-astrology-apis/testing-panchang-api-find-samvat-api-using-postman
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
| Code | Language |
|---|---|
| en | English |
| hi | Hindi |
| bn | Bengali |
| ma | Marathi |
| tm | Tamil |
| tl | Telugu |
| ml | Malayalam |
| kn | Kannada |
Guide:
Include the lan field in the request body to get responses in a specific language. Default language is 'en'.
POST https://astroapi-2.divineapi.com/indian-api/v1/find-samvat
This endpoint returns Samvat (era) details based on the date, latitude, longitude, and timezone.
| Name | Type | Description |
|---|---|---|
| Authorization | String | Your API Access Token. Example: Bearer {token} |
| Name | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your Divine API key. |
| day | Integer | Yes | Date of Panchang, e.g., 24. |
| month | Integer | Yes | Month of Panchang, e.g., 05. |
| year | Integer | Yes | Year of Panchang, e.g., 2023. |
| place | String | No | Place name, e.g., New Delhi. |
| lat | Float | Yes | Latitude of the location, e.g., 28.6139. |
| lon | Float | Yes | Longitude of the location, e.g., 77.2090. |
| tzone | Float | Yes | Timezone offset, e.g., 5.5. See: https://developers.divineapi.com/divine-api/understanding-time-zones-a-comprehensive-guide |
| lan | String | No | Language code from the table above (default: 'en'). |
{
"success": 1,
"data": {
"vikram_name": "pingala",
"shaka_name": "sobhakrta",
"shaka_year": 1945,
"vikram_year": 2080
}
}
Below are example implementations in various programming environments.
curl --location 'https://astroapi-2.divineapi.com/indian-api/v1/find-samvat' \
--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"'var request = require('request');
var options = {
'method': 'POST',
'url': 'https://astroapi-2.divineapi.com/indian-api/v1/find-samvat',
'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);
});
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-2.divineapi.com/indian-api/v1/find-samvat",
"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);
});import requests
url = "https://astroapi-2.divineapi.com/indian-api/v1/find-samvat"
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)
Always include both Authorization (Bearer token) and api_key in your request.
Ensure that latitude, longitude, and timezone are accurate to get the correct Samvat values.
The response returns both Vikram Samvat and Shaka Samvat, along with their respective names.
Use the lan parameter to get localized results when available.
API requests must be made over HTTPS only for security reasons.