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

Eclipse

Retrieve detailed Eclipse insights, including the astrological impact, timing, and influence of Solar and Lunar eclipses based on the native’s birth details.


Supported Language Codes

These language codes are supported by this API. Use them by passing the lan parameter in the request body.

CodeLanguage
enEnglish
hiHindi
ptPortuguese
frFrench
deGerman
jaJapanese
trTurkish
ruRussian
itItalian
esSpanish
nlDutch
plPolish

API Endpoint

POST https://astroapi-8.divineapi.com/western-api/v1/eclipse

Returns Eclipse details in the response.


Headers

NameTypeDescription
Authorization*StringYour API Access Token (Bearer {token})

Request Body

KeyTypeDescription
api_key*StringYour Divine API key
year*IntegerYear of input. Example: 2023.
lat*FloatLatitude of the place. Example: 28.6139.
lon*FloatLongitude of the place. Example: 77.2090.
tzone*FloatTimezone offset (e.g., 5.5). See: https://developers.divineapi.com/divine-api/understanding-time-zones-a-comprehensive-guide
place*StringLocation name. Example: New Delhi.

200: OK Eclipse Details Fetched Successfully

{
    "status": "success",
    "code": 200,
    "message": "Request successful",
    "data": {
        "eclipse_count": 4,
        "eclipse_data": [
            {
                "eclipse": "Solar",
                "eclipse_type": "Total Solar",
                "datetime": "2023-04-20 09:42:00",
                "orb": 4.59
            },
            {
                "eclipse": "Lunar",
                "eclipse_type": "Penumbral Lunar",
                "datetime": "2023-05-05 23:04:00",
                "orb": 11.37
            },
            {
                "eclipse": "Solar",
                "eclipse_type": "Total Solar",
                "datetime": "2023-10-14 23:25:00",
                "orb": 3.9
            },
            {
                "eclipse": "Lunar",
                "eclipse_type": "Penumbral Lunar",
                "datetime": "2023-10-29 01:54:00",
                "orb": 10.88
            }
        ]
    }
}

Example Code Implementations

Below are example implementations in various programming environments.


cURL

curl --location 'https://astroapi-8.divineapi.com/western-api/v1/eclipse' \
--header 'Authorization: Bearer {token}' \
--form 'api_key="Your API Key"' \
--form 'year="2023"' \
--form 'place="New Delhi, India"' \
--form 'lat="28.7041"' \
--form 'lon="77.1025"' \
--form 'tzone="5.5"'

NodeJS

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://astroapi-8.divineapi.com/western-api/v1/eclipse',
  'headers': {
    'Authorization': 'Bearer {token}'
  },
  formData: {
    'api_key': 'Your API Key',
    'year': '2023',
    'place': 'New Delhi, India',
    'lat': '28.7041',
    'lon': '77.1025',
    'tzone': '5.5'
  }
};
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("year", "2023");
form.append("place", "New Delhi, India");
form.append("lat", "28.7041");
form.append("lon", "77.1025");
form.append("tzone", "5.5");

var settings = {
  "url": "https://astroapi-8.divineapi.com/western-api/v1/eclipse",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer {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-8.divineapi.com/western-api/v1/eclipse"

payload = {'api_key': 'Your API Key',
'year': '2023',
'place': 'New Delhi, India',
'lat': '28.7041',
'lon': '77.1025',
'tzone': '5.5'}
files=[

]
headers = {
  'Authorization': 'Bearer {token}'
}

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

print(response.text)

Implementation Notes

Use Authorization: Bearer {Your Auth Token} and {Your API Key} securely; never expose them in client-side code.

Provide date, time, and coordinates in correct numeric formats; use decimal timezone values (e.g., 5.5).

Check HTTP status codes, log responses, and handle 4xx/5xx errors appropriately.

Default language is lan=en.

Test all endpoints via Postman first and always use HTTPS for secure communication.