AstrologyAPI

Western Chart Data

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

The western_chart_data API returns astrological house data for a person's natal chart, including the sign and degree of each house, as well as any planets located within each house. Additionally, the response includes information on any planetary aspects in the chart, including the type of aspect, the planets involved, and the orb (degree of influence) of the aspect.

POST/western_chart_data
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/western_chart_data"
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        "house_type": "placidus"
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  "houses": [
3    {
4      "start_degree": 138.21238,
5      "end_degree": 165.28495,
6      "sign": "Leo",
7      "house_id": 1,
8      "planets": []
9    },
10    {
11      "start_degree": 165.28495,
12      "end_degree": 195.58971,
13      "sign": "Virgo",
14      "house_id": 2,
15      "planets": [
16        {
17          "name": "Saturn",
18          "sign": "Libra",
19          "full_degree": 191.1268,
20          "is_retro": "true"
21        }
22      ]
23    },
24    {
25      "start_degree": 195.58971,
26      "end_degree": 227.54698,
27      "sign": "Libra",
28      "house_id": 3,
29      "planets": [
30        {
31          "name": "Moon",
32          "sign": "Libra",
33          "full_degree": 203.89,
34          "is_retro": "false"
35        }
36      ]
37    },
38    {
39      "start_degree": 227.54698,
40      "end_degree": 258.91956,
41      "sign": "Scorpio",
42      "house_id": 4,
43      "planets": []
44    },
45    {
46      "start_degree": 258.91956,
47      "end_degree": 289.00145,
48      "sign": "Sagittarius",
49      "house_id": 5,
50      "planets": [
51        {
52          "name": "Pluto",
53          "sign": "Capricorn",
54          "full_degree": 277.191,
55          "is_retro": "true"
56        },
57        {
58          "name": "Node",
59          "sign": "Sagittarius",
60          "full_degree": 265.1967,
61          "is_retro": "true"
62        },
63        {
64          "name": "Part of Fortune",
65          "sign": "Capricorn",
66          "full_degree": 287.9885,
67          "is_retro": "false"
68        }
69      ]
70    },
71    {
72      "start_degree": 289.00145,
73      "end_degree": 318.21238,
74      "sign": "Capricorn",
75      "house_id": 6,
76      "planets": []
77    },
78    {
79      "start_degree": 318.21238,
80      "end_degree": 345.28495,
81      "sign": "Aquarius",
82      "house_id": 7,
83      "planets": [
84        {
85          "name": "Neptune",
86          "sign": "Pisces",
87          "full_degree": 330.829,
88          "is_retro": "false"
89        },
90        {
91          "name": "Chiron",
92          "sign": "Pisces",
93          "full_degree": 335.191,
94          "is_retro": "false"
95        }
96      ]
97    },
98    {
99      "start_degree": 345.28495,
100      "end_degree": 15.58971,
101      "sign": "Pisces",
102      "house_id": 8,
103      "planets": []
104    },
105    {
106      "start_degree": 15.58971,
107      "end_degree": 47.54698,
108      "sign": "Aries",
109      "house_id": 9,
110      "planets": [
111        {
112          "name": "Mars",
113          "sign": "Taurus",
114          "full_degree": 32.993,
115          "is_retro": "false"
116        },
117        {
118          "name": "Mercury",
119          "sign": "Aries",
120          "full_degree": 29.0824,
121          "is_retro": "false"
122        },
123        {
124          "name": "Jupiter",
125          "sign": "Aries",
126          "full_degree": 25.6013,
127          "is_retro": "false"
128        },
129        {
130          "name": "Venus",
131          "sign": "Aries",
132          "full_degree": 29.2144,
133          "is_retro": "false"
134        }
135      ]
136    },
137    {
138      "start_degree": 47.54698,
139      "end_degree": 78.91956,
140      "sign": "Taurus",
141      "house_id": 10,
142      "planets": [
143        {
144          "name": "Sun",
145          "sign": "Taurus",
146          "full_degree": 54.1139,
147          "is_retro": "false"
148        }
149      ]
150    },
151    {
152      "start_degree": 78.91956,
153      "end_degree": 109.00145,
154      "sign": "Gemini",
155      "house_id": 11,
156      "planets": []
157    },
158    {
159      "start_degree": 109.00145,
160      "end_degree": 138.21238,
161      "sign": "Cancer",
162      "house_id": 12,
163      "planets": []
164    }
165  ],
166  "aspects": [
167    {
168      "aspecting_planet": "Sun",
169      "aspected_planet": "Moon",
170      "aspecting_planet_id": 0,
171      "aspected_planet_id": 1,
172      "type": "Quincunx",
173      "orb": 0.22,
174      "diff": 149.78
175    },
176    {
177      "aspecting_planet": "Sun",
178      "aspected_planet": "Mercury",
179      "aspecting_planet_id": 0,
180      "aspected_planet_id": 3,
181      "type": "Semi Sextile",
182      "orb": 4.97,
183      "diff": 25.03
184    },
185    {
186      "aspecting_planet": "Sun",
187      "aspected_planet": "Jupiter",
188      "aspecting_planet_id": 0,
189      "aspected_planet_id": 4,
190      "type": "Semi Sextile",
191      "orb": 1.49,
192      "diff": 28.51
193    },
194    {
195      "aspecting_planet": "Sun",
196      "aspected_planet": "Venus",
197      "aspecting_planet_id": 0,
198      "aspected_planet_id": 5,
199      "type": "Semi Sextile",
200      "orb": 5.1,
201      "diff": 24.9
202    },
203    {
204      "aspecting_planet": "Sun",
205      "aspected_planet": "Uranus",
206      "aspecting_planet_id": 0,
207      "aspected_planet_id": 7,
208      "type": "Semi Sqaure",
209      "orb": 5.75,
210      "diff": 50.75
211    },
212    {
213      "aspecting_planet": "Sun",
214      "aspected_planet": "Ascendant",
215      "aspecting_planet_id": 0,
216      "aspected_planet_id": 10,
217      "type": "Square",
218      "orb": 5.9,
219      "diff": 84.1
220    },
221    {
222      "aspecting_planet": "Moon",
223      "aspected_planet": "Mercury",
224      "aspecting_planet_id": 1,
225      "aspected_planet_id": 3,
226      "type": "Opposition",
227      "orb": 5.19,
228      "diff": 174.81
229    },
230    {
231      "aspecting_planet": "Moon",
232      "aspected_planet": "Jupiter",
233      "aspecting_planet_id": 1,
234      "aspected_planet_id": 4,
235      "type": "Opposition",
236      "orb": 1.71,
237      "diff": 178.29
238    },
239    {
240      "aspecting_planet": "Moon",
241      "aspected_planet": "Venus",
242      "aspecting_planet_id": 1,
243      "aspected_planet_id": 5,
244      "type": "Opposition",
245      "orb": 5.32,
246      "diff": 174.68
247    },
248    {
249      "aspecting_planet": "Moon",
250      "aspected_planet": "Pluto",
251      "aspecting_planet_id": 1,
252      "aspected_planet_id": 9,
253      "type": "Quintile",
254      "orb": 1.3,
255      "diff": 73.3
256    },
257    {
258      "aspecting_planet": "Moon",
259      "aspected_planet": "Ascendant",
260      "aspecting_planet_id": 1,
261      "aspected_planet_id": 10,
262      "type": "Sextile",
263      "orb": 5.68,
264      "diff": 65.68
265    },
266    {
267      "aspecting_planet": "Mars",
268      "aspected_planet": "Mercury",
269      "aspecting_planet_id": 2,
270      "aspected_planet_id": 3,
271      "type": "Conjunction",
272      "orb": 3.91,
273      "diff": 3.91
274    },
275    {
276      "aspecting_planet": "Mars",
277      "aspected_planet": "Venus",
278      "aspecting_planet_id": 2,
279      "aspected_planet_id": 5,
280      "type": "Conjunction",
281      "orb": 3.78,
282      "diff": 3.78
283    },
284    {
285      "aspecting_planet": "Mars",
286      "aspected_planet": "Uranus",
287      "aspecting_planet_id": 2,
288      "aspected_planet_id": 7,
289      "type": "Semi Sextile",
290      "orb": 0.37,
291      "diff": 29.63
292    },
293    {
294      "aspecting_planet": "Mars",
295      "aspected_planet": "Neptune",
296      "aspecting_planet_id": 2,
297      "aspected_planet_id": 8,
298      "type": "Sextile",
299      "orb": 2.16,
300      "diff": 62.16
301    },
302    {
303      "aspecting_planet": "Mars",
304      "aspected_planet": "Pluto",
305      "aspecting_planet_id": 2,
306      "aspected_planet_id": 9,
307      "type": "Trine",
308      "orb": 4.2,
309      "diff": 115.8
310    },
311    {
312      "aspecting_planet": "Mercury",
313      "aspected_planet": "Jupiter",
314      "aspecting_planet_id": 3,
315      "aspected_planet_id": 4,
316      "type": "Conjunction",
317      "orb": 3.48,
318      "diff": 3.48
319    },
320    {
321      "aspecting_planet": "Mercury",
322      "aspected_planet": "Venus",
323      "aspecting_planet_id": 3,
324      "aspected_planet_id": 5,
325      "type": "Conjunction",
326      "orb": 0.13,
327      "diff": 0.13
328    },
329    {
330      "aspecting_planet": "Mercury",
331      "aspected_planet": "Uranus",
332      "aspecting_planet_id": 3,
333      "aspected_planet_id": 7,
334      "type": "Semi Sextile",
335      "orb": 4.28,
336      "diff": 25.72
337    },
338    {
339      "aspecting_planet": "Mercury",
340      "aspected_planet": "Neptune",
341      "aspecting_planet_id": 3,
342      "aspected_planet_id": 8,
343      "type": "Sextile",
344      "orb": 1.75,
345      "diff": 58.25
346    },
347    {
348      "aspecting_planet": "Jupiter",
349      "aspected_planet": "Venus",
350      "aspecting_planet_id": 4,
351      "aspected_planet_id": 5,
352      "type": "Conjunction",
353      "orb": 3.61,
354      "diff": 3.61
355    },
356    {
357      "aspecting_planet": "Jupiter",
358      "aspected_planet": "Neptune",
359      "aspecting_planet_id": 4,
360      "aspected_planet_id": 8,
361      "type": "Sextile",
362      "orb": 5.23,
363      "diff": 54.77
364    },
365    {
366      "aspecting_planet": "Venus",
367      "aspected_planet": "Uranus",
368      "aspecting_planet_id": 5,
369      "aspected_planet_id": 7,
370      "type": "Semi Sextile",
371      "orb": 4.15,
372      "diff": 25.85
373    },
374    {
375      "aspecting_planet": "Venus",
376      "aspected_planet": "Neptune",
377      "aspecting_planet_id": 5,
378      "aspected_planet_id": 8,
379      "type": "Sextile",
380      "orb": 1.61,
381      "diff": 58.39
382    },
383    {
384      "aspecting_planet": "Saturn",
385      "aspected_planet": "Pluto",
386      "aspecting_planet_id": 6,
387      "aspected_planet_id": 9,
388      "type": "Square",
389      "orb": 3.94,
390      "diff": 86.06
391    },
392    {
393      "aspecting_planet": "Uranus",
394      "aspected_planet": "Neptune",
395      "aspecting_planet_id": 7,
396      "aspected_planet_id": 8,
397      "type": "Semi Sextile",
398      "orb": 2.54,
399      "diff": 32.54
400    },
401    {
402      "aspecting_planet": "Uranus",
403      "aspected_planet": "Pluto",
404      "aspecting_planet_id": 7,
405      "aspected_planet_id": 9,
406      "type": "Square",
407      "orb": 3.83,
408      "diff": 86.17
409    }
410  ]
411}

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

house_type

string

required

Default : placidus // koch/topocentric/poryphry/equal_house/whole_sign

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.