Find Ritu and Ayana API
The Find Ritu and Ayana API provides insights into the seasonal transitions (Ritu) and the solar movement phases (Ayana) as recognized in Indian Astrology. This API helps determine whether the Sun is in Uttarayana or Dakshinayana and identifies the corresponding Ritu based on both Drik and Vedic systems, along with day-night durations and Madhyahna (midday) timing.
Step-by-Step Find Ritu and Ayana API Postman Testing Integration
For a detailed Postman setup and testing process, refer to the official documentation:
https://support.divineapi.com/indian-astrology-apis/testing-panchang-api-find-ritu-and-ayana-api-using-postman
Supported Language Codes
The API supports multilingual responses. Pass the lan parameter in the request body to specify your preferred language.
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:
If the lan parameter is not included, the response will default to English (en).
API Endpoint
POST https://astroapi-2.divineapi.com/indian-api/v1/find-ritu-and-anaya
This endpoint returns the Ritu and Ayana information for a given date and location, including Drik (observed) and Vedic (traditional) seasonal classifications, along with sunrise, sunset, and day-night duration data.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization | String | Your API Access Token. Example: Bearer {token} |
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key. |
| day | Integer | Yes | Day 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, e.g., 28.6139. |
| lon | Float | Yes | Longitude, 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 supported list (default: 'en'). |
| sign_lan | Integer | No | 0 for English 1 for Sanskrit, Default is '0' |
200: OK Ritu details fetched successfully
{
"success": 1,
"data": {
"ritus": {
"drik": [
{
"name": "grishma",
"ayana": "Dakshinayana",
"zodiac": "taurus"
}
],
"vedic": [
{
"name": "grishma",
"ayana": "uttarayana",
"zodiac": "taurus"
}
]
},
"dinmana": {
"hours": "13",
"minutes": "43",
"seconds": "34"
},
"raatrimana": {
"hours": "10",
"minutes": "16",
"seconds": "02"
},
"madhyahna": "12:18 PM"
}
}
Example Code Implementations
Below are example implementations in various programming environments.
cURL
curl --location 'https://astroapi-2.divineapi.com/indian-api/v1/find-ritu-and-anaya' \
--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-2.divineapi.com/indian-api/v1/find-ritu-and-anaya',
'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-2.divineapi.com/indian-api/v1/find-ritu-and-anaya",
"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-2.divineapi.com/indian-api/v1/find-ritu-and-anaya"
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
Both Authorization (Bearer token) and api_key are required for all requests.
Ensure accurate lat, lon, and tzone values for correct Ritu and Ayana results.
The API provides both Drik (observational) and Vedic (traditional) Ritu details.
Dinmana and Raatrimana represent day and night durations in hours, minutes, and seconds.
Madhyahna indicates the midpoint of the day based on local sunrise and sunset.
Always use HTTPS to ensure secure transmission of API data.