D
D
Divine API
Search
⌃K
Comment on page

Quick Start

Note: Make sure you already have the API Key and Access Token required to make API requests. If not, you can generate a new API Key and Access Token by signing up for a trial subscription. You will also need the Postman tool which you can get free from here.

STEP 1

Initial Setup

  1. 1.
    Open Postman on your computer.
  2. 2.
    Select the HTTP method as POST. We are going to use this API - /find-nivas-and-shool
  3. 3.
    Copy the full API URL and paste as below
​

STEP 2

Add Authentication

  1. 1.
    Go to the Auth tab of Postman.
  2. 2.
    Since all the APIs use Basic Auth, we will use Basic Auth from the Type select box.
  3. 3.
    Now, enter the Access Token.
​

STEP 3

Add Request Parameters / Birth Details

  1. 1.
    Now, go to the Body tab of Postman.
  2. 2.
    Follow the request parameters from the API doc and add them one by one as shown below:
​

STEP 4

Send Request

Once you have set up everything as mentioned above, you can call the API using the Send button. You will receive a response in JSON format as shown below.
​

​

Get your API keys

Your API requests are authenticated using API key and Authorization Token. Any request that doesn't include an API key or Token will return an error.
You can generate an API Access Token from your Dashboard at any time.

Make your first request

To make your first request, send an authenticated request to the find nakshatra endpoint. This will return you data for nakshatra, which is nice.
post
https://astro.divineapi.com/indian-api/v1
/find-nakshatra
Find nakshatra.
Returns nakshatra details in response.
Parameters
Header
Authorization*
String
your API Access Token
eg: Bearer {token}
Body
api_key*
String
your API key
day*
Integer
day of panchang, eg: 04
month*
Integer
month of panchang, eg: 04
year*
Integer
year of panchang, eg: 2023
lat*
Float
latitude, eg: 16.70499
lon*
Float
longitude, eg: 74.24325
tzone*
Float
timezone, eg: 5.5
Responses
200
Naskshatra details fetched successfully
Note: The API find-nakshatra allows users to find past and future matches based on a specified date. The response includes a list of past and future matches, each with a start and end time.
Take a look at how you might call this method via cURL, NodeJS or JavaScript jQuery AJAX:
cURL
NodeJS
JavaScript jQuery AJAX
curl -X POST \
https://astro.divineapi.com/indian-api/v1/find-nakshatra \
-H 'authorization: Bearer {Your API Access Token}' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-F api_key={Your API Key}
-F day=04 \
-F month=04 \
-F year=2023 \
-F lat=74.24325 \
-F lon=16.70499 \
-F tzone=5.5 \
var request = require("request");
​
var options = { method: 'POST',
url: 'https://astro.divineapi.com/indian-api/v1/find-nakshatra',
headers:
{ 'cache-control': 'no-cache',
authorization: 'Bearer {Your API Access Token}',
'content-type': 'application/json' },
formData:
{ api_key: {Your API Key},
day: '04',
month: '04',
year: '2023',
lon: '16.70499',
lat: '74.24325',
tzone: '5.5' } };
​
request(options, function (error, response, body) {
if (error) throw new Error(error);
​
console.log(body);
});
var form = new FormData();
form.append("api_key", "{Your API Key}");
form.append("day", "04");
form.append("month", "04");
form.append("year", "2023");
form.append("lon", "16.70499");
form.append("lat", "74.24325");
form.append("tzone", "5.5");
​
var settings = {
"async": true,
"crossDomain": true,
"url": "https://astro.divineapi.com/indian-api/v1/find-nakshatra",
"method": "POST",
"headers": {
"authorization": "Bearer {Your API Access Token}",
"cache-control": "no-cache"
},
"processData": false,
"contentType": false,
"mimeType": "application/json",
"data": form
}
​
$.ajax(settings).done(function (response) {
console.log(response);
});