AstrologyAPI

Lalkitab Horoscope

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

The lalkitab_horoscope API provides a horoscope report based on Lal Kitab astrology, which includes the sign number and name, along with the planets associated with each sign. The response provides information such as the signs, the names of the signs, and the planets that are associated with them according to Lal Kitab astrology.

POST/lalkitab_horoscope
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/lalkitab_horoscope"
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  {
3    "sign": 1,
4    "sign_name": "Aries",
5    "planet": [],
6    "planet_small": [],
7    "planet_degree": []
8  },
9  {
10    "sign": 2,
11    "sign_name": "Taurus",
12    "planet": [],
13    "planet_small": [],
14    "planet_degree": []
15  },
16  {
17    "sign": 3,
18    "sign_name": "Gemini",
19    "planet": [],
20    "planet_small": [],
21    "planet_degree": []
22  },
23  {
24    "sign": 4,
25    "sign_name": "Cancer",
26    "planet": [
27      "KETU"
28    ],
29    "planet_small": [
30      "Ke "
31    ],
32    "planet_degree": []
33  },
34  {
35    "sign": 5,
36    "sign_name": "Leo",
37    "planet": [],
38    "planet_small": [],
39    "planet_degree": []
40  },
41  {
42    "sign": 6,
43    "sign_name": "Virgo",
44    "planet": [],
45    "planet_small": [],
46    "planet_degree": []
47  },
48  {
49    "sign": 7,
50    "sign_name": "Libra",
51    "planet": [
52      "MOON"
53    ],
54    "planet_small": [
55      "Mo "
56    ],
57    "planet_degree": []
58  },
59  {
60    "sign": 8,
61    "sign_name": "Scorpio",
62    "planet": [
63      "JUPITER",
64      "SATURN"
65    ],
66    "planet_small": [
67      "Ju ",
68      "Sa "
69    ],
70    "planet_degree": []
71  },
72  {
73    "sign": 9,
74    "sign_name": "Sagittarius",
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": 10,
91    "sign_name": "Capricorn",
92    "planet": [
93      "RAHU"
94    ],
95    "planet_small": [
96      "Ra "
97    ],
98    "planet_degree": []
99  },
100  {
101    "sign": 11,
102    "sign_name": "Aquarius",
103    "planet": [],
104    "planet_small": [],
105    "planet_degree": []
106  },
107  {
108    "sign": 12,
109    "sign_name": "Pisces",
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 - 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

Request Description

Here planet name means for which planet you want data.
Planet name's are as follow:-
sun, moon, mars, mercury, jupiter, venus, saturn

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.