AstrologyAPI

Horoscope Chart

POSThttps://json.astrologyapi.com/v1/horo_chart/:chart_id
Copy

based on chart type(all D-charts) - The data points include various planetary positions along with ascendant and their respective house positions to draw charts.

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

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

chartType

string

Chart type, eg: 'north', 'south' or 'east'

Properties

northsoutheast
image_type

string

Image type, eg: 'png' or 'svg'

Properties

svgpng

Path Parameters

chart_id

string

required

Chart ID, eg: MOON,SUN

Properties

chalit : For Chalit ChartSUN : For Sun ChartMOON : For Moon ChartD1 : For Birth ChartD2 : For Hora ChartD3 : For Dreshkan ChartD4 : For Chathurthamasha ChartD5 : For Panchmansha ChartD7 : For Saptamansha ChartD8 : For Ashtamansha ChartD9 : For Navamansha ChartD10 : For Dashamansha ChartD12 : For Dwadashamsha chartD16 : For Shodashamsha ChartD20 : For Vishamansha ChartD24 : For Chaturvimshamsha ChartD27 : For Bhamsha ChartD30 : For Trishamansha ChartD40 : For Khavedamsha ChartD45 : For Akshvedansha ChartD60 : For Shashtymsha Chart

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.