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

Planets Retrograde Transit API

The Planets Retrograde Transit API provides astrologically significant retrograde and progressive (direct) dates for major planets. Retrogression is an essential concept in Vedic astrology, indicating periods of reversal, review, delay, or intensified planetary influence. This API helps you fetch month-wise retrograde or progressive transition points for a selected planet based on location and timezone.


Step-by-Step Planets Retrograde Transit API Postman Testing Integration

For a guided setup, request example, and troubleshooting steps, refer to the official integration article:
https://support.divineapi.com/indian-astrology-apis/testing-panchang-api-find-grah-gochar-api-using-postman


Supported Language Codes

You can localize the API response 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

Supported codes include:

CodeLanguage
enEnglish
hiHindi
bnBengali
maMarathi
tmTamil
tlTelugu
mlMalayalam
knKannada

Supported Planets

This API supports retrograde transit checks for the following planets:

mercury
venus
mars
jupiter
saturn
uranus
neptune
pluto

Pass one of the above as the : planet path parameter.


API Endpoint

POST https://astroapi-3.divineapi.com/indian-api/v2/planet-retrograde-transit/:planet

Replace: planet with the actual planet name, for example:

POST https://astroapi-3.divineapi.com/indian-api/v2/planet-retrograde-transit/mars

Headers

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

Request Body

NameTypeRequiredDescription
api_keyStringYesYour API key.
monthIntegerYesMonth for which retrograde transit is to be calculated. Example: 05.
yearIntegerYesYear for which retrograde transit is to be calculated. Example: 2023.
placeStringYesPlace name, e.g. New Delhi.
latFloatYesLatitude of the place, e.g. 28.6139.
lonFloatYesLongitude of the place, e.g. 77.2090.
tzoneFloatYesTimezone offset, e.g. 5.5. See timezone guide: https://developers.divineapi.com/divine-api/understanding-time-zones-a-comprehensive-guide
lanStringNoResponse language code. Default is en.

200: OK Retrograde Transit fetched successfully

{
    "success": 1,
    "data": {
        "total_transit": 1,
        "transit": [
            {
                "date": "2023-05-15 08:47:00",
                "retrograde": "false",
                "progressive": "true"
            }
        ]
    }
}

Response Fields Description

success
Indicates whether the request was processed successfully. 1 means success.

data.message
A human-readable summary of how many retrograde/progressive transitions the specified planet has in the given month and year.

data.transit
An array of retrograde-related transition objects.

Each object inside transit includes:

FieldDescription
dateExact timestamp (server/localized to inputs) when the retrograde or progressive motion begins.
retrograde"true" if the planet turns retrograde at this timestamp.
progressive"true" if the planet turns direct/progressive at this timestamp. Only one of retrograde or progressive will be true at a time for a single record.

Notes on Behaviour

You must provide accurate location (place, lat, lon) and tzone to ensure correct astronomical calculation.

Some months may have no retrograde or progressive events for a planet; in such cases, the transit array may be empty and the message will indicate zero events.

Only the planets that have a retrograde phenomenon are supported (the list given above).

This is a month- and year-specific query; for a yearly dashboard you will need to call this endpoint for multiple months.


Example Code Implementations

Below are example implementations in various programming environments.


cURL

curl --location 'https://astroapi-3.divineapi.com/indian-api/v2/planet-retrograde-transit/:planet' \
--header 'Authorization: Bearer your API Access 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/v2/planet-retrograde-transit/:planet',
  'headers': {
    'Authorization': 'Bearer your API Access 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/v2/planet-retrograde-transit/:planet",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer your API Access 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/v2/planet-retrograde-transit/: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'}
files=[

]
headers = {
  'Authorization': 'Bearer your API Access Token'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)

Implementation Guidelines

Always send both Authorization (Bearer token) and api_key; both are mandatory.

Make sure the path parameter :planet is one of the supported retrograde planets.

Use the correct timezone offset to avoid off-by-hours issues in returned timestamps.

You can log or display both retrograde and progressive entries to show the full cycle for the user.

For multilingual astrology dashboards, bind the lan parameter to user preference.

Example Code
curl -X POST "https://astroapi-3.divineapi.com/indian-api/v2/planet-retrograde-transit/:planet" \
  -H "Authorization: Bearer your API Access 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"'
const FormData = require('form-data');
const axios = require('axios');

const 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');

const response = await axios.post('https://astroapi-3.divineapi.com/indian-api/v2/planet-retrograde-transit/:planet', form, {
  headers: {
    ...form.getHeaders(),
    'Authorization': 'Bearer your API Access Token',
  }
});

console.log(response.data);
import requests

url = "https://astroapi-3.divineapi.com/indian-api/v2/planet-retrograde-transit/:planet"
headers = {
    "Authorization": "Bearer your API Access Token",
}
payload = {
    "api_key": "your API key",
    "month": "05",
    "year": "2023",
    "place": "New Delhi",
    "lat": "28.6139",
    "lon": "77.2090",
    "tzone": "5.5",
    "lan": "en",
}

response = requests.post(url, headers=headers, data=payload)

print(response.json())
const formData = new FormData();
formData.append('api_key', 'your API key');
formData.append('month', '05');
formData.append('year', '2023');
formData.append('place', 'New Delhi');
formData.append('lat', '28.6139');
formData.append('lon', '77.2090');
formData.append('tzone', '5.5');
formData.append('lan', 'en');

const response = await fetch('https://astroapi-3.divineapi.com/indian-api/v2/planet-retrograde-transit/:planet', {
  method: 'POST',
  headers: {
      'Authorization': "Bearer your API Access Token",
    },
  body: formData,
});

const data = await response.json();
console.log(data);
<?php

use GuzzleHttp\Client;

$client = new Client();

$response = $client->request('POST', 'https://astroapi-3.divineapi.com/indian-api/v2/planet-retrograde-transit/:planet', [
    'headers' => [
        'Authorization' => 'Bearer your API Access Token',
    ],
    'multipart' => [
        ['name' => 'api_key', 'contents' => 'your API key'],
        ['name' => 'month', 'contents' => '05'],
        ['name' => 'year', 'contents' => '2023'],
        ['name' => 'place', 'contents' => 'New Delhi'],
        ['name' => 'lat', 'contents' => '28.6139'],
        ['name' => 'lon', 'contents' => '77.2090'],
        ['name' => 'tzone', 'contents' => '5.5'],
        ['name' => 'lan', 'contents' => 'en'],
    ],
]);

echo $response->getBody();
package main

import (
    "bytes"
    "fmt"
    "mime/multipart"
    "net/http"
    "io"
)

func main() {
    body := &bytes.Buffer{}
    writer := multipart.NewWriter(body)
    writer.WriteField("api_key", "your API key")
    writer.WriteField("month", "05")
    writer.WriteField("year", "2023")
    writer.WriteField("place", "New Delhi")
    writer.WriteField("lat", "28.6139")
    writer.WriteField("lon", "77.2090")
    writer.WriteField("tzone", "5.5")
    writer.WriteField("lan", "en")
    writer.Close()

    req, _ := http.NewRequest("POST", "https://astroapi-3.divineapi.com/indian-api/v2/planet-retrograde-transit/:planet", body)
    req.Header.Set("Content-Type", writer.FormDataContentType())
    req.Header.Set("Authorization", "Bearer your API Access Token")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    body2, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body2))
}
import okhttp3.*;
import java.io.IOException;

public class Main {
    public static void main(String[] args) throws IOException {
        OkHttpClient client = new OkHttpClient();

        RequestBody body = new MultipartBody.Builder()
            .setType(MultipartBody.FORM)
            .addFormDataPart("api_key", "your API key")
            .addFormDataPart("month", "05")
            .addFormDataPart("year", "2023")
            .addFormDataPart("place", "New Delhi")
            .addFormDataPart("lat", "28.6139")
            .addFormDataPart("lon", "77.2090")
            .addFormDataPart("tzone", "5.5")
            .addFormDataPart("lan", "en")
            .build();

        Request request = new Request.Builder()
            .url("https://astroapi-3.divineapi.com/indian-api/v2/planet-retrograde-transit/:planet")
            .post(body)
            .addHeader("Authorization", "Bearer your API Access Token")
            .build();

        Response response = client.newCall(request).execute();
        System.out.println(response.body().string());
    }
}
import Foundation

let url = URL(string: "https://astroapi-3.divineapi.com/indian-api/v2/planet-retrograde-transit/:planet")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("Bearer your API Access Token", forHTTPHeaderField: "Authorization")

let boundary = "Boundary-\(UUID().uuidString)"
request.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")

var bodyData = Data()
bodyData.append("--\(boundary)\r\n".data(using: .utf8)!)
bodyData.append("Content-Disposition: form-data; name=\"api_key\"\r\n\r\n".data(using: .utf8)!)
bodyData.append("your API key\r\n".data(using: .utf8)!)
bodyData.append("--\(boundary)\r\n".data(using: .utf8)!)
bodyData.append("Content-Disposition: form-data; name=\"month\"\r\n\r\n".data(using: .utf8)!)
bodyData.append("05\r\n".data(using: .utf8)!)
bodyData.append("--\(boundary)\r\n".data(using: .utf8)!)
bodyData.append("Content-Disposition: form-data; name=\"year\"\r\n\r\n".data(using: .utf8)!)
bodyData.append("2023\r\n".data(using: .utf8)!)
bodyData.append("--\(boundary)\r\n".data(using: .utf8)!)
bodyData.append("Content-Disposition: form-data; name=\"place\"\r\n\r\n".data(using: .utf8)!)
bodyData.append("New Delhi\r\n".data(using: .utf8)!)
bodyData.append("--\(boundary)\r\n".data(using: .utf8)!)
bodyData.append("Content-Disposition: form-data; name=\"lat\"\r\n\r\n".data(using: .utf8)!)
bodyData.append("28.6139\r\n".data(using: .utf8)!)
bodyData.append("--\(boundary)\r\n".data(using: .utf8)!)
bodyData.append("Content-Disposition: form-data; name=\"lon\"\r\n\r\n".data(using: .utf8)!)
bodyData.append("77.2090\r\n".data(using: .utf8)!)
bodyData.append("--\(boundary)\r\n".data(using: .utf8)!)
bodyData.append("Content-Disposition: form-data; name=\"tzone\"\r\n\r\n".data(using: .utf8)!)
bodyData.append("5.5\r\n".data(using: .utf8)!)
bodyData.append("--\(boundary)\r\n".data(using: .utf8)!)
bodyData.append("Content-Disposition: form-data; name=\"lan\"\r\n\r\n".data(using: .utf8)!)
bodyData.append("en\r\n".data(using: .utf8)!)
bodyData.append("--\(boundary)--\r\n".data(using: .utf8)!)
request.httpBody = bodyData

let task = URLSession.shared.dataTask(with: request) { data, response, error in
    if let data = data {
        print(String(data: data, encoding: .utf8) ?? "")
    }
}
task.resume()
import okhttp3.*

fun main() {
    val client = OkHttpClient()

    val body = MultipartBody.Builder()
        .setType(MultipartBody.FORM)
        .addFormDataPart("api_key", "your API key")
        .addFormDataPart("month", "05")
        .addFormDataPart("year", "2023")
        .addFormDataPart("place", "New Delhi")
        .addFormDataPart("lat", "28.6139")
        .addFormDataPart("lon", "77.2090")
        .addFormDataPart("tzone", "5.5")
        .addFormDataPart("lan", "en")
        .build()

    val request = Request.Builder()
        .url("https://astroapi-3.divineapi.com/indian-api/v2/planet-retrograde-transit/:planet")
        .post(body!!)
        .addHeader("Authorization", "Bearer your API Access Token")
        .build()

    client.newCall(request).execute().use { response ->
        println(response.body?.string())
    }
}
using System;
using System.Net.Http;
using System.Threading.Tasks;

class Program {
    static async Task Main() {
        using var client = new HttpClient();
        client.DefaultRequestHeaders.Add("Authorization", "Bearer your API Access Token");

        var content = new MultipartFormDataContent();
        content.Add(new StringContent("your API key"), "api_key");
        content.Add(new StringContent("05"), "month");
        content.Add(new StringContent("2023"), "year");
        content.Add(new StringContent("New Delhi"), "place");
        content.Add(new StringContent("28.6139"), "lat");
        content.Add(new StringContent("77.2090"), "lon");
        content.Add(new StringContent("5.5"), "tzone");
        content.Add(new StringContent("en"), "lan");

        var response = await client.PostAsync("https://astroapi-3.divineapi.com/indian-api/v2/planet-retrograde-transit/:planet", content);
        var result = await response.Content.ReadAsStringAsync();
        Console.WriteLine(result);
    }
}