POST
Good and Bad Times
Good and Bad Times
/good-bad-times
Method
POST
Format
JSON
Auth
API Key
Credits
1
Overview
Good and Bad TimesRequest Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
year
|
integer | Yes | Year number, eg: 2023 | 2023 |
month
|
integer | Yes | Month number,with no leading zero | 7 |
date
|
integer | Yes | Day number,with no leading zero | 5 |
hours
|
integer | Yes | Hours number,with no leading zero | 1 |
minutes
|
integer | Yes | Minutes number,with no leading zero | 1 |
seconds
|
integer | Yes | Seconds number, with no leading zero | 0 |
latitude
|
float | Yes | Latitude number, in the range from -90 to 90 | 12.86 |
longitude
|
float | Yes | Longitude number, in the range from -180 to 180 | 123.5 |
timezone
|
float | Yes | Timezone of birth location, eg: 5.5 | 5.5 |
config
|
object | No | Contains optional configuration values | |
ayanamsha
|
string | No | Either "tropical" or "sayana" or "lahiri" | Either "tropical" or "sayana" or "lahiri" |
observation_point
|
string | No | Geocentric positions are calculated with respect to the center of Earth. Topocentric positions are calculated with respect to the actual given place | Either "topocentric" or "geocentric" |
Request Example
{
"year": 2022,
"month": 8,
"date": 11,
"hours": 6,
"minutes": 0,
"seconds": 0,
"latitude": 17.38333,
"longitude": 78.4666,
"timezone": 5.5,
"config": {
"observation_point": "topocentric",
"ayanamsha": "lahiri"
}
}
Response Examples
Example responses returned by this API.
Response
{
"statusCode": 200,
"abhijit_data": "{\"starts_at\": \"2025-08-26 11:58:29.600000\", \"ends_at\": \"2025-08-26 12:49:25.400000\"}",
"amrit_kaal_data": "{\"starts_at\": \"2025-08-26 22:19:22.250000\", \"ends_at\": \"2025-08-27 00:05:25.116667\"}",
"brahma_muhurat_data": "{\"starts_at\": \"2025-08-26 04:25:59\", \"ends_at\": \"2025-08-26 05:13:59\"}",
"rahu_kaalam_data": "{\"starts_at\": \"2025-08-26 15:34:56.750000\", \"ends_at\": \"2025-08-26 17:10:26.375000\"}",
"yama_gandam_data": "{\"starts_at\": \"2025-08-26 09:12:58.250000\", \"ends_at\": \"2025-08-26 10:48:27.875000\"}",
"gulika_kalam_data": "{\"starts_at\": \"2025-08-26 12:23:57.500000\", \"ends_at\": \"2025-08-26 13:59:27.125000\"}",
"dur_muhurat_data": "{\"1\": {\"starts_at\": \"2025-08-26 08:34:46.400000\", \"ends_at\": \"2025-08-26 09:25:42.200000\"}, \"2\": {\"starts_at\": \"2025-08-26 23:16:29.200000\", \"ends_at\": \"2025-08-27 00:01:34.733333\"}}",
"varjyam_data": "{\"starts_at\": \"2025-08-25 08:17:14.100000\", \"ends_at\": \"2025-08-25 10:00:57.233333\"}"
}
Code Examples
Use the following examples to integrate this API into your application.
PHP Code
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://json.freeastrologyapi.com/good-bad-times',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"year": 2025,
"month": 8,
"date": 26,
"hours": 8,
"minutes": 0,
"seconds": 0,
"latitude": 22.70,
"longitude": 77.10,
"timezone": 5.5,
"config": {
"observation_point": "topocentric",
"ayanamsha": "lahiri"
}
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'x-api-key: YOUR_API_KEY_HERE'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Python Code
import requests
import json
url = "https://json.freeastrologyapi.com/good-bad-times"
payload = json.dumps({
"year": 2025,
"month": 8,
"date": 26,
"hours": 8,
"minutes": 0,
"seconds": 0,
"latitude": 22.7,
"longitude": 77.1,
"timezone": 5.5,
"config": {
"observation_point": "topocentric",
"ayanamsha": "lahiri"
}
})
headers = {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY_HERE'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Node JS Code
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://json.freeastrologyapi.com/good-bad-times',
'headers': {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY_HERE'
},
body: JSON.stringify({
"year": 2025,
"month": 8,
"date": 26,
"hours": 8,
"minutes": 0,
"seconds": 0,
"latitude": 22.7,
"longitude": 77.1,
"timezone": 5.5,
"config": {
"observation_point": "topocentric",
"ayanamsha": "lahiri"
}
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});