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

Grah Gochar (Planet Transit) API

The Grah Gochar (Planet Transit) API provides detailed planetary transit data, identifying when a planet moves from one zodiac sign to another. This transition influences the astrological environment and plays a major role in predictive astrology. The API returns the zodiac sign, sign number, and exact date-time of transit for a specified planet, helping astrologers and developers integrate accurate transit data into their systems.


Step-by-Step Find Grah Gochar API Postman Testing Integration

For a complete walkthrough on testing this API in Postman, refer to the official documentation:

Step by Step Find Grah Gochar API Postman Testing Integration
https://support.divineapi.com/indian-astrology-apis/testing-panchang-api-find-grah-gochar-api-using-postman


Supported Language Codes

You can receive the API response in multiple Indian languages 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:
If lan is not provided, English (en) will be used as the default language.


Planet Name Parameters

The API supports the following planet names to be used in the request URL as path parameters:

sun
moon
mercury
venus
mars
jupiter
saturn
uranus
neptune
pluto

API Endpoint

POST https://astroapi-3.divineapi.com/indian-api/v1/grah-gochar/:planet

Replace :planet with one of the planet names listed above.

This endpoint returns the date, time, and zodiac sign where the specified planet transits during a given month and year.


Headers

NameTypeDescription
Authorization*StringYour API Access Token. Example: Bearer {token}

Request Body

NameTypeRequiredDescription
api_keyStringYesYour Divine API key.
monthIntegerYesMonth of transit calculation. Example: 05.
yearIntegerYesYear of transit calculation. Example: 2023.
placeStringYesPlace name, e.g. New Delhi.
latFloatYesLatitude of the location. Example: 28.6139.
lonFloatYesLongitude of the location. Example: 77.2090.
tzoneFloatYesTimezone offset. Example: 5.5. Refer to Timezone Guide.
lanStringNoLanguage code from the supported list. Default is en.

200: OK Grah Gochar successfully

{
    "success": 1,
    "data": {
        "message": "Sun have 1 transit in May 2023.",
        "transit": [
            {
                "sign": "Taurus",
                "sign_no": 2,
                "datetime": "2023-05-15 11:45:00"
            }
        ]
    }
}

Field Explanation

message
A summary text indicating how many transits occurred for the planet within the requested period.

transit
An array containing detailed transit data, including the sign and the corresponding timestamp.

sign
The zodiac sign into which the planet has transited.

sign_no
The sequential number of the zodiac sign (1 for Aries, 2 for Taurus, etc.).

datetime
The precise timestamp of the planetary transit in the format YYYY-MM-DD HH:MM:SS.


Example Code Implementations

Below are example implementations in various programming environments.


cURL

curl --location 'https://astroapi-3.divineapi.com/indian-api/v1/grah-gochar/:planet' \
--header 'Authorization: Bearer {Your Auth Token}' \
--form 'api_key="{Your API Key}"' \
--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/v1/grah-gochar/sun',
  'headers': {
    'Authorization': 'Bearer {Your Auth Token}'
  },
  formData: {
    'api_key': '{Your API Key}',
    '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("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/v1/grah-gochar/:planet",
  "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/v1/grah-gochar/:planet"

payload = {'api_key': '{Your API Key}',
'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)


Implementation Notes

Always include both the Authorization header and the api_key in the request.

Replace :planet with the appropriate planet name in the endpoint URL.

Ensure accurate lat, lon, and tzone values for precise timing calculations.

Time and sign details vary based on the specified timezone and coordinates.

Use the lan field for multilingual support.

This API is ideal for building transit calendars, horoscope sections, and planetary movement trackers.