AstrologyAPI

Varshaphal Yearly Chart

POSThttps://json.astrologyapi.com/v1/varshaphal_year_chart
Copy

POST/varshaphal_year_chart
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/varshaphal_year_chart"
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        "varshphal_year": 1990
21    }
22
23headers = {
24    'x-astrologyapi-key': api_key,
25    'Content-Type': 'application/json'
26    # Add 'Accept-Language': '<language_code>' if needed
27}
28
29try:
30    response = requests.post(api_url, headers=headers, json=data)
31    response.raise_for_status()  # Raise an exception for bad status codes (4xx or 5xx)
32
33    # Process the response
34    response_data = response.json()
35    print(json.dumps(response_data, indent=4))
36
37except requests.exceptions.RequestException as e:
38    print(f"Error making API request: {e}")
39    if hasattr(e, 'response') and e.response is not None:
40        try:
41            print(f"Error response: {e.response.json()}")
42        except json.JSONDecodeError:
43             print(f"Error response (non-JSON): {e.response.text}")
44
45
200Response
Copy
1{
2  "year_lord": "Mars",
3  "varshaphal_date": "27-06-2001 21:36:24",
4  "chart": [
5    {
6      "sign": 10,
7      "sign_name": "Capricorn",
8      "planet": [],
9      "planet_small": [],
10      "planet_degree": []
11    },
12    {
13      "sign": 11,
14      "sign_name": "Aquarius",
15      "planet": [],
16      "planet_small": [],
17      "planet_degree": []
18    },
19    {
20      "sign": 12,
21      "sign_name": "Pisces",
22      "planet": [],
23      "planet_small": [],
24      "planet_degree": []
25    },
26    {
27      "sign": 1,
28      "sign_name": "Aries",
29      "planet": [
30        "VENUS"
31      ],
32      "planet_small": [
33        "Ve "
34      ],
35      "planet_degree": []
36    },
37    {
38      "sign": 2,
39      "sign_name": "Taurus",
40      "planet": [
41        "MERCURY",
42        "SATURN"
43      ],
44      "planet_small": [
45        "Me ",
46        "Sa "
47      ],
48      "planet_degree": []
49    },
50    {
51      "sign": 3,
52      "sign_name": "Gemini",
53      "planet": [
54        "SUN",
55        "JUPITER",
56        "RAHU"
57      ],
58      "planet_small": [
59        "Su ",
60        "Ju ",
61        "Ra "
62      ],
63      "planet_degree": []
64    },
65    {
66      "sign": 4,
67      "sign_name": "Cancer",
68      "planet": [],
69      "planet_small": [],
70      "planet_degree": []
71    },
72    {
73      "sign": 5,
74      "sign_name": "Leo",
75      "planet": [],
76      "planet_small": [],
77      "planet_degree": []
78    },
79    {
80      "sign": 6,
81      "sign_name": "Virgo",
82      "planet": [
83        "MOON"
84      ],
85      "planet_small": [
86        "Mo "
87      ],
88      "planet_degree": []
89    },
90    {
91      "sign": 7,
92      "sign_name": "Libra",
93      "planet": [],
94      "planet_small": [],
95      "planet_degree": []
96    },
97    {
98      "sign": 8,
99      "sign_name": "Scorpio",
100      "planet": [
101        "MARS"
102      ],
103      "planet_small": [
104        "Ma "
105      ],
106      "planet_degree": []
107    },
108    {
109      "sign": 9,
110      "sign_name": "Sagittarius",
111      "planet": [
112        "KETU"
113      ],
114      "planet_small": [
115        "Ke "
116      ],
117      "planet_degree": []
118    }
119  ]
120}

Request Headers

Authorization

string

required

Basic Authorization via header

Accept-Language

string

Preferred language for the response content

Properties

English - enHindi - hiMarathi - maBengali - bnTamil - taTelugu - teMalayalam - mlKannada - kn

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

varshphal_year

int

required

Varshphal year, eg: 1990

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.