AstrologyAPI

Sub Char Dasha

POSThttps://json.astrologyapi.com/v1/sub_chardasha/:md
Copy

The sub_chardasha/:md API provides information about sub-periods within a major period of Vedic astrology. The API response includes details about the major period, such as the name, duration, start and end dates, and a list of sub-periods with their respective start and end dates.

POST/sub_chardasha/:md
Copy
1import requests
2import json
3
4# Your API key
5api_key = "<YOUR_API_KEY>"
6
7# API endpoint URL
8api_url = "https://json.astrologyapi.com/v1/sub_chardasha/:md"
9
10# Request data
11data = {
12        "day": 10,
13        "month": 5,
14        "year": 1990,
15        "hour": 19,
16        "min": 55,
17        "lat": 19.2056,
18        "lon": 25.2056,
19        "tzone": 5.5
20    }
21
22headers = {
23    'x-astrologyapi-key': api_key,
24    'Content-Type': 'application/json'
25    # Add 'Accept-Language': '<language_code>' if needed
26}
27
28try:
29    response = requests.post(api_url, headers=headers, json=data)
30    response.raise_for_status()  # Raise an exception for bad status codes (4xx or 5xx)
31
32    # Process the response
33    response_data = response.json()
34    print(json.dumps(response_data, indent=4))
35
36except requests.exceptions.RequestException as e:
37    print(f"Error making API request: {e}")
38    if hasattr(e, 'response') and e.response is not None:
39        try:
40            print(f"Error response: {e.response.json()}")
41        except json.JSONDecodeError:
42             print(f"Error response (non-JSON): {e.response.text}")
43
44
200Response
Copy
1{
2  "major_dasha": {
3    "sign_id": 0,
4    "sign_name": "Aries",
5    "duration": "3 Years",
6    "start_date": "16-8-2027",
7    "end_date": "16-8-2030"
8  },
9  "sub_dasha": [
10    {
11      "sign_id": 1,
12      "sign_name": "Taurus",
13      "start_date": "16-8-2027",
14      "end_date": "16-11-2027",
15      "start_ms": 1818388800000,
16      "end_ms": 1826341200000
17    },
18    {
19      "sign_id": 2,
20      "sign_name": "Gemini",
21      "start_date": "16-11-2027",
22      "end_date": "16-2-2028",
23      "start_ms": 1826341200000,
24      "end_ms": 1834290000000
25    },
26    {
27      "sign_id": 3,
28      "sign_name": "Cancer",
29      "start_date": "16-2-2028",
30      "end_date": "16-5-2028",
31      "start_ms": 1834290000000,
32      "end_ms": 1842062400000
33    },
34    {
35      "sign_id": 4,
36      "sign_name": "Leo",
37      "start_date": "16-5-2028",
38      "end_date": "16-8-2028",
39      "start_ms": 1842062400000,
40      "end_ms": 1850011200000
41    },
42    {
43      "sign_id": 5,
44      "sign_name": "Virgo",
45      "start_date": "16-8-2028",
46      "end_date": "16-11-2028",
47      "start_ms": 1850011200000,
48      "end_ms": 1857963600000
49    },
50    {
51      "sign_id": 6,
52      "sign_name": "Libra",
53      "start_date": "16-11-2028",
54      "end_date": "16-2-2029",
55      "start_ms": 1857963600000,
56      "end_ms": 1865912400000
57    },
58    {
59      "sign_id": 7,
60      "sign_name": "Scorpio",
61      "start_date": "16-2-2029",
62      "end_date": "16-5-2029",
63      "start_ms": 1865912400000,
64      "end_ms": 1873598400000
65    },
66    {
67      "sign_id": 8,
68      "sign_name": "Sagittarius",
69      "start_date": "16-5-2029",
70      "end_date": "16-8-2029",
71      "start_ms": 1873598400000,
72      "end_ms": 1881547200000
73    },
74    {
75      "sign_id": 9,
76      "sign_name": "Capricorn",
77      "start_date": "16-8-2029",
78      "end_date": "16-11-2029",
79      "start_ms": 1881547200000,
80      "end_ms": 1889499600000
81    },
82    {
83      "sign_id": 10,
84      "sign_name": "Aquarius",
85      "start_date": "16-11-2029",
86      "end_date": "16-2-2030",
87      "start_ms": 1889499600000,
88      "end_ms": 1897448400000
89    },
90    {
91      "sign_id": 11,
92      "sign_name": "Pisces",
93      "start_date": "16-2-2030",
94      "end_date": "16-5-2030",
95      "start_ms": 1897448400000,
96      "end_ms": 1905134400000
97    },
98    {
99      "sign_id": 0,
100      "sign_name": "Aries",
101      "start_date": "16-5-2030",
102      "end_date": "16-8-2030",
103      "start_ms": 1905134400000,
104      "end_ms": 1913083200000
105    }
106  ]
107}

Request Headers

Authorization

string

required

Basic Authorization via header

Accept-Language

string

Preferred language for the response content

Properties

English - en

Request Parameters

day

int

required

Date of birth, eg: 10

month

int

required

Month of birth, eg: 5

year

int

required

Year of birth, eg: 1990

hour

int

required

Hour of birth, eg: 19

min

int

required

Minute of birth, eg: 55

lat

float

required

Latitude, eg: 19.2056

lon

float

required

Longitude, eg: 25.2056

tzone

float

required

Timezone, eg: 5.5

Path Parameters

md

string

required

Major Dasha, eg: aries,taurus

Properties

ariestaurusgeminicancerleovirgolibrascorpiosagittariuscapricornaquariuspisces

Errors

400
Bad Request

Something is wrong with your request format or parameters.

401
Unauthorized

Your API key is missing or invalid.

403
Forbidden

You don't have permission to access this specific resource.

404
Not Found

The API endpoint you're trying to reach doesn't exist.

500
Internal Server Error

Our server is having a temporary glitch.